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] Re: [Xen-staging] [xen-unstable] Added some more fields to h

To: ewan@xxxxxxxxxxxxx
Subject: [Xen-devel] Re: [Xen-staging] [xen-unstable] Added some more fields to host_cpu.
From: Alex Williamson <alex.williamson@xxxxxx>
Date: 2007年3月02日 13:39:46 -0700
Cc: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Hollis Blanchard <hollisb@xxxxxxxxxx>
Delivery-date: 2007年3月02日 12:39:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200702270156.l1R1uLfk014775@xxxxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: HP OSLO R&D
References: <200702270156.l1R1uLfk014775@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Ewan,
 There are a couple problems with this patch for non-x86 (and maybe
even on x86), see below:
On Tue, 2007年02月27日 at 01:56 +0000, Xen staging patchbot-unstable wrote:
> diff -r e7b2a282c9e7 -r 50e0616fd012 tools/python/xen/xend/XendNode.py
> --- a/tools/python/xen/xend/XendNode.py Mon Feb 26 17:20:36 2007 +0000
> +++ b/tools/python/xen/xend/XendNode.py Tue Feb 27 00:37:27 2007 +0000
> @@ -81,7 +81,7 @@ class XendNode:
> for cpu_uuid, cpu in saved_cpus.items():
> self.cpus[cpu_uuid] = cpu
>
> - # verify we have enough cpus here
> + cpuinfo = parse_proc_cpuinfo()
> physinfo = self.physinfo_dict()
> cpu_count = physinfo['nr_cpus']
> cpu_features = physinfo['hw_caps']
> @@ -91,12 +91,23 @@ class XendNode:
> if cpu_count != len(self.cpus):
> self.cpus = {}
> for i in range(cpu_count):
> - cpu_uuid = uuid.createString()
> - cpu_info = {'uuid': cpu_uuid,
> - 'host': self.uuid,
> - 'number': i,
> - 'features': cpu_features}
> - self.cpus[cpu_uuid] = cpu_info
> + u = uuid.createString()
> + self.cpus[u] = {'uuid': u, 'number': i }
> +
> + for u in self.cpus.keys():
> + log.error(self.cpus[u])
> + number = self.cpus[u]['number']
> + log.error(number)
> + log.error(cpuinfo)
> + self.cpus[u].update(
> + { 'host' : self.uuid,
> + 'features' : cpu_features,
> + 'speed' : int(float(cpuinfo[number]['cpu MHz'])),
> + 'vendor' : cpuinfo[number]['vendor_id'],
> + 'modelname': cpuinfo[number]['model name'],
> + 'stepping' : cpuinfo[number]['stepping'],
> + 'flags' : cpuinfo[number]['flags'],
> + })
 On ia64, dom0 doesn't automatically get vcpus for each physical cpu,
so the first problem is that we're not going to have a /proc/cpuinfo
entry for every cpu in self.cpus.keys. I think it's likely x86 could
run into this problem too if a cpu was hotplugged or booted with the
dom0_max_vcpus options.
 The second problem is that /proc/cpuinfo fields are very architecture
specific. I'd suggest importing arch and having separate cases for x86,
ia64, and powerpc. For ia64, think the most appropriate mapping would
be:
 self.cpus[u].update(
 { 'host' : self.uuid,
 'features' : cpu_features,
 'speed' : int(float(cpuinfo[0]['cpu MHz'])),
 'vendor' : cpuinfo[0]['vendor'],
 'modelname': cpuinfo[0]['family'],
 'stepping' : cpuinfo[0]['model'],
 'flags' : cpuinfo[0]['features'],
 })
Hollis or Jimi might be able to chime in with identifiers that would
work on powerpc. Thanks,
 Alex
-- 
Alex Williamson HP Open Source & Linux Org.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: Re: [Xen-devel] xenbus_dev_request_and_reply() , John Levon
Next by Date: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] Added some more fields to host_cpu. , John Levon
Previous by Thread: [Xen-devel] [PATCH][XEND] Fix actions_after_* fields in VM class , Jim Fehlig
Next by Thread: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] Added some more fields to host_cpu. , John Levon
Indexes: [Date] [Thread] [Top] [All Lists]

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

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