Re: [kvm-devel] [PATCH] SMP: Setup multiple tss for real mode emulation

2007-07-12 Thread Avi Kivity
He, Qing wrote:
 This patch sets up multiple TSS for real mode emulation on Intel vmx,
 one for each vcpu. This is a preparation patch for full SMP real mode
 support.

   

Why are separate tss's needed?  Can't all vcpus use the same tss?

 Signed-off-by: Qing He [EMAIL PROTECTED]


 kvm.h  |1 +
 kvm_main.c |1 +
 vmx.c  |   31 +--
 3 files changed, 19 insertions(+), 14 deletions(-)


 diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
 index 65ab268..0f7a4d9 100644
 --- a/drivers/kvm/kvm.h
 +++ b/drivers/kvm/kvm.h
 @@ -328,6 +328,7 @@ void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
  
  struct kvm_vcpu {
   struct kvm *kvm;
 + int vcpu_id;
   

Switching to -vcpu_id instead of computing (vcpu - vcpu-kvm-vcpus) is
a good idea (and necessary when separately allocating vcpus).  But in
its own patch, please.

 - vmcs_write16(GUEST_CS_SELECTOR, 0xf000);
 - vmcs_writel(GUEST_CS_BASE, 0x000f);
 - vmcs_write32(GUEST_CS_LIMIT, 0x);
 - vmcs_write32(GUEST_CS_AR_BYTES, 0x9b);
 + if (vcpu-vcpu_id == 0) {
 + vmcs_write16(GUEST_CS_SELECTOR, 0xf000);
 + vmcs_writel(GUEST_CS_BASE, 0x000f);
 + vmcs_write32(GUEST_CS_LIMIT, 0x);
 + vmcs_write32(GUEST_CS_AR_BYTES, 0x9b);
 + vmcs_writel(GUEST_RIP, 0xfff0);
 + }
  
   

Since you're not initializing these registers for vcpu_id != 0, we might
as well not touch this code.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to 
panic.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] Network definitions in a guest (FC6) under kvm

2007-07-12 Thread David Shwatrz

Hello,

I have kvm on FC7. I had installed an FC6 guest on it according to the
kvm howto. I can launch the FC6 guest (using kvm) perfectly ok.
During installation, I set the IP address of the guest to be
192.168.0.11/24 and defualt gw to 192.168.0.1.
These definitions are OK (I simply run ifconfig -a from the
guest , FC7, and see that these definitions are maintained, and the nic is
UP
and running).

On the other hand, I cannot ping it from the host (192.168.0.10) ,
and also vice versa: I cannot ping the host from the guest,
namely, I cannot ping 192.168.0.10 from 192.168.0.11.

Any ideas ? is something missing here ?

Regards,
David
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] SMP: Setup multiple tss for real mode emulation

2007-07-12 Thread He, Qing


-Original Message-
From: Avi Kivity [mailto:[EMAIL PROTECTED]
Sent: 2007年7月12日 16:16
To: He, Qing
Cc: kvm-devel
Subject: Re: [kvm-devel] [PATCH] SMP: Setup multiple tss for real mode 
emulation

He, Qing wrote:
 This patch sets up multiple TSS for real mode emulation on Intel vmx,
 one for each vcpu. This is a preparation patch for full SMP real mode
 support.



Why are separate tss's needed?  Can't all vcpus use the same tss?

Yeah, I think it can. At first, I was thinking that using multiple tss is more 
natural, because the real mode of different vcpu are regarded as different 
tasks (in the guest). But now, it appears OK to me since the tss should be read 
only. There's no vm86 task switch inside the guest; and task switch in the 
kernel doesn't really affect the tss. Although I personally prefer the multiple 
tss, current code is OK to me.


 Signed-off-by: Qing He [EMAIL PROTECTED]


 kvm.h  |1 +
 kvm_main.c |1 +
 vmx.c  |   31 +--
 3 files changed, 19 insertions(+), 14 deletions(-)


 diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
 index 65ab268..0f7a4d9 100644
 --- a/drivers/kvm/kvm.h
 +++ b/drivers/kvm/kvm.h
 @@ -328,6 +328,7 @@ void kvm_io_bus_register_dev(struct kvm_io_bus *bus,

  struct kvm_vcpu {
  struct kvm *kvm;
 +int vcpu_id;


Switching to -vcpu_id instead of computing (vcpu - vcpu-kvm-vcpus) is
a good idea (and necessary when separately allocating vcpus).  But in
its own patch, please.

OK, that's fine. I'll post a separate patch.


 -vmcs_write16(GUEST_CS_SELECTOR, 0xf000);
 -vmcs_writel(GUEST_CS_BASE, 0x000f);
 -vmcs_write32(GUEST_CS_LIMIT, 0x);
 -vmcs_write32(GUEST_CS_AR_BYTES, 0x9b);
 +if (vcpu-vcpu_id == 0) {
 +vmcs_write16(GUEST_CS_SELECTOR, 0xf000);
 +vmcs_writel(GUEST_CS_BASE, 0x000f);
 +vmcs_write32(GUEST_CS_LIMIT, 0x);
 +vmcs_write32(GUEST_CS_AR_BYTES, 0x9b);
 +vmcs_writel(GUEST_RIP, 0xfff0);
 +}



Since you're not initializing these registers for vcpu_id != 0, we might
as well not touch this code.

Agree. I also think leaving it untouched right now is better, so I'll defer 
this to SIPI patches.

Thanks,
Qing


--
Do not meddle in the internals of kernels, for they are subtle and quick to 
panic.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH][RESEND] SMP: add vcpu_id field in struct vcpu

2007-07-12 Thread He, Qing
This patch adds a `vcpu_id' field in `struct vcpu', so we can
differentiate BSP and APs without pointer comparison or arithmetic. 

Signed-off-by: Qing He [EMAIL PROTECTED]


diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 65ab268..0f7a4d9 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -328,6 +328,7 @@ void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
 
 struct kvm_vcpu {
struct kvm *kvm;
+   int vcpu_id;
union {
struct vmcs *vmcs;
struct vcpu_svm *svm;
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index a4429eb..4d2ef9b 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2387,6 +2387,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm
*kvm, int n)
goto out;
 
vcpu = kvm-vcpus[n];
+   vcpu-vcpu_id = n;
 
mutex_lock(vcpu-mutex);
 
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index bc818cc..52a11cc 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -591,7 +591,7 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
fx_init(vcpu);
vcpu-fpu_active = 1;
vcpu-apic_base = 0xfee0 | MSR_IA32_APICBASE_ENABLE;
-   if (vcpu == vcpu-kvm-vcpus[0])
+   if (vcpu-vcpu_id == 0)
vcpu-apic_base |= MSR_IA32_APICBASE_BSP;
 
return 0;
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 80628f6..7fa62c7 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1253,7 +1253,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
vcpu-regs[VCPU_REGS_RDX] = get_rdx_init_val();
vcpu-cr8 = 0;
vcpu-apic_base = 0xfee0 | MSR_IA32_APICBASE_ENABLE;
-   if (vcpu == vcpu-kvm-vcpus[0])
+   if (vcpu-vcpu_id == 0)
vcpu-apic_base |= MSR_IA32_APICBASE_BSP;
 
fx_init(vcpu);


kvm-smp-vcpu-id.patch
Description: kvm-smp-vcpu-id.patch
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Gregory Haskins
On Thu, 2007-07-12 at 13:33 +0800, Dong, Eddie wrote:
 Here is the update with adding HLT cap.

Thats a good start, but you probably need to make the decision to use
the halt predicated on a halt-specific boolean set by userspace in order
to actually function as we've discussed.  This is in contrast to
overloading the decision with the presence of the in-kernel PIC.  A
capability indicator without a way to turn it on/off is fairly useless,
IMHO.

Conversely I don't think its a big deal to just skip the predicate all
together since your version of the patches wont cause as severe of an
issue as we had in hybrid mode.  So I would say either make the full
conversion or drop the CAP altogether.

-Greg


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH][RESEND] SMP: add vcpu_id field in struct vcpu

2007-07-12 Thread Avi Kivity
He, Qing wrote:
 This patch adds a `vcpu_id' field in `struct vcpu', so we can
 differentiate BSP and APs without pointer comparison or arithmetic. 

   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Avi Kivity
Dong, Eddie wrote:
 Here is the update with adding HLT cap.


 diff --git a/drivers/kvm/i8259.c b/drivers/kvm/i8259.c
 index f4ae5f7..e84e665 100644
 --- a/drivers/kvm/i8259.c
 +++ b/drivers/kvm/i8259.c
 @@ -411,8 +411,13 @@ static void picdev_read(struct kvm_io_device *this,
  static void pic_irq_request(void *opaque, int level)
  {
   struct kvm *kvm = opaque;
 + struct kvm_vcpu *vcpu = kvm-vcpus[0];
  
   pic_irqchip(kvm)-output = level;
 + if (waitqueue_active(vcpu-wq)) {
 + wake_up_interruptible(vcpu-wq);
 + ++vcpu-stat.halt_wakeup;
 + }
  }
   

Please strip out non-hlt related things like this so I can apply on 
current kvm.git.



-- 
error compiling committee.c: too many arguments to function


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Avi Kivity
Gregory Haskins wrote:
 On Thu, 2007-07-12 at 13:33 +0800, Dong, Eddie wrote:
   
 Here is the update with adding HLT cap.
 

 Thats a good start, but you probably need to make the decision to use
 the halt predicated on a halt-specific boolean set by userspace in order
 to actually function as we've discussed.  This is in contrast to
 overloading the decision with the presence of the in-kernel PIC.  A
 capability indicator without a way to turn it on/off is fairly useless,
 IMHO.

 Conversely I don't think its a big deal to just skip the predicate all
 together since your version of the patches wont cause as severe of an
 issue as we had in hybrid mode.  So I would say either make the full
 conversion or drop the CAP altogether.

   

I'd like to keep it as a precaution.  If we later find out it's 
unneeded, we can rip it out (keeping the cap but always doing hlt in 
kernel, regardless of what the user wants).

-- 
error compiling committee.c: too many arguments to function


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [ANNOUNCE] kvm-29 release

2007-07-12 Thread Avi Kivity
Well, I really wanted to have guest smp in the release, but alas, it was 
not to be.  It still doesn't like starting X, for example.

Note: on i386 the qemu binary is now named qemu-system-x86_64.  This is 
to allow migration from 32-bit hosts to 64-bit hosts, and to allow 
32-bit userspace on a 64-bit host to launch a 64-bit guest.

Changes from kvm-28:
- live migration from 32-bit hosts to 64-bit hosts (Uri Lublin)
- monotonic timestamp counter on Intel
- more real mode support (Nitin A Kamble)
- infrastructure for in-kernel PIC and APIC (Gregory Haskins, Eddie Dong)
- fix read-modify-write to mmio (fixes F7 installer) (Luca Tettamanti)
- fix rebooting a long-running guest
- reliably detect if svm was disabled by bios (Joerg Roedel)
- suspend/resumes fixes (will not work with older kernels)
- fix nx confusion with large pages and real mode
- remove dependency on libuuid
- fix registers access in monitor/gdbstub (Anthony Liguori)
- minor fixes and cleanups (various)

Notes:
If you use the modules from kvm-29, you can use any version of Linux
from 2.6.9 upwards.
If you use the modules from Linux 2.6.20, you need to use kvm-12.
If you use the modules from Linux 2.6.21, you need to use kvm-17.
Modules from Linux 2.6.22 and up will work with any kvm version from 
kvm-22.  Some features may only be available in newer releases.

http://kvm.qumranet.com



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Network definitions in a guest (FC6) under kvm

2007-07-12 Thread Luca
On 7/12/07, David Shwatrz [EMAIL PROTECTED] wrote:
 I have kvm on FC7. I had installed an FC6 guest on it according to the
 kvm howto. I can launch the FC6 guest (using kvm) perfectly ok.
 During installation, I set the IP address of the guest to be
  192.168.0.11/24 and defualt gw to 192.168.0.1.
 These definitions are OK (I simply run ifconfig -a from the
 guest , FC7, and see that these definitions are maintained, and the nic is
 UP
 and running).

 On the other hand, I cannot ping it from the host (192.168.0.10) ,
 and also vice versa: I cannot ping the host from the guest,
 namely, I cannot ping 192.168.0.10 from 192.168.0.11.

 Any ideas ? is something missing here ?

You should tell us more about your setup. It seems that you you are
not using a bridged configuration; if eth0 has address 192.168.0.10
then packets for 192.168.0.0/24 are routed through eth0 (an the
virtual interface sit0 doesn't see them).
You can either:
- use a different subnet for the VMs, configure the kernel to forward
packets between the 2 networks
- create a bridge that spans across eth0 and sit0, so that it becomes
an unique net segment

I have a script for the 2nd solution, I can send as soon as I get home
if you're interested.

Luca

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-29 not compiling

2007-07-12 Thread Avi Kivity
Adrian Lambeck wrote:
 I just tried out the latest release but it won't compile. The compiler 
 complains first:

 WARNING: sigprocmask [/root/kvm/kvm-29/kernel/kvm.ko] undefined!

   

What kernel are  you compiling against?


-- 
error compiling committee.c: too many arguments to function


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Network definitions in a guest (FC6) under kvm

2007-07-12 Thread David Shwatrz

Thanks;
I am not sure I got you !
running ifconfig -a   on the host shows the following:

eth0  Link encap:Ethernet  HWaddr 00:1B:24:1D:EC:C0
 inet addr:192.168.0.31  Bcast:192.168.0.255  Mask:255.255.255.0
 inet6 addr: fe80::21b:24ff:fe1d:ecc0/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:10164222 errors:0 dropped:0 overruns:0 frame:0
 TX packets:95594 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:3427235680 (3.1 GiB)  TX bytes:27635785 (26.3 MiB)
 Interrupt:19


loLink encap:Local Loopback
 inet addr:127.0.0.1  Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING  MTU:16436  Metric:1
 RX packets:5821 errors:0 dropped:0 overruns:0 frame:0
 TX packets:5821 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:804856 (785.9 KiB)  TX bytes:804856 (785.9 KiB)

virbr0Link encap:Ethernet  HWaddr 00:00:00:00:00:00
 inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
 inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:0 (0.0 b)  TX bytes:21586 (21.0 KiB)

As you can see, there is not sit interface here. There is a virbr0
(bridge) but on 192.168.122.1

Please advice; also if you can please send the script, maybe I can get some
ideas from it regarding what to do.

Regards,
DS


On 7/12/07, Luca [EMAIL PROTECTED] wrote:


On 7/12/07, David Shwatrz [EMAIL PROTECTED] wrote:
 I have kvm on FC7. I had installed an FC6 guest on it according to the
 kvm howto. I can launch the FC6 guest (using kvm) perfectly ok.
 During installation, I set the IP address of the guest to be
  192.168.0.11/24 and defualt gw to 192.168.0.1.
 These definitions are OK (I simply run ifconfig -a from the
 guest , FC7, and see that these definitions are maintained, and the nic
is
 UP
 and running).

 On the other hand, I cannot ping it from the host (192.168.0.10) ,
 and also vice versa: I cannot ping the host from the guest,
 namely, I cannot ping 192.168.0.10 from 192.168.0.11.

 Any ideas ? is something missing here ?

You should tell us more about your setup. It seems that you you are
not using a bridged configuration; if eth0 has address 192.168.0.10
then packets for 192.168.0.0/24 are routed through eth0 (an the
virtual interface sit0 doesn't see them).
You can either:
- use a different subnet for the VMs, configure the kernel to forward
packets between the 2 networks
- create a bridge that spans across eth0 and sit0, so that it becomes
an unique net segment

I have a script for the 2nd solution, I can send as soon as I get home
if you're interested.

Luca

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Framebuffer error

2007-07-12 Thread Víctor Abeytua García
Thanks a lot,
I was looking at the wrong place. I was trying to launch the
installation as root after sudoing. And as root I didn't have the DISPLAY
variable. Now the installation is proceeding smoothly.

Best regards,
Víctor

Thu, Jul 12, 2007 at 03:03:05PM +0300, Avi Kivity escribió:

Víctor Abeytua García wrote:
Hello,
  I know this is not probably the place, but as I haven't found a
kvm-users list and probably some of you have encountered the same problem 
I feel
it's the best place to post my problem.  I have a macbook pro running 
Feisty
with a Radeon Mobility X1600 and VMX cpu support and I was quite 
interested in
trying kvm. I followed the steps of any of the online manuals, but I 
didn't get
far. As soon as I tried to install Windows XP:

  kvm -no-acpi -m 384 -cdrom /dev/cdrom -boot d windows.img

  I obtained  the following output:
  
   -- DirectFB v0.9.25 -
 (c) 2000-2002  convergence integrated media GmbH  
 (c) 2002-2004  convergence GmbH   
---

(*) DirectFB/Core: Single Application Core. (2006-12-20 21:25) 
(*) Direct/Memcpy: Using MMX optimized memcpy()
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
-- No such file or directory
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment 
variable.
(!) DirectFB/Core: Could not initialize 'system' core!
-- Initialization error!
Could not initialize SDL - exiting
  
  I checked and couldn't find any framebuffer device in my computer. 
  After
googling a lot, creating those devices manually, trying to boot with both 
the
propietary and open source driver, loading the radeonfb module I haven't 
been
able to avoid this problem. Could someone in the list enlighten me?
  

This is strange.  You're running in X, right?  Is $DISPLAY set 
correctly?  Maybe some other environment variable is telling SDL to use 
a framebuffer instead of X.


-- 
error compiling committee.c: too many arguments to function


-- 

Víctor Abeytua García


---
Socio Consultor
Nosys AJjV S.L.
Networked Open SYStems
Tecnologías de la Información · Seguridad

C/ Isla Graciosa 2, Loft 18
28700 San Sebastián de los Reyes
Madrid (Spain)

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Network definitions in a guest (FC6) under kvm

2007-07-12 Thread David Shwatrz

Hello,
And I just want to add some info :

running :
brctl show

gives:
bridge name bridge id   STP enabled interfaces
virbr0  8000.   no

which means that there is no interface enslaved to this bridge.

Regards,
DS




On 7/12/07, David Shwatrz [EMAIL PROTECTED] wrote:


Thanks;
I am not sure I got you !
running ifconfig -a   on the host shows the following:

eth0  Link encap:Ethernet  HWaddr 00:1B:24:1D:EC:C0
  inet addr: 192.168.0.31  Bcast:192.168.0.255  Mask:255.255.255.0
  inet6 addr: fe80::21b:24ff:fe1d:ecc0/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:10164222 errors:0 dropped:0 overruns:0 frame:0
  TX packets:95594 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:3427235680 (3.1 GiB)  TX bytes:27635785 (26.3 MiB)
  Interrupt:19


loLink encap:Local Loopback
  inet addr:127.0.0.1  Mask:255.0.0.0
  inet6 addr: ::1/128 Scope:Host
  UP LOOPBACK RUNNING  MTU:16436  Metric:1
  RX packets:5821 errors:0 dropped:0 overruns:0 frame:0
  TX packets:5821 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:804856 (785.9 KiB)  TX bytes:804856 (785.9 KiB)

virbr0Link encap:Ethernet  HWaddr 00:00:00:00:00:00
  inet addr: 192.168.122.1  Bcast:192.168.122.255  Mask:
255.255.255.0
  inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:0 (0.0 b)  TX bytes:21586 ( 21.0 KiB)

As you can see, there is not sit interface here. There is a virbr0
(bridge) but on 192.168.122.1

Please advice; also if you can please send the script, maybe I can get
some ideas from it regarding what to do.

Regards,
DS


On 7/12/07, Luca [EMAIL PROTECTED] wrote:

 On 7/12/07, David Shwatrz [EMAIL PROTECTED] wrote:
  I have kvm on FC7. I had installed an FC6 guest on it according to the
  kvm howto. I can launch the FC6 guest (using kvm) perfectly ok.
  During installation, I set the IP address of the guest to be
   192.168.0.11/24 and defualt gw to 192.168.0.1.
  These definitions are OK (I simply run ifconfig -a from the
  guest , FC7, and see that these definitions are maintained, and the
 nic is
  UP
  and running).
 
  On the other hand, I cannot ping it from the host (192.168.0.10 ) ,
  and also vice versa: I cannot ping the host from the guest,
  namely, I cannot ping 192.168.0.10 from 192.168.0.11.
 
  Any ideas ? is something missing here ?

 You should tell us more about your setup. It seems that you you are
 not using a bridged configuration; if eth0 has address 192.168.0.10
 then packets for 192.168.0.0/24 are routed through eth0 (an the
 virtual interface sit0 doesn't see them).
 You can either:
 - use a different subnet for the VMs, configure the kernel to forward
 packets between the 2 networks
 - create a bridge that spans across eth0 and sit0, so that it becomes
 an unique net segment

 I have a script for the 2nd solution, I can send as soon as I get home
 if you're interested.

 Luca



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Framebuffer error

2007-07-12 Thread Benjamin Budts

I had the same problem, I missed couple of SDL packages...

here is my package list under debian :

 ii  libsdl1.2-dev 
1.2.11-8Simple DirectMedia Layer development 
files
ii  libsdl1.2debian   
1.2.11-8Simple DirectMedia Layer
ii  libsdl1.2debian-alsa  
1.2.11-8Simple DirectMedia Layer (with X11 
and ALSA

also check the following file :
/sys/class/misc/kvm/dev

I had to create a file manually using mknod...

mknod /dev/kvm c  (low and high number of the file above

hope this helps you out

Víctor Abeytua García wrote:
 Hello,
   I know this is not probably the place, but as I haven't found a
 kvm-users list and probably some of you have encountered the same problem I 
 feel
 it's the best place to post my problem.  I have a macbook pro running Feisty
 with a Radeon Mobility X1600 and VMX cpu support and I was quite interested in
 trying kvm. I followed the steps of any of the online manuals, but I didn't 
 get
 far. As soon as I tried to install Windows XP:

   kvm -no-acpi -m 384 -cdrom /dev/cdrom -boot d windows.img

   I obtained  the following output:
   
-- DirectFB v0.9.25 -
  (c) 2000-2002  convergence integrated media GmbH  
  (c) 2002-2004  convergence GmbH   
 ---

 (*) DirectFB/Core: Single Application Core. (2006-12-20 21:25) 
 (*) Direct/Memcpy: Using MMX optimized memcpy()
 (!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
 -- No such file or directory
 (!) DirectFB/FBDev: Error opening framebuffer device!
 (!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment 
 variable.
 (!) DirectFB/Core: Could not initialize 'system' core!
 -- Initialization error!
 Could not initialize SDL - exiting
   
   I checked and couldn't find any framebuffer device in my computer. After
 googling a lot, creating those devices manually, trying to boot with both the
 propietary and open source driver, loading the radeonfb module I haven't been
 able to avoid this problem. Could someone in the list enlighten me?

   Best regards,
   Víctor

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 kvm-devel mailing list
 kvm-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/kvm-devel


   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Dong, Eddie
Avi Kivity wrote:
 Dong, Eddie wrote:
 Here is the update with adding HLT cap.
 
 
 diff --git a/drivers/kvm/i8259.c b/drivers/kvm/i8259.c index
 f4ae5f7..e84e665 100644 --- a/drivers/kvm/i8259.c
 +++ b/drivers/kvm/i8259.c
 @@ -411,8 +411,13 @@ static void picdev_read(struct kvm_io_device
  *this, static void pic_irq_request(void *opaque, int level)  {
  struct kvm *kvm = opaque;
 +struct kvm_vcpu *vcpu = kvm-vcpus[0];
 
  pic_irqchip(kvm)-output = level;
 +if (waitqueue_active(vcpu-wq)) {
 +wake_up_interruptible(vcpu-wq);
 +++vcpu-stat.halt_wakeup;
 +}
  }
 
 
 Please strip out non-hlt related things like this so I can apply on
 current kvm.git. 
 
Apply to current kvm.git? Then we need to define false for
irqchip_in_kernel() which makes the patch quit stranger. 
In theory this is only valid for a case with irqchip in kernel since we
always fall back to user if irqchip is in user.

Eddie

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Gregory Haskins
On Thu, 2007-07-12 at 22:20 +0800, Dong, Eddie wrote:


 Apply to current kvm.git? Then we need to define false for
 irqchip_in_kernel() which makes the patch quit stranger.

I think what Avi is saying is this can be generalized as a separate
feature independent of in-kernel-PIC.  Since Avi and I are both
advocating a separate capability for in-kernel-HLT, you wouldn't need to
have a stubbed irqchip_in_kernel.  Rather, you should have a flag that
indicates whether userspace enabled the HLT capability or not.

  
 In theory this is only valid for a case with irqchip in kernel since we
 always fall back to user if irqchip is in user.

How so?  In theory, we can halt in the kernel independent of modeling
interrupts in the kernel.  The difference is in the wakeup logic.  For
the patch that goes in pre-PIC, the wakeup is predicated solely on
signal delivery.  Later, the PIC series can modify the wakeup to include
the in-kernel sources as well.

-Greg



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Avi Kivity
Dong, Eddie wrote:
 Gregory Haskins wrote:
   
 On Thu, 2007-07-12 at 22:20 +0800, Dong, Eddie wrote:


 
 Apply to current kvm.git? Then we need to define false for
 irqchip_in_kernel() which makes the patch quit stranger.
   
 I think what Avi is saying is this can be generalized as a separate
 feature independent of in-kernel-PIC.  Since Avi and I are both
 advocating a separate capability for in-kernel-HLT, you
 wouldn't need to
 have a stubbed irqchip_in_kernel.  Rather, you should have a flag that
 indicates whether userspace enabled the HLT capability or not.
 

 Then Avi need to check in your patch in user level to remove the race
 condition, otherwise 
 the patch does nothing and just some dead code.

 Avi: 
   Can u have a double check to see what you want to do. I am fine
 with either of them.
   

Like Gregory said: we check in the hlt patch to the kernel, and the race 
removal + use the new feature patch for userspace.

Gregory, can you repost that patch please?  Eddie, please test both with 
and without the userspace patch.



-- 
error compiling committee.c: too many arguments to function


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH] KVM-USER: Fix for CPU interrupts in QEMU

2007-07-12 Thread Gregory Haskins
QEMU-KVM has a bug where the interruptibility of the CPU is predicated on
pending interrupts.  If the reason that a CPU is interrupted is because we
need to inject interrupts, the current code will just keep looping and miss
the event window.

This doesnt seem to cause problems with in-trunk KVM.  However, once we turn
on in-kernel HALTING, QEMU starts to have some serious problems that were
attributed to this bug.

Signed-off-by: Gregory Haskins [EMAIL PROTECTED]
---

 qemu/qemu-kvm.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 1849997..5b5c739 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -452,11 +452,8 @@ void kvm_save_registers(CPUState *env)
 int kvm_cpu_exec(CPUState *env)
 {
 int r;
-int pending = (!env-ready_for_interrupt_injection ||
-   ((env-interrupt_request  CPU_INTERRUPT_HARD) 
-  (env-eflags  IF_MASK)));
 
-if (!pending  (env-interrupt_request  CPU_INTERRUPT_EXIT)) {
+if (env-interrupt_request  CPU_INTERRUPT_EXIT) {
 env-interrupt_request = ~CPU_INTERRUPT_EXIT;
 env-exception_index = EXCP_INTERRUPT;
 cpu_loop_exit();


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Dong, Eddie
Gregory Haskins wrote:
 On Thu, 2007-07-12 at 22:20 +0800, Dong, Eddie wrote:
 
 
 Apply to current kvm.git? Then we need to define false for
 irqchip_in_kernel() which makes the patch quit stranger.
 
 I think what Avi is saying is this can be generalized as a separate
 feature independent of in-kernel-PIC.  Since Avi and I are both
 advocating a separate capability for in-kernel-HLT, you
 wouldn't need to
 have a stubbed irqchip_in_kernel.  Rather, you should have a flag that
 indicates whether userspace enabled the HLT capability or not.

Then Avi need to check in your patch in user level to remove the race
condition, otherwise 
the patch does nothing and just some dead code.

Avi: 
Can u have a double check to see what you want to do. I am fine
with either of them.
Eddie

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] rebase hlt emulation

2007-07-12 Thread Dong, Eddie
Avi Kivity wrote:
 Dong, Eddie wrote:
 Gregory Haskins wrote:
 
 On Thu, 2007-07-12 at 22:20 +0800, Dong, Eddie wrote:
 
 
 
 Apply to current kvm.git? Then we need to define false for
 irqchip_in_kernel() which makes the patch quit stranger.
 
 I think what Avi is saying is this can be generalized as a separate
 feature independent of in-kernel-PIC.  Since Avi and I are both
 advocating a separate capability for in-kernel-HLT, you
 wouldn't need to
 have a stubbed irqchip_in_kernel.  Rather, you should have a flag
 that indicates whether userspace enabled the HLT capability or not.
 
 
 Then Avi need to check in your patch in user level to remove the
 race condition, otherwise the patch does nothing and just some dead
 code. 
 
 Avi:
  Can u have a double check to see what you want to do. I am fine
 with either of them. 
 
 
 Like Gregory said: we check in the hlt patch to the kernel, and the
 race removal + use the new feature patch for userspace.
 
 Gregory, can you repost that patch please?  Eddie, please test both
 with and without the userspace patch.
 
this is race condition which happens only in certain situation. I am
afraid I can reproduce this. 
Greg said he had done test, right?

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] KVM-USER: Fix for CPU interrupts in QEMU

2007-07-12 Thread Dong, Eddie
Gregory Haskins wrote:
 On Thu, 2007-07-12 at 23:39 +0800, Dong, Eddie wrote:
 Greg:
  I think you need to do the whole patch for this including kernel
 side. Will u ?
 
 Ya, I can do that.  But I probably wont be able to look at it until
 this RT stuff I am working on is done.
 
Then, Avi:
Will u check that into lapic2 now, or wait for Greg back to do
more regresstion test and then check in more aggressive approach to
kvm.git? i.e. kernel hlt emulation even for user level irq.
thx,eddie

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-27 vs 28 I/O speed

2007-07-12 Thread Dave Hansen
On Thu, 2007-07-12 at 08:37 +0300, Avi Kivity wrote:
 Can you confirm it by backing out that one patch?

Do you know the git commit id by chance?

-- Dave


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Network definitions in a guest (FC6) under kvm

2007-07-12 Thread Luca Tettamanti
(don't top post)

Il Thu, Jul 12, 2007 at 03:56:07PM +0300, David Shwatrz ha scritto: 
 Hello,
 And I just want to add some info :
 
 running :
 brctl show
 
 gives:
 bridge name bridge id   STP enabled interfaces
 virbr0  8000.   no
 
 which means that there is no interface enslaved to this bridge.

Hum, this depends on what the script (/etc/kvm/kvm-ifup, or
/etc/qemu-ifup) is doing...


 On 7/12/07, David Shwatrz [EMAIL PROTECTED] wrote:
 
 Thanks;
 I am not sure I got you !
 running ifconfig -a   on the host shows the following:
 
 eth0  Link encap:Ethernet  HWaddr 00:1B:24:1D:EC:C0
   inet addr: 192.168.0.31  Bcast:192.168.0.255  Mask:255.255.255.0
   inet6 addr: fe80::21b:24ff:fe1d:ecc0/64 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:10164222 errors:0 dropped:0 overruns:0 frame:0
   TX packets:95594 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:1000
   RX bytes:3427235680 (3.1 GiB)  TX bytes:27635785 (26.3 MiB)
   Interrupt:19
 
 
 loLink encap:Local Loopback
   inet addr:127.0.0.1  Mask:255.0.0.0
   inet6 addr: ::1/128 Scope:Host
   UP LOOPBACK RUNNING  MTU:16436  Metric:1
   RX packets:5821 errors:0 dropped:0 overruns:0 frame:0
   TX packets:5821 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:0
   RX bytes:804856 (785.9 KiB)  TX bytes:804856 (785.9 KiB)
 
 virbr0Link encap:Ethernet  HWaddr 00:00:00:00:00:00
   inet addr: 192.168.122.1  Bcast:192.168.122.255  Mask:
 255.255.255.0
   inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:0
   RX bytes:0 (0.0 b)  TX bytes:21586 ( 21.0 KiB)

This configuration is a bit different from the one described in
the first mail though.

 As you can see, there is not sit interface here. There is a virbr0
 (bridge) but on 192.168.122.1

sit0 is the TUN device used by default, i.e. unless you're passing
-no-tap to the kvm script. If you're calling the qemu binary without
using the 'kvm' python wrapper then you should use something like this:

/path/to/kvm/qemu-whatever -hda disk-image.qcow -cdrom cd.iso -net tap
-net nic (plus optional stuff)

So: how are you creating the virtual machine? What is the content of the
network startup file?

Your kernel must also support the TUN device (CONFIG_TUN).

 Please advice; also if you can please send the script, maybe I can get
 some ideas from it regarding what to do.

$ cat /etc/kvm/kvm-ifup

#!/bin/sh

BRIDGE_DEV=br0
BRIDGE_ADDR=172.20.0.1/16
BRIDGE_BCAST=172.20.255.255
BRIDGE_ADDR6=fec0:2::1/64
#MAINIF=eth1

#set -x

ip link show dev $BRIDGE_DEV  /dev/null 21
if [ $? -ne 0 ]; then
# Set up the bridge
brctl addbr $BRIDGE_DEV

if [ -n $MAINIF ]; then
ip link set $MAINIF up
brctl addif $BRIDGE_DEV $MAINIF
fi
ip addr add $BRIDGE_ADDR broadcast $BRIDGE_BCAST dev $BRIDGE_DEV

if [ -n $BRIDGE_ADDR6 ]; then
ip addr add $BRIDGE_ADDR6 dev $BRIDGE_DEV

if [ -e /etc/init.d/radvd ]; then
/etc/init.d/radvd reload
fi
fi

ip link set $BRIDGE_DEV up
fi

# Add new interface
ip link set $1 up
brctl addif $BRIDGE_DEV $1

The configuration is done with the vars at the beginning. What the
script does is:

- Check whether the bridge $BRIDGE_DEV is alread there, if not:
  - Create the bridge
  - Enslave $MAINIF, if required. This can be used to e.g. create a
bridged ethernet with one of your NICs. Leave MAINIF empty if you
want to use a separate subnet for the VMs.
  - Configure IPv6, is requested
- Enslave the new interface ($1)

Note that if the bridge with the VMs is on a separate network (in your
case the LAN on eth0 is 192.168.0.0/24, while the virtual LAN is
192.168.122.0/24) you must enable the forwarding between the 2
interfaces:

# echo 1  /proc/sys/net/ipv4/ip_forward

This allows the guest to talk with the host. To communicate with an
external host (be it another machine on the LAN or a server on the
Internet) you'll have to set up a NAT (or - simpler - MASQUERADE) with
iptables.

This setup allows you to make a clear separation between the VMs and the
rest of the net. Of course you can also create a bridge with eth0 and
the interface of the VM (e.g. set MAINIF=eth0 in my script) and it
will just work.

Option 3 is: forget about the bridge and do the routing at IP level.

HTH,
Luca
-- 
Dicono che  il cane sia  il miglior  amico dell'uomo. Secondo me  non e`
vero. Quanti dei vostri amici avete fatto castrare, recentemente?


[kvm-devel] questions about ack_intr_on_exit and preemption hooks

2007-07-12 Thread Stephane Eranian
Avi,

A couple of months back, we had a discussion about PMU virtualization
and the difficulty I encountered trying to catch the PMU interrupt
vector in kvm on VM-exit. KVM does not set ack_intr_on_intr. Would
you mind reminding me of the reason for this?

On the topic of scheduler hooks for use by KVM, I think this
would help me also because it means I would not have to save
and restore the PMU registers on all VM-exit/VM-entry. At least
that is what I understood based on the discussion. Those registers
only need to be saved/restore when the KVM process is context switched.

Thanks.

-- 
-Stephane

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] kvm-29 not compiling

2007-07-12 Thread Adrian Lambeck
The same error happens on linux-2.6.21.4:
I am using the same config as on 2.6.20 which worked well with kvm-28...


#
Output when compiling:

WARNING: sigprocmask [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: kmem_cache_destroy [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: sysdev_unregister [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: mem_map [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: vmalloc [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: kill_anon_super [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: current_kernel_time [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: malloc_sizes [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: get_sb_pseudo [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: sysdev_class_register [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: mutex_unlock [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: vfree [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: igrab [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: mutex_trylock [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: cond_resched [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: __alloc_pages [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: misc_register [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: get_unused_fd [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: __mutex_init [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: printk [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: __PAGE_KERNEL [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: memcmp [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: vmap [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: copy_to_user [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: mutex_lock [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: sysdev_class_unregister [/root/kvm/kvm-29/kernel/kvm.ko] 
undefined!
WARNING: fput [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: contig_page_data [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: unregister_reboot_notifier [/root/kvm/kvm-29/kernel/kvm.ko] 
undefined!
WARNING: kern_mount [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: sysdev_register [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: __free_pages [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: mntput_no_expire [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: register_reboot_notifier [/root/kvm/kvm-29/kernel/kvm.ko] 
undefined!
WARNING: d_alloc [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: put_unused_fd [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: kmem_cache_create [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: register_filesystem [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: free_pages [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: kmem_cache_zalloc [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: iput [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: kfree [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: vunmap [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: memcpy [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: fd_install [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: unregister_filesystem [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: new_inode [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: get_empty_filp [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: copy_from_user [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: simple_attr_open [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: misc_deregister [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: d_instantiate [/root/kvm/kvm-29/kernel/kvm.ko] undefined!
WARNING: kvm_resched [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: kvm_mmu_load [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: mem_map [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: save_msrs [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: kvm_set_msr_common [/root/kvm/kvm-29/kernel/kvm-intel.ko] 
undefined!
WARNING: malloc_sizes [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: kvm_emulate_cpuid [/root/kvm/kvm-29/kernel/kvm-intel.ko] 
undefined!
WARNING: kvm_read_guest [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: kvm_setup_pio [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: set_cr8 [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: set_cr0 [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: __alloc_pages [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: kvm_init_arch [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: printk [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: prof_on [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: kvm_hypercall [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: lmsw [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: set_cr4 [/root/kvm/kvm-29/kernel/kvm-intel.ko] undefined!
WARNING: contig_page_data [/root/kvm/kvm-29/kernel/kvm-intel.ko] 
undefined!
WARNING: 

Re: [kvm-devel] questions about ack_intr_on_exit and preemption hooks

2007-07-12 Thread Dong, Eddie
[EMAIL PROTECTED] wrote:
 Avi,
 
 A couple of months back, we had a discussion about PMU virtualization
 and the difficulty I encountered trying to catch the PMU interrupt
 vector in kvm on VM-exit. KVM does not set ack_intr_on_intr. Would
 you mind reminding me of the reason for this?
 
 On the topic of scheduler hooks for use by KVM, I think this
 would help me also because it means I would not have to save
 and restore the PMU registers on all VM-exit/VM-entry. At least

W/o the hook, the PMU save/restore can be done in heavy weight 
VM Exit path, the majority of VM Exit are light weight which doesn't
need to do if you don't care the cycles spent in KVM.
refer vmx_vcpu_put  vmx_vcpu_load.

With hook, then we can further reduce the save/restore effort :-)

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [kvm-commits] kvm: external module: rename original kernel's modules when installing

2007-07-12 Thread Nguyen Anh Quynh

On 7/12/07, Avi Kivity [EMAIL PROTECTED] wrote:

repository: /home/avi/kvm
branch: master
commit ebad9f20e60405fbf01beea7521c8a764391dece
Author: Avi Kivity [EMAIL PROTECTED]
Date:   Thu Jul 12 13:20:47 2007 +0300

kvm: external module: rename original kernel's modules when installing

this avoids an ambiguity when using the kvm external module in conjuction
with 2.6.20 or later, which may also have kvm built.


This patch raises a problem if
/lib/modules/version/kernel/drivers/kvm/ does not exist.

The enclosed patch fixes the bug.

Signed-off-by: Nguyen Anh Quynh [EMAIL PROTECTED]
diff --git a/kernel/Makefile b/kernel/Makefile
index 7eae95b..705d3fd 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -41,7 +41,7 @@ sync:
 install:
 	mkdir -p $(DESTDIR)/$(INSTALLDIR)
 	cp *.ko $(DESTDIR)/$(INSTALLDIR)
-	for i in $(ORIGMODDIR)/drivers/kvm/*.ko; do mv $$i $$i.orig; done
+	for i in $(ORIGMODDIR)/drivers/kvm/*.ko; do mv $$i $$i.orig; done || true
 	/sbin/depmod -a
 
 tmpspec = .tmp.kvm-kmod.spec
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] questions about ack_intr_on_exit and preemption hooks

2007-07-12 Thread Stephane Eranian
Eddie,

On Fri, Jul 13, 2007 at 08:46:06AM +0800, Dong, Eddie wrote:
 [EMAIL PROTECTED] wrote:
  Avi,
  
  A couple of months back, we had a discussion about PMU virtualization
  and the difficulty I encountered trying to catch the PMU interrupt
  vector in kvm on VM-exit. KVM does not set ack_intr_on_intr. Would
  you mind reminding me of the reason for this?
  
  On the topic of scheduler hooks for use by KVM, I think this
  would help me also because it means I would not have to save
  and restore the PMU registers on all VM-exit/VM-entry. At least
 
 W/o the hook, the PMU save/restore can be done in heavy weight 
 VM Exit path, the majority of VM Exit are light weight which doesn't
 need to do if you don't care the cycles spent in KVM.
 refer vmx_vcpu_put  vmx_vcpu_load.
 
I am not sure I understand your terminology about heavy vs. light. 

You do need to stop monitoring on every VM-exit, because you do not
want to continue measuring while in KVM. On VM-entry, then you need
to re-activate. So you can use explcit code to clear a bunch of 
MSR on VM-exit and restore them on VM-entry. Alternatively, you
can use (on VT-x, not on AMD-v) the VT-x feature to automatically
save and restore MSRs on VM-exit/VM-entry. All of this can be done
lazily, i.e., only once you start using the PMU.

On VM-exit, which leads to context switch of the KVM thread, then
you do need to do more work and save the PMU counters. That would
have to be done by software given that VT-x does not know about
Linux context switching. This is where the hooks come in handy.
Same thing on context switch in.

 With hook, then we can further reduce the save/restore effort :-)

-- 

-Stephane

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel