Skip to contentSkip to conversation

kvm-17 release

ANNOUNCE Avi Kivity 3 participants 14 messages Mar 20, 2007 – Mar 25, 2007 7 messages not in the archive KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

Highlights: acpi works again.

Changes from kvm-16:

- live migration enhancements (Uri Lublin)
- better/working acpi support
- revert to unhacked qemu bios
- fix some 32-bit nonpae guests (*BSD)
- initial ballooning support
- random fixes

Note that if you use the modules from Linux 2.6.20, you need to use kvm-12. You can use kvm-17 with Linux 2.6.20, provided you use the external module included in kvm-17. API/ABI stability is planned for Linux 2.6.22.

http://kvm.qumranet.com

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): 45FFE14F.6020808-atKUWr5tajBWk0Htik3J/[email protected]

#2 lore raw

Hi!

With respect to the Core Duo, this is the best release I've seen so far:

- FreeBSD 6.1: works.
- NetBSD 3.1: works.
- OpenSuse 10.2 (sans gfxmenu): works.
- Qemu-Puppy 2.01-3: works.
- Qemu-Puppy 2.13-1: works.
- Solaris 10.1: works.
- XP Pro: works.

Unfortunately, Knoppix (both 5.0 and 5.1.1) has stopped working now. I didn't try 5.2 yet.

(using Kernel 2.6.20)

Signature · 8 lines
Michael "Tired" Riepe <[email protected]>
X-Tired: Each morning I get up I die a little

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 4 lines · Michael Riepe

Hi!

With respect to the Core Duo, this is the best release I've seen so far:

Quoted 9 lines

- FreeBSD 6.1: works.
- NetBSD 3.1: works.
- OpenSuse 10.2 (sans gfxmenu): works.
- Qemu-Puppy 2.01-3: works.
- Qemu-Puppy 2.13-1: works.
- Solaris 10.1: works.
- XP Pro: works.

We strive for monotonously increasing quality ;-) thanks for the comprehensive testing.

Quoted 3 lines

Unfortunately, Knoppix (both 5.0 and 5.1.1) has stopped working now. I didn't try 5.2 yet.

5.1.1 failed for me, but booted fine with nmi_watchdog=0 as a guest kernel parameter. No version of kvm has supported the nmi watchdog, so I don't quite understand what's going on. Which version of kvm did you get 5.1.1 working with?

I added the architectural performance monitor counters to the todo.

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): 46039EEA.4070504-atKUWr5tajBWk0Htik3J/[email protected]

#6 lore raw
Quoted 2 lines · Avi Kivity
Quoted 1 line · Michael Riepe

With respect to the Core Duo, this is the best release I've seen so far:

Unfortunately, kvm-17 was less successful here. FC6 did not boot any longer after I upgraded from kvm-16 to kvm-17, so I was rather surprised when I read the above message.

This is the test system:
CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz, Chipset: Intel 975X

The exact problem was that FC6 stopped booting before under kvm-16 it would display the line
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)

I then reverted to kvm-16 and repeated all upgrade changes until the problem occurred. The culprit was found to be

kvm_main.c renamed from kvm_main-17.c +2 -0
@@ -1575,7 +1575,9 @@
  	if (kvm_run->mmio_completed) {
  		memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
  		vcpu->mmio_read_completed = 1;
+#ifdef THIS_PREVENTS_FC6_FROM_BOOTING
  		emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+#endif
  	}
 
  	vcpu->mmio_needed = 0;
Signature · 8 lines
Carsten Emde, OSADL, <[email protected]>, http://www.osadl.org/
News on kvm: http://www.osadl.org/Single-View.111+M595b203da7e.0.html

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Review

Quoted 7 lines · Carsten Emde

I then reverted to kvm-16 and repeated all upgrade changes until the problem occurred. The culprit was found to be
[..]

(quoted diff) +2 -0
+#ifdef THIS_PREVENTS_FC6_FROM_BOOTING
  		emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+#endif
[..]

Actually, the above line can be preserved, if we move the previous line down by 1: Was it a simple race?

kvm_main.c renamed from kvm_main-17.c +1 -1
@@ -1574,8 +1574,8 @@
 
  	if (kvm_run->mmio_completed) {
  		memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
-		vcpu->mmio_read_completed = 1;
  		emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+		vcpu->mmio_read_completed = 1;
  	}
 
  	vcpu->mmio_needed = 0;

--
Carsten Emde <[email protected]>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Hi!

Quoted 7 lines · Carsten Emde

Actually, the above line can be preserved, if we move the previous line down by 1: Was it a simple race?

kvm_main.c line 1581

Quoted 9 lines
kvm_main.c renamed from kvm_main-17.c +1 -1
@@ -1574,8 +1574,8 @@
 
  	if (kvm_run->mmio_completed) {
  		memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
-		vcpu->mmio_read_completed = 1;
  		emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+		vcpu->mmio_read_completed = 1;
  	}
 
  	vcpu->mmio_needed = 0;

As far as I understand, vcpu->mmio_read_completed indicates that read data is present in vcpu->mmio_data. If the flag isn't set, emulator_read_emulated() - which is called by emulate_instruction() - will try to read the data *again*. While that's supposed to be okay for ordinary memory, it might make memory mapped i/o devices fail.

On the other hand, emulator_read_emulated() clears the flag to indicate that the emulated read has actually happened - which means that another read may drop us into userspace for emulation again. There is, however, no other place where the flag is reset, so setting it after emulate_instruction() may affect the *next* emulated instruction. I think that the flag should be cleared after the call, rather than set.

Besides that, vcpu->mmio_read_completed seems to guard a call to do_interrupt_requests() in vmx_vcpu_run(). I guess the reason is that interrupts must not be processed if the current instruction has already been partially emulated.

Or did I get something wrong?

There's another point here that bothers me: The result of emulate_instruction() isn't checked. Are you sure that it never fails, and that it's safe to proceed to kvm_arch_ops->run(), aka vmx_vcpu_run() in case it's an Intel CPU?

Signature · 8 lines
Michael "Tired" Riepe <[email protected]>
X-Tired: Each morning I get up I die a little

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Hi!

Quoted 7 lines
Quoted 7 lines

Actually, the above line can be preserved, if we move the previous line down by 1: Was it a simple race?

kvm_main.c renamed from kvm_main-17.c +0 -1
[..]
-		vcpu->mmio_read_completed = 1;
  		emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
Quoted 8 lines

kvm_main.c line 1578

Quoted 1 line
kvm_main.c renamed from kvm_main-17.c +1 -0
+		vcpu->mmio_read_completed = 1;

As far as I understand, vcpu->mmio_read_completed indicates that read data is present in vcpu->mmio_data. If the flag isn't set, emulator_read_emulated() - which is called by emulate_instruction() - will try to read the data *again*. While that's supposed to be okay for ordinary memory, it might make memory mapped i/o devices fail. [..]
Or did I get something wrong?

I was probably a bit too fast. The only proven fact is that the system no longer stops booting when the call to emulate_instruction() is removed. Before speculating further, I will study the situation in more detail in order to better understand where and why it hangs.

--
Carsten Emde <[email protected]>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

author
#13 lore raw
In reply to a message not in the archive
Quoted 36 lines · Michael Riepe

Hi!

Quoted 8 lines · Carsten Emde

Actually, the above line can be preserved, if we move the previous line down by 1: Was it a simple race?

kvm_main.c line 1581

Quoted 9 lines
kvm_main.c renamed from kvm_main-17.c +1 -1
@@ -1574,8 +1574,8 @@
 
  	if (kvm_run->mmio_completed) {
  		memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
-		vcpu->mmio_read_completed = 1;
  		emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+		vcpu->mmio_read_completed = 1;
  	}
 
  	vcpu->mmio_needed = 0;

As far as I understand, vcpu->mmio_read_completed indicates that read data is present in vcpu->mmio_data. If the flag isn't set, emulator_read_emulated() - which is called by emulate_instruction() - will try to read the data *again*. While that's supposed to be okay for ordinary memory, it might make memory mapped i/o devices fail.

On the other hand, emulator_read_emulated() clears the flag to indicate that the emulated read has actually happened - which means that another read may drop us into userspace for emulation again. There is, however, no other place where the flag is reset, so setting it after emulate_instruction() may affect the *next* emulated instruction. I think that the flag should be cleared after the call, rather than set.

Quoted 7 lines

Besides that, vcpu->mmio_read_completed seems to guard a call to do_interrupt_requests() in vmx_vcpu_run(). I guess the reason is that interrupts must not be processed if the current instruction has already been partially emulated.

Or did I get something wrong?

No, it looks right. The code is fairly convoluted due to a control inversion problem: the instruction emulator wants to call userspace, but the only efficient way to do that is to return to userspace, and have userspace call the kernel again with the flag marking the continuation.

Quoted 6 lines

There's another point here that bothers me: The result of emulate_instruction() isn't checked. Are you sure that it never fails, and that it's safe to proceed to kvm_arch_ops->run(), aka vmx_vcpu_run() in case it's an Intel CPU?

When emulate_instruction() fails, it's a benign failure; it doesn't update any state.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
author
#14 lore raw
In reply to a message not in the archive
Quoted 16 lines · Carsten Emde

Review

Quoted 7 lines · Carsten Emde

I then reverted to kvm-16 and repeated all upgrade changes until the problem occurred. The culprit was found to be
[..]

(quoted diff) +2 -0
+#ifdef THIS_PREVENTS_FC6_FROM_BOOTING
          emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+#endif
[..]

Actually, the above line can be preserved, if we move the previous line down by 1: Was it a simple race?

kvm_main.c 2007-03-24 04:10:59.000000000 +0100 line 1581

Quoted 9 lines
kvm_main.c 2007-03-24 04:10:59.000000000 +0100 renamed from kvm_main-17.c 2007-03-24 02:09:00.000000000 +0100 +1 -1
@@ -1574,8 +1574,8 @@
 
     if (kvm_run->mmio_completed) {
         memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
-        vcpu->mmio_read_completed = 1;
         emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+        vcpu->mmio_read_completed = 1;
     }
 
     vcpu->mmio_needed = 0;

It's just a different way of backing it out. With mmio_read_completed unset, the emulation will simply fail.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#15 lore raw
In reply to a message not in the archive

Hi!

Quoted 9 lines · Carsten Emde
Quoted 3 lines · Avi Kivity
Quoted 1 line · Michael Riepe

With respect to the Core Duo, this is the best release I've seen so far:

Unfortunately, kvm-17 was less successful here. FC6 did not boot any longer after I upgraded from kvm-16 to kvm-17, so I was rather surprised when I read the above message.

Probably the same problem that killed Knoppix in -17 (-16 worked fine). But it was the first release that worked with both Net- and FreeBSD as well as Solaris.

Oh by the way: Knoppix 5.2 behaves the same way as 5.1.1. With -17, it hangs before the penguin logo appears on the framebuffer.

Quoted 2 lines

This is the test system:
CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz, Chipset: Intel 975X

There's quite a difference between Core Duo and Core 2 Duo.

Did the host and/or guest run in 64-bit mode, by the way?

Signature · 8 lines
Michael "Tired" Riepe <[email protected]>
X-Tired: Each morning I get up I die a little

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw

Michael,

Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

With respect to the Core Duo, this is the best release I've seen so far:

Unfortunately, kvm-17 was less successful here. FC6 did not boot any longer after I upgraded from kvm-16 to kvm-17, so I was rather surprised when I read the above message. [..]

But it was the first release that worked with both Net- and FreeBSD as well as Solaris.

Yes, of course. I certainly did not mean to question your merits.

Quoted 3 lines

Probably the same problem that killed Knoppix in -17 (-16 worked fine). [..] Oh by the way: Knoppix 5.2 behaves the same way as 5.1.1. With -17, it hangs before the penguin logo appears on the framebuffer.

Do you have one of these Knoppix handy to check whether moving the line in question in kvm_main.c:1578 solves the problem?

Quoted 3 lines
Quoted 2 lines

This is the test system:
CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz, Chipset: Intel 975X

There's quite a difference between Core Duo and Core 2 Duo.

Yes, indeed.

Quoted 1 line

Did the host and/or guest run in 64-bit mode, by the way?

32-bit.

--
Carsten Emde <[email protected]>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

author
#18 lore raw
In reply to a message not in the archive
Quoted 10 lines · Michael Riepe

Hi!

Quoted 6 lines · Carsten Emde
Quoted 3 lines · Avi Kivity

Michael Riepe wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

With respect to the Core Duo, this is the best release I've seen so far:

Unfortunately, kvm-17 was less successful here. FC6 did not boot any longer after I upgraded from kvm-16 to kvm-17, so I was rather surprised when I read the above message.

Probably the same problem that killed Knoppix in -17 (-16 worked fine).

That is likely. When I reported knoppix worked for me, it was using the head, which already had this reverted. Sloppy of me.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
author
#19 lore raw
In reply to a message not in the archive
Quoted 22 lines · Carsten Emde
Quoted 3 lines · Avi Kivity
Quoted 2 lines · Michael Riepe

With respect to the Core Duo, this is the best release I've seen so far:

Unfortunately, kvm-17 was less successful here. FC6 did not boot any longer after I upgraded from kvm-16 to kvm-17, so I was rather surprised when I read the above message.

This is the test system:
CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz, Chipset: Intel 975X

The exact problem was that FC6 stopped booting before under kvm-16 it would display the line
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)

I then reverted to kvm-16 and repeated all upgrade changes until the problem occurred. The culprit was found to be

kvm_main.c 2007-03-24 02:56:15.000000000 +0100 line 1583

Quoted 9 lines
kvm_main.c 2007-03-24 02:56:15.000000000 +0100 renamed from kvm_main-17.c 2007-03-24 02:09:00.000000000 +0100 +2 -0
@@ -1575,7 +1575,9 @@
     if (kvm_run->mmio_completed) {
         memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
         vcpu->mmio_read_completed = 1;
+#ifdef THIS_PREVENTS_FC6_FROM_BOOTING
         emulate_instruction(vcpu, kvm_run, vcpu->mmio_fault_cr2, 0);
+#endif
     }
 
     vcpu->mmio_needed = 0;

I've already reverted this optimization. I'd like to get it back, since it is sound, but I don't yet understand why it caused the regression.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
author
#20 lore raw
In reply to a message not in the archive
Quoted 12 lines · Michael Riepe

Hi!

With respect to the Core Duo, this is the best release I've seen so far:

- FreeBSD 6.1: works.
- NetBSD 3.1: works.
- OpenSuse 10.2 (sans gfxmenu): works.
- Qemu-Puppy 2.01-3: works.
- Qemu-Puppy 2.13-1: works.
- Solaris 10.1: works.
- XP Pro: works.

Quoted 6 lines

Unfortunately, Knoppix (both 5.0 and 5.1.1) has stopped working now. I didn't try 5.2 yet.

(using Kernel 2.6.20)

Can you update http://kvm.qumranet.com/kvmwiki/Guest_Support_Status with the results?

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV