Skip to contentSkip to conversation

kvm-83 release

ANNOUNCE Avi Kivity 7 participants 13 messages Jan 13, 2009 – Jan 15, 2009 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

The biggest change this time around is support for the AMD IOMMU for device assignment. As it requires extensive core kernel support, it is only available on Linux 2.6.29rc1 or higher hosts.

Changes from kvm-82:
- amd iommu support (with Linux 2.6.29+ hosts) (Joerg Roedel)
- merge qemu-svn
- qcow2 correctness fixes
- '-drive serial=...' option
- virtio-net migration fixes
- fix '--with-patched-kernel' build on Ubuntu (Nolan Leake)
- improved tsc handling (Marcelo Tosatti)
- should reduce timing errors on older Linux guests
- remove cpuid code duplication due to upstream qemu work (Amit Shah)
- guest S3 sleep (Gleb Natapov)
- load assigned devices option rom (Kechao Liu)
- '-no-kvm-pit-reinjection' option to improve timing on RHEL 3 era guests (Marcelo Tosatti)
- remove duplicate firmware config interface probe in bios (Sebastian Herbszt)
- backward compatibility for marker_synchronize_register() (Eduardo Habkost)
- fix compile warning in tpr patching (Mark McLoughlin)
- don't install kvm headers to /usr/local
- fix smbios memory size in certain cases (Bill Rieske)
- simplify mmu shadow walking function
- stop using vmap() on guest pages (annoys ksm) (Izik Eidus)
- fix warning on MSR_VM_HSAVE_PA in dmesg
- fix i8254 timer count read (Marcelo Tosatti)
- ppc e500 core support (Hollis Blanchard)
- fix vmx real mode guest state validity checks
- make pop instruction emulation a little more generic
- implement 'ret far' instruction emulation
- properly lock i8354 timer
- remove ppc debug support (Hollis Blanchard)
- fix race freeing assigned device interrupt (Sheng Yang)
- fix pci interrupt in freeing in device assignment (Sheng Yang)
- allow disabling msi for assigned devices (Sheng Yang)
- emulate amd microcode level msr (Alexander Graf)
- helps esx boot on kvm
- make page unshadowing a little faster
- clear pending pit interrupts when unmasking the timer irq
- fixes xen-on-kvm
- mmu notifiers release method (Marcelo Tosatti)
- fixes large pages support
- expose ia64 registers to userspace (Jes Sorensen)
- fix type in has_svm() (Joe Perches)
- drop unnecessary memory clearing when allocating shadow page (Marcelo Tosatti)
- rename "metaphysical" page attribute to "direct"
- fix irq routing with -no-kernel-irqchip

Notes:
If you use the modules bundled with kvm-83, you can use any version
of Linux from 2.6.16 upwards. You may also use kvm-83 userspace with the kvm modules provided by Linux 2.6.25 or above. Some features may only be available in newer releases.

http://kvm.qumranet.com

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
#1 lore raw
Quoted 3 lines · Avi Kivity

The biggest change this time around is support for the AMD IOMMU for device assignment. As it requires extensive core kernel support, it is only available on Linux 2.6.29rc1 or higher hosts.

status report on rhel/centos-5.2 host:
- fedora-9 latest kernel now boot again
- fedora-10 installer stop at "waiting for hardware..." so it's currently not able to upgrade fedora-9 guest neither from cdrom nor form preupgrade (ie hard disk).

and these dozens of warning still comes during compilation on rhel/centos 5.2:
-----------------------------------------
In file included from /home/robot/rpm/BUILD/kvm-83/kernel/include/asm/kvm_host.h:65,
from
/home/robot/rpm/BUILD/kvm-83/kernel/include/linux/kvm_host.h:67,

                 from /home/robot/rpm/BUILD/kvm-83/kernel/x86/lapic.c:60:

/home/robot/rpm/BUILD/kvm-83/kernel/include-compat/asm/msr-index.h:30:1:
warning: "MSR_IA32_PERFCTR0" redefined
In file included from include/asm/processor.h:16,
from
/home/robot/rpm/BUILD/kvm-83/kernel/include/asm/kvm_para.h:89,
from
/home/robot/rpm/BUILD/kvm-83/kernel/include/linux/kvm_para.h:63,
from
/home/robot/rpm/BUILD/kvm-83/kernel/x86/../external-module-compat-comm.h:14,
from
/home/robot/rpm/BUILD/kvm-83/kernel/x86/external-module-compat.h:9,
from <command line>:1:
include/asm/msr.h:190:1: warning: this is the location of the previous definition
In file included from /home/robot/rpm/BUILD/kvm-83/kernel/include/asm/kvm_host.h:65,
from
/home/robot/rpm/BUILD/kvm-83/kernel/include/linux/kvm_host.h:67,

                 from /home/robot/rpm/BUILD/kvm-83/kernel/x86/lapic.c:60:

/home/robot/rpm/BUILD/kvm-83/kernel/include-compat/asm/msr-index.h:31:1:
warning: "MSR_IA32_PERFCTR1" redefined
In file included from include/asm/processor.h:16,
from
/home/robot/rpm/BUILD/kvm-83/kernel/include/asm/kvm_para.h:89,
from
/home/robot/rpm/BUILD/kvm-83/kernel/include/linux/kvm_para.h:63,
from
/home/robot/rpm/BUILD/kvm-83/kernel/x86/../external-module-compat-comm.h:14,
from
/home/robot/rpm/BUILD/kvm-83/kernel/x86/external-module-compat.h:9,
from <command line>:1:
-----------------------------------------

Signature · 1 line
  Levente                               "Si vis pacem para bellum!"
#4 lore raw
In reply to Avi Kivity

Hi, i installed kvm-83 on xubuntu-amd64/kernel-2.6.7-11.
i notice some problem with -net downscript.
my kvm start up script like this:
qemu-system-x86_64 ... ... -net tap,ifname=tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown when the guest shutdown, kvm pass all argument to downscript.

the command like this (kvm-83):
/path/kvm-ifdown "tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown"

kvm-82 only pass tap0 to downscript like this:
/path/kvm-ifdown "tap0"

and i notice both kvm82/kvm83 not installed modules to /lib/modules/2.6.27-11-generic/kernel/arch/x86/kvm/{kvm-amd,kvm-intel,kvm}.ko it only rename the old modules to {kvm,kvm-intel,kvm-amd}.ko.org.

please help, thank you.

Quoted 59 lines · Avi Kivity

The biggest change this time around is support for the AMD IOMMU for device assignment. As it requires extensive core kernel support, it is only available on Linux 2.6.29rc1 or higher hosts.

Changes from kvm-82:
- amd iommu support (with Linux 2.6.29+ hosts) (Joerg Roedel)
- merge qemu-svn
- qcow2 correctness fixes
- '-drive serial=...' option
- virtio-net migration fixes
- fix '--with-patched-kernel' build on Ubuntu (Nolan Leake)
- improved tsc handling (Marcelo Tosatti)
- should reduce timing errors on older Linux guests
- remove cpuid code duplication due to upstream qemu work (Amit Shah)
- guest S3 sleep (Gleb Natapov)
- load assigned devices option rom (Kechao Liu)
- '-no-kvm-pit-reinjection' option to improve timing on RHEL 3 era guests (Marcelo Tosatti)
- remove duplicate firmware config interface probe in bios (Sebastian Herbszt)
- backward compatibility for marker_synchronize_register() (Eduardo Habkost)
- fix compile warning in tpr patching (Mark McLoughlin)
- don't install kvm headers to /usr/local
- fix smbios memory size in certain cases (Bill Rieske)
- simplify mmu shadow walking function
- stop using vmap() on guest pages (annoys ksm) (Izik Eidus)
- fix warning on MSR_VM_HSAVE_PA in dmesg
- fix i8254 timer count read (Marcelo Tosatti)
- ppc e500 core support (Hollis Blanchard)
- fix vmx real mode guest state validity checks
- make pop instruction emulation a little more generic
- implement 'ret far' instruction emulation
- properly lock i8354 timer
- remove ppc debug support (Hollis Blanchard)
- fix race freeing assigned device interrupt (Sheng Yang)
- fix pci interrupt in freeing in device assignment (Sheng Yang)
- allow disabling msi for assigned devices (Sheng Yang)
- emulate amd microcode level msr (Alexander Graf)
- helps esx boot on kvm
- make page unshadowing a little faster
- clear pending pit interrupts when unmasking the timer irq
- fixes xen-on-kvm
- mmu notifiers release method (Marcelo Tosatti)
- fixes large pages support
- expose ia64 registers to userspace (Jes Sorensen)
- fix type in has_svm() (Joe Perches)
- drop unnecessary memory clearing when allocating shadow page (Marcelo Tosatti)
- rename "metaphysical" page attribute to "direct"
- fix irq routing with -no-kernel-irqchip

Notes:
If you use the modules bundled with kvm-83, you can use any version
of Linux from 2.6.16 upwards. You may also use kvm-83 userspace with the kvm modules provided by Linux 2.6.25 or above. Some features may only be available in newer releases.

http://kvm.qumranet.com

#5 lore raw

Hi John,

Quoted 7 lines · John Wong

Hi, i installed kvm-83 on xubuntu-amd64/kernel-2.6.7-11. i notice some problem with -net downscript.
my kvm start up script like this:
qemu-system-x86_64 ... ... -net tap,ifname=tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown when the guest shutdown, kvm pass all argument to downscript.

Quoted 6 lines

the command like this (kvm-83):
/path/kvm-ifdown "tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown"

kvm-82 only pass tap0 to downscript like this:
/path/kvm-ifdown "tap0"

Thanks for the report. Can you try this simple change and see if it fixes it for you?

net.c +1 -1
@@ -1740,7 +1740,7 @@ void net_cleanup(void)
                 TAPState *s = vc->opaque;
 
                 if (strcmp(vc->model, "tap") == 0 &&
-                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+                    sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&
                     s->down_script[0])
                     launch_script(s->down_script, ifname, s->fd);
             }

Thanks,
Mark.

#6 lore raw

Hi Mark, i want to try, but i don't know where can download snapshot source code,
i'm long time no use linux.
Where can i download kvm snapshot source code? kernel.org? or?

Quoted 42 lines · Mark McLoughlin

Hi John,

Quoted 7 lines · John Wong

Hi, i installed kvm-83 on xubuntu-amd64/kernel-2.6.7-11. i notice some problem with -net downscript.
my kvm start up script like this:
qemu-system-x86_64 ... ... -net tap,ifname=tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown when the guest shutdown, kvm pass all argument to downscript.

Quoted 7 lines

the command like this (kvm-83):
/path/kvm-ifdown "tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown"

kvm-82 only pass tap0 to downscript like this:
/path/kvm-ifdown "tap0"

Thanks for the report. Can you try this simple change and see if it fixes it for you?

net.c +1 -1
@@ -1740,7 +1740,7 @@ void net_cleanup(void)
                 TAPState *s = vc->opaque;
 
                 if (strcmp(vc->model, "tap") == 0 &&
-                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+                    sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&
                     s->down_script[0])
                     launch_script(s->down_script, ifname, s->fd);
             }

Thanks,
Mark.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 4 lines · John Wong

Hi Mark, i want to try, but i don't know where can download snapshot source code,
i'm long time no use linux.
Where can i download kvm snapshot source code? kernel.org? or?

Hi John,

You apply this patch on top of the kvm-83 release that you've already downloaded. You don't need anything else.

Amit.

#8 lore raw
In reply to Mark McLoughlin
Quoted 23 lines · Mark McLoughlin

Hi John,

Quoted 7 lines · John Wong

Hi, i installed kvm-83 on xubuntu-amd64/kernel-2.6.7-11. i notice some problem with -net downscript.
my kvm start up script like this:
qemu-system-x86_64 ... ... -net tap,ifname=tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown when the guest shutdown, kvm pass all argument to downscript.

Quoted 6 lines

the command like this (kvm-83):
/path/kvm-ifdown "tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown"

kvm-82 only pass tap0 to downscript like this:
/path/kvm-ifdown "tap0"

Thanks for the report. Can you try this simple change and see if it fixes it for you?

net.c void net_cleanup(void) · line 1743

Quoted 5 lines
net.c +1 -1
@@ -1740,7 +1740,7 @@ void net_cleanup(void)
                 TAPState *s = vc->opaque;
 
                 if (strcmp(vc->model, "tap") == 0 &&
-                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+                    sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&

Hmm. What if ifname=foo is the last parameter?

/mjt

#9 lore raw
Quoted 1 line · Michael Tokarev

Mark McLoughlin wrote:

[]

Quoted 10 lines

net.c void net_cleanup(void) · line 1743

Quoted 8 lines
net.c +1 -1
@@ -1740,7 +1740,7 @@ void net_cleanup(void)
                 TAPState *s = vc->opaque;
 
                 if (strcmp(vc->model, "tap") == 0 &&
-                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+                    sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&

Hmm. What if ifname=foo is the last parameter?

And while we're at it.. Why the parsing isn't done like this:

  for(tok = strtok(arg, ","); tok; tok = strtok(NULL, ",")) {
    if (strncmp(tok, "ifname=", 7) == 0)
      strcpy(ifname, tok+7);
    else if ...
  }

-- here and everywhere else?

/mjt

#10 lore raw
Quoted 18 lines · Michael Tokarev
Quoted 2 lines · Michael Tokarev

Mark McLoughlin wrote:

[]

Quoted 11 lines

net.c void net_cleanup(void) · line 1744

Quoted 9 lines
net.c +1 -1
@@ -1740,7 +1740,7 @@ void net_cleanup(void)
                 TAPState *s = vc->opaque;
 
                 if (strcmp(vc->model, "tap") == 0 &&
-                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+                    sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&
 

Hmm. What if ifname=foo is the last parameter?

Quoted 8 lines

And while we're at it.. Why the parsing isn't done like this:

  for(tok = strtok(arg, ","); tok; tok = strtok(NULL, ",")) {
    if (strncmp(tok, "ifname=", 7) == 0)
      strcpy(ifname, tok+7);
    else if ...
  }

Because strtok is extremely evil.

Regards,

Anthony Liguori

Quoted 8 lines

-- here and everywhere else?

/mjt
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
Quoted 1 line · Anthony Liguori
Quoted 1 line

Michael Tokarev wrote:

...

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

net.c void net_cleanup(void) · line 1743

Quoted 3 lines
       if (strcmp(vc->model, "tap") == 0 &&
net.c +1 -1
-          sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+          sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&

And while we're at it.. Why the parsing isn't done like this:

Quoted 7 lines
Quoted 5 lines
  for(tok = strtok(arg, ","); tok; tok = strtok(NULL, ",")) {
    if (strncmp(tok, "ifname=", 7) == 0)
      strcpy(ifname, tok+7);
    else if ...
  }

Because strtok is extremely evil.

I didn't mean strtok, but the way -- something LIKE that, i.e, by splitting the string into args and parsing each in turn. There's getsubopt(3) too, which does exactly that, and which is used by, say, mount(8) to parse mount options (-o foo=bar things). Those home-grown sscanfs tend to become buggy like in this example...

And if you dislike strtok especially, there are other alternatives. And speaking of strtok, there's nothing evil in it provided you don't run another strtok sequence while this one is running (it's not reenterant, so to say). Here, let it modify the existing string and replace delimiters with zeros to terminate our tokens, -- nothing wrong with that. It's not worse than silently truncating ifname size to 63 chars first and to IF_NAMESIZE second. If you don't want to modify original string, strdup() or astrdup() are our friends... But that's all details, details, not related to the original issue and question.

/mjt

#12 lore raw
Quoted 15 lines · Michael Tokarev
Quoted 1 line · Anthony Liguori
Quoted 1 line

Michael Tokarev wrote:

...

Quoted 12 lines
Quoted 11 lines
Quoted 3 lines

net.c void net_cleanup(void) · line 1743

Quoted 3 lines
       if (strcmp(vc->model, "tap") == 0 &&
net.c +1 -1
-          sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+          sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&

And while we're at it.. Why the parsing isn't done like this:

  for(tok = strtok(arg, ","); tok; tok = strtok(NULL, ",")) {
    if (strncmp(tok, "ifname=", 7) == 0)
      strcpy(ifname, tok+7);
    else if ...
  }
Quoted 4 lines
Quoted 1 line

Because strtok is extremely evil.

I didn't mean strtok, but the way -- something LIKE that, i.e, by splitting the string into args and parsing each in turn.

It shouldn't be parsing anything at all, it's a stupid lame hack.

I fixed it with:

http://git.kernel.org/?p=virt/qemu/qemu.git;a=commit;h=973cbd37ce

Cheers,
Mark.

author
#2 lore raw
In reply to Farkas Levente
Quoted 7 lines · Farkas Levente
Quoted 4 lines · Avi Kivity

The biggest change this time around is support for the AMD IOMMU for device assignment. As it requires extensive core kernel support, it is only available on Linux 2.6.29rc1 or higher hosts.

Quoted 6 lines

status report on rhel/centos-5.2 host:
- fedora-9 latest kernel now boot again
- fedora-10 installer stop at "waiting for hardware..." so it's currently not able to upgrade fedora-9 guest neither from cdrom nor form preupgrade (ie hard disk).

Works here. What's your host cpu type? Does the error occur if you pin the guest to one host cpu?

Quoted 11 lines

and these dozens of warning still comes during compilation on rhel/centos 5.2:
-----------------------------------------
In file included from /home/robot/rpm/BUILD/kvm-83/kernel/include/asm/kvm_host.h:65,
from
/home/robot/rpm/BUILD/kvm-83/kernel/include/linux/kvm_host.h:67,

                 from /home/robot/rpm/BUILD/kvm-83/kernel/x86/lapic.c:60:

/home/robot/rpm/BUILD/kvm-83/kernel/include-compat/asm/msr-index.h:30:1:
warning: "MSR_IA32_PERFCTR0" redefined

I've fixed those for kvm-84.

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
Quoted 15 lines · Avi Kivity
Quoted 7 lines · Farkas Levente
Quoted 4 lines · Avi Kivity

The biggest change this time around is support for the AMD IOMMU for device assignment. As it requires extensive core kernel support, it is only available on Linux 2.6.29rc1 or higher hosts.

Quoted 6 lines

status report on rhel/centos-5.2 host:
- fedora-9 latest kernel now boot again
- fedora-10 installer stop at "waiting for hardware..." so it's currently not able to upgrade fedora-9 guest neither from cdrom nor form preupgrade (ie hard disk).

Quoted 2 lines

Works here. What's your host cpu type? Does the error occur if you pin the guest to one host cpu?

both the install/upgrade dvd and the preupgrade failed on this host with guest-7 (but now all other guest are working):
- host:
- Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
- Intel S3000AHV
- 8GB RAM
- CentOS-5.2
- kernel-2.6.18-92.1.22.el5 x86_64 64bit
- guest-1:
- CentOS-5.2 - 4 vcpu
- kernel-2.6.18-92.1.22.el5 i386 32bit
- guest-2:
- CentOS-5.2 - 4 vcpu
- kernel-2.6.18-92.1.22.el5 x86_64 64bit
- guest-3:
- Mandrake-9 - 1 vcpu
- kernel-2.4.19.16mdk-1-1mdk 32bit
- guest-4:
- Mandrake-10 - 1 vcpu
- kernel-2.6.14.2-p4-smp 32bit
- guest-5:
- Windows XP Professional 32bit - 2 vcpu
- guest-7:
- Fedora-9 - 4 vcpu
- kernel-2.6.25.14-108.fc9.i686

Signature · 1 line
  Levente                               "Si vis pacem para bellum!"