WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Xen

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH] xenalyze: Unify setting of vcpu data type

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenalyze: Unify setting of vcpu data type
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: 2011年3月02日 20:13:01 +0000
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: 2011年3月02日 12:15:04 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# HG changeset patch
# User George Dunlap <george.dunlap@xxxxxxxxxxxxx>
# Date 1299096700 0
# Node ID df4a4a3e8a606e274209030fe64776a971d39e5f
# Parent 3ef6e80faa4584837b55a58b8ffdd379e8ad0071
xenalyze: Unify setting of vcpu data type
Also initialize the hvm struct when the type is set,
not when the first vmexit happens.
Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
diff -r 3ef6e80faa45 -r df4a4a3e8a60 xenalyze.c
--- a/xenalyze.c Wed Mar 02 20:11:40 2011 +0000
+++ b/xenalyze.c Wed Mar 02 20:11:40 2011 +0000
@@ -1889,6 +1889,7 @@
 void update_io_address(struct io_address ** list, unsigned int pa, int dir,
 tsc_t arc_cycles, unsigned int va);
 int check_extra_words(struct record_info *ri, int expected_size, const char 
*record);
+int vcpu_set_data_type(struct vcpu_data *v, int type);
 
 void cpumask_init(cpu_mask_t *c) {
 *c = 0UL;
@@ -5290,12 +5291,10 @@
 struct hvm_data *h = &v->hvm;
 
 assert(p->current);
- assert(p->current->data_type == VCPU_DATA_NONE
- || p->current->data_type == VCPU_DATA_HVM);
-
- if(!v->data_type)
- v->data_type = VCPU_DATA_HVM;
- 
+
+ if(vcpu_set_data_type(p->current, VCPU_DATA_HVM))
+ return;
+
 if(ri->evt.sub == 2)
 {
 UPDATE_VOLUME(p, hvm[HVM_VOL_HANDLER], ri->size);
@@ -6214,8 +6213,8 @@
 int gpl = sevt.paging_levels + 2;
 
 assert(p->current);
- assert(p->current->data_type == VCPU_DATA_NONE
- || p->current->data_type == VCPU_DATA_HVM);
+ if(vcpu_set_data_type(p->current, VCPU_DATA_HVM))
+ return;
 
 h = &p->current->hvm;
 
@@ -6543,8 +6542,8 @@
 
 union pv_event pevt = { .event = ri->event };
 
- assert(p->current->data_type == VCPU_DATA_NONE
- || p->current->data_type == VCPU_DATA_PV);
+ if(vcpu_set_data_type(p->current, VCPU_DATA_PV))
+ return;
 
 if(opt.summary_info) {
 pv->summary_info=1;
@@ -7686,6 +7685,26 @@
 }
 }
 
+int vcpu_set_data_type(struct vcpu_data *v, int type)
+{
+ if (v->data_type == VCPU_DATA_NONE )
+ {
+ v->data_type = type;
+ switch(type)
+ {
+ case VCPU_DATA_HVM:
+ init_hvm_data(&v->hvm, v);
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ assert(v->data_type == type);
+ return 0;
+}
+
+
 void lose_vcpu(struct vcpu_data *v, tsc_t tsc)
 {
 if(v->data_type == VCPU_DATA_HVM)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xenalyze: Unify setting of vcpu data type, George Dunlap <=
Previous by Date: [Xen-devel] [PATCH] xenalyze: Unify record size checks , George Dunlap
Next by Date: Re: [Xen-devel] Xen 4.1 RC6 status report , Shriram Rajagopalan
Previous by Thread: [Xen-devel] [PATCH] xenalyze: Unify record size checks , George Dunlap
Next by Thread: [Xen-devel] task_struct in xen , Nimgaonkar, Satyajeet
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /