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 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] present domU with 1 CPU with multiple cores

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] present domU with 1 CPU with multiple cores
From: Jonathan Salomon <jonathan@xxxxxxxxxxxxx>
Date: Wed, 24 Jun 2009 12:56:57 +0300
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Wed, 24 Jun 2009 02:57:42 -0700
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
Thread-index: Acnz3MbiKr+s+D4iQ1GJnhrdYib6NwA0fKGA
Thread-topic: present domU with 1 CPU with multiple cores
Hi Xen-devs,

I am writing you with a problem on this devel list, because I cannot find an 
answer or documentation about the cpuid syntax (e.g. none in the xmdomain.cfg 
manpages, Xen Wiki or xen-users list). I assume people on this list will be 
able to help and I am prepared to document my findings  (in the Wiki) to help 
other people.

I have a machine with 2 physical CPUs with each 2 cores and as such when I do 
cat /proc/cpuinfo on Dom0 it reports 4 CPUs. One of the DomU instances runs 
software for which I have bought a 1CPU license. Consequently I have to set 
'vcpus=1' otherwise it will tell me that I do not have a multiple CPU license. 
However it is ok to have 1 CPU with multiple cores. Therefore to speed things 
up I was wondering how I can tell Xen to assign say 2 cores to this DomU 
instance, but present it as 1 socket CPU with 2 cores.


One of the example config files contains the following section for a one socket 
8 core cpu:

#   Expose to the guest multi-core cpu instead of multiple processors
# Example for intel, expose a 8-core processor :
#cpuid=['1:edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
#          ebx=xxxxxxxx00010000xxxxxxxxxxxxxxxx',
#     '4,0:eax=001111xxxxxxxxxxxxxxxxxxxxxxxxxx']
#  - CPUID.1[EDX][HT] : Enable HT
#  - CPUID.1[EBX] : Number of vcpus * 2
#  - CPUID.4,0[EAX] : Number of vcpus * 2 - 1
#vcpus=8


Therefore I figured that for a single CPU with 2 cores I needed to change this 
as follows (taking into account the vcpus*2 and vcpus * 2-1):

cpuid=['1:edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx,ebx=xxxxxxxx00000100xxxxxxxxxxxxxxxx','4,0:eax=000011xxxxxxxxxxxxxxxxxxxxxxxxxx']
vcpus=2

However my application still complains that 'The server has 2 CPUs, but this 
product is licensed for 1'. What am I doing wrong? I have a m1.xlarge instance 
on Amazon EC2, which exposes a single CPU with 4 cores to the OS and the 
application eats that perfectly. So it should be possible...

Can anyone explain to me what to do and what the syntax is of the cpuid 
directive? I've been reading a bit about cpuid and I understand that the edx, 
ebx and eax are
Registers. But I don't understand what the 1: and the 4,0: are. Hope someone 
can clarify this for me.

Thank you in advance!

Best wishes,
Jonathan Salomon

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>