Re: [kvm-devel] [PATCH] fix cpuid function 4

2008-01-14 Thread Alexander Graf
Dan Kenigsberg wrote: > On Mon, Jan 14, 2008 at 02:49:31PM +0100, Alexander Graf wrote: > >> Hi, >> >> Currently CPUID function 4 is broken. This function's values rely on the >> value of ECX. >> To solve the issue cleanly, there is already a new API for cpuid >> settings, which is not used yet.

Re: [kvm-devel] mmu notifiers

2008-01-14 Thread Avi Kivity
Christoph Lameter wrote: > On Sun, 13 Jan 2008, Avi Kivity wrote: > > >> I was just explaining how kvm shares memory among guests (which does not >> require mmu notifiers); if you have some other configuration that can benefit >> from mmu notifiers, then, well, great. >> > > I think you hav

Re: [kvm-devel] mmu notifiers

2008-01-14 Thread Avi Kivity
Christoph Lameter wrote: > On Sat, 12 Jan 2008, Avi Kivity wrote: > > >> Two kvm instances mmap() the file (from anywhere) into the guest address >> space. That memory is shared, and will be backed by the same page structs at >> the same offset. >> > > Duh. Impossible. Two instances of Lin

Re: [kvm-devel] [PATCH] mmu notifiers #v2

2008-01-14 Thread Benjamin Herrenschmidt
On Mon, 2008-01-14 at 12:02 -0800, Christoph Lameter wrote: > On Sun, 13 Jan 2008, Andrea Arcangeli wrote: > > > About the locking perhaps I'm underestimating it, but by following the > > TLB flushing analogy, by simply clearing the shadow ptes (with kvm > > mmu_lock spinlock to avoid racing with

Re: [kvm-devel] [kvm-ppc-devel] RFC: MMIO endianness flag

2008-01-14 Thread Hollis Blanchard
On Tue, 2008-01-15 at 10:43 +0800, Xu, Anthony wrote: > > Here is the concrete example: > > * guest writes to MMIO > > * KVM passes MMIO information (physical address, number of > > bytes, value) to qemu > The value is saved in memory, is it bigendian or > littleen

Re: [kvm-devel] [kvm-ppc-devel] RFC: MMIO endianness flag

2008-01-14 Thread Xu, Anthony
> Here is the concrete example: > * guest writes to MMIO > * KVM passes MMIO information (physical address, number of > bytes, value) to qemu The value is saved in memory, is it bigendian or littleendian? > * Qemu knows from the address that this access is

[kvm-devel] qemu_mutex deadlock with -smp 2

2008-01-14 Thread Darrick J. Wong
Hi, I'm attempting to run a KVM instance with 2 CPUs configured. The VM appears to get most of the way through booting Ubuntu and then kvm locks up. At that point there's nothing printed on stdout from the kvm process and the monitor doesn't respond either. The host's kernel is 2.6.24-rc7 and t

[kvm-devel] [PATCH 0/2] kvm clock - userspace

2008-01-14 Thread Glauber de Oliveira Costa
Here are the two patches of the userspace part of the series. First patch is unchanged. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http:/

[kvm-devel] [PATCH 0/3] kvm clock, next iteration

2008-01-14 Thread Glauber de Oliveira Costa
Here's a new version, with some comments addressed. I'm using only one msr instead of two as avi sugested. Reason is that, following another comentary of avi, I'm doing kmap_atomic's instead of kvm_write. however, as all the information is part of the same page, both kmaps end up pointing to the s

Re: [kvm-devel] [PATCH 1/2] include kvm_para.h

2008-01-14 Thread Glauber de Oliveira Costa
Avi Kivity wrote: > Glauber de Oliveira Costa wrote: >> have qemu-kvm to include kvm_para, allowing access to paravirt >> definitions >> >> Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> >> --- >> qemu/qemu-kvm-x86.c |1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >

Re: [kvm-devel] [kvm-ppc-devel] RFC: MMIO endianness flag

2008-01-14 Thread Hollis Blanchard
On Mon, 2008-01-14 at 19:30 +0200, Avi Kivity wrote: > Hollis Blanchard wrote: > > On Sun, 2008-01-13 at 11:42 +0200, Avi Kivity wrote: > > > > > >> Do we really need to propagate endianness all the way to the user? > >> Perhaps libkvm could call the regular mmio functions and do the > >> tra

Re: [kvm-devel] [RFC] fix VMX TSC synchronicity

2008-01-14 Thread Marcelo Tosatti
On Mon, Jan 14, 2008 at 02:06:47PM -0200, Marcelo Tosatti wrote: > Hi Avi, > > On Sun, Jan 13, 2008 at 02:19:29PM +0200, Avi Kivity wrote: > > Marcelo Tosatti wrote: > > >The boot TSC sync check is failing on recent Linux SMP guests on TSC > > >stable hosts. > > > > > > > > > > What about tsc u

Re: [kvm-devel] [PATCH] mmu notifiers #v2

2008-01-14 Thread Christoph Lameter
On Sun, 13 Jan 2008, Andrea Arcangeli wrote: > About the locking perhaps I'm underestimating it, but by following the > TLB flushing analogy, by simply clearing the shadow ptes (with kvm > mmu_lock spinlock to avoid racing with other vcpu spte accesses of > course) and flushing the shadow-pte afte

Re: [kvm-devel] mmu notifiers

2008-01-14 Thread Christoph Lameter
On Sun, 13 Jan 2008, Avi Kivity wrote: > I was just explaining how kvm shares memory among guests (which does not > require mmu notifiers); if you have some other configuration that can benefit > from mmu notifiers, then, well, great. I think you have two page tables pointing to the same memory l

Re: [kvm-devel] mmu notifiers

2008-01-14 Thread Christoph Lameter
On Sat, 12 Jan 2008, Avi Kivity wrote: > Two kvm instances mmap() the file (from anywhere) into the guest address > space. That memory is shared, and will be backed by the same page structs at > the same offset. Duh. Impossible. Two instances of Linux cannot share page structs. So how are you d

[kvm-devel] only for better reading

2008-01-14 Thread inflo
hi, this patch is only for better reading. flo --- x86.c 2008-01-14 18:05:07.0 +0100 +++ changed/x86.c 2008-01-14 18:06:10.0 +0100 @@ -407,10 +407,15 @@ * capabilities of the host cpu. */ static u32 msrs_to_save[] = { - MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTE

Re: [kvm-devel] Setting hardware breakpoints in guest OS

2008-01-14 Thread Avi Kivity
[EMAIL PROTECTED] wrote: >> While we tried to make debugging inside the guest work, this >> was never really tested, so it's likely broken. I'll try to >> look at what it will take to make it work; I don't think there's >> much needed. >> > > Thinking a bit, it may well be broken only whe

Re: [kvm-devel] KVM swapping with mmu notifiers

2008-01-14 Thread Andrea Arcangeli
On Mon, Jan 14, 2008 at 05:43:58PM +0200, Avi Kivity wrote: > heavy handed. Maybe it can be fixed in some clever way with rcu or with a > rwlock around the memory slot map. Ok, first the alias looked superflous so I just dropped it (the whole point of the alias is to never call get_user_pages in

Re: [kvm-devel] [PATCH] add acpi powerbutton support

2008-01-14 Thread Avi Kivity
Guido Guenther wrote: - backout the madt interrupt source override changes Should these stay, but with active low instead of active high? They can go away, since active low is the default. For reference, I'm attaching the patches I'm using. -- error compiling committee.c: too many

Re: [kvm-devel] [kvm-ppc-devel] RFC: MMIO endianness flag

2008-01-14 Thread Avi Kivity
Hollis Blanchard wrote: > On Sun, 2008-01-13 at 11:42 +0200, Avi Kivity wrote: > > >> Do we really need to propagate endianness all the way to the user? >> Perhaps libkvm could call the regular mmio functions and do the >> transformation itself. >> >> Or maybe even the kernel can do this by i

Re: [kvm-devel] [kvm-ppc-devel] RFC: MMIO endianness flag

2008-01-14 Thread Hollis Blanchard
I hope I've explained in the other mail I just sent why Qemu assuming little-endian for everything is not OK. One other important clarification: kvm_run->mmio.is_bigendian is about *one* *particular* *MMIO* *access*. It has only coincidental relationship to the "endianness mode" of the guest. --

Re: [kvm-devel] [kvm-ppc-devel] RFC: MMIO endianness flag

2008-01-14 Thread Hollis Blanchard
On Sun, 2008-01-13 at 11:42 +0200, Avi Kivity wrote: > Do we really need to propagate endianness all the way to the user? > Perhaps libkvm could call the regular mmio functions and do the > transformation itself. > > Or maybe even the kernel can do this by itself? The kernel *already* does th

Re: [kvm-devel] [PATCH] fix cpuid function 4

2008-01-14 Thread Dan Kenigsberg
On Mon, Jan 14, 2008 at 02:49:31PM +0100, Alexander Graf wrote: > Hi, > > Currently CPUID function 4 is broken. This function's values rely on the > value of ECX. > To solve the issue cleanly, there is already a new API for cpuid > settings, which is not used yet. > Using the current interface, th

Re: [kvm-devel] [RFC] fix VMX TSC synchronicity

2008-01-14 Thread Marcelo Tosatti
Hi Avi, On Sun, Jan 13, 2008 at 02:19:29PM +0200, Avi Kivity wrote: > Marcelo Tosatti wrote: > >The boot TSC sync check is failing on recent Linux SMP guests on TSC > >stable hosts. > > > > > > What about tsc unstable hosts? If your patch convinces the guest its > tsc is table, while the host

Re: [kvm-devel] KVM swapping with mmu notifiers

2008-01-14 Thread Avi Kivity
Andrea Arcangeli wrote: >> >> Aren't mmu notifiers called with mmap_sem held for read? >> >> Maybe not from the swap path? >> > > Good point, the swap path isn't covered by the mmap_sem, so Marcelo's > right I need to fixup the locking a bit. > One idea I had at a time was to add ->lock()

Re: [kvm-devel] KVM swapping with mmu notifiers

2008-01-14 Thread Andrea Arcangeli
On Mon, Jan 14, 2008 at 04:09:03PM +0200, Avi Kivity wrote: > Marcelo Tosatti wrote: >>> +static void unmap_spte(struct kvm *kvm, u64 *spte) >>> +{ >>> + struct page *page = pfn_to_page((*spte & PT64_BASE_ADDR_MASK) >> >>> PAGE_SHIFT); >>> + get_page(page); >>> + rmap_remove(kvm, spte); >>>

Re: [kvm-devel] KVM swapping with mmu notifiers

2008-01-14 Thread Avi Kivity
Marcelo Tosatti wrote: >> >> +static void unmap_spte(struct kvm *kvm, u64 *spte) >> +{ >> +struct page *page = pfn_to_page((*spte & PT64_BASE_ADDR_MASK) >> >> PAGE_SHIFT); >> +get_page(page); >> +rmap_remove(kvm, spte); >> +set_shadow_pte(spte, shadow_trap_nonpresent_pte); >> +

Re: [kvm-devel] KVM swapping with mmu notifiers

2008-01-14 Thread Andrea Arcangeli
On Mon, Jan 14, 2008 at 11:45:39AM -0200, Marcelo Tosatti wrote: > The alias and memslot maps are protected only by mmap_sem, so you yes, they are already protected and furthermore in write mode. > should make kvm_set_memory_region/set_memory_alias grab the mmu spinlock > in addition to mmap_sem

[kvm-devel] [PATCH] fix cpuid function 4

2008-01-14 Thread Alexander Graf
Hi, Currently CPUID function 4 is broken. This function's values rely on the value of ECX. To solve the issue cleanly, there is already a new API for cpuid settings, which is not used yet. Using the current interface, the function 4 can be easily passed through, by giving multiple function 4 outpu

Re: [kvm-devel] KVM swapping with mmu notifiers

2008-01-14 Thread Marcelo Tosatti
Hi Andrea, > path for kvm so I guess not worth optimizing in the short/mid term, > but by optimizing the invalidate_page case we may halve the number of > tlb flushes for some common case. I leave it for later, the swapping > is heavily I/O bound anyway so a some more ipi in smp host shouldn't > b

Re: [kvm-devel] [PATCH] add acpi powerbutton support

2008-01-14 Thread Guido Guenther
On Mon, Jan 14, 2008 at 04:41:23AM -0800, Alexey Eremenko wrote: > As far as I know, Qemu/KVM already had ACPI power button; It can be used via > Qemu Monitor: "system_shutdown" command. Before 46b1a7377b55a3b6317b18fff64f1a80de7d3120 system_powerdown was a "do { } while(0);" on i386 and the FF pw

Re: [kvm-devel] [PATCH] report revision 3 of the ACPI/SMBus PIIX4 controller

2008-01-14 Thread Marcelo Tosatti
On Sun, Jan 13, 2008 at 04:49:27PM +0100, Anders wrote: > Marcelo Tosatti <[EMAIL PROTECTED]> writes: > > > On Sun, Jan 13, 2008 at 12:19:20PM +0100, Anders wrote: > > [...] > > >> How do you get that high consumption? What combination of clocks/hz on > >> host/guest are you using? > > > > CONFI

Re: [kvm-devel] [PATCH] add acpi powerbutton support

2008-01-14 Thread Alexey Eremenko
Hi, As far as I know, Qemu/KVM already had ACPI power button; It can be used via Qemu Monitor: "system_shutdown" command. -Alexey "Technologov" - Check out the new SourceForge.net Marketplace. It's the best place to buy or s

[kvm-devel] [PATCH] remove SIGUSR2 from io_sigset to avoid breaking AIO

2008-01-14 Thread Liu, Eric E
If we use Qcow img to boot SMP guest, windows guest may hang , since the vcpu thread which does AIO will wait for the signal SIGUSR2 which may be eated by vcpu 0 's thread. So this patch removes SIGUSR2 from io_sigset and masks it in vcpu 0's thread, it can let the guest boot successfully. >From

[kvm-devel] KVM Test result, kernel 9e007c.., userspace 0c0ebd..

2008-01-14 Thread Zhao, Yunfeng
Hi, all, This is today's KVM test result against kvm.git 9e007c2364364e4243870a61c7e8ed9f8527fa5b and kvm-userspace.git 0c0ebd23c33108ee45a9e41831b33d21ff9ebb6b. Have two updates for the timer issue and save/restore issue ** Timer on IA32e linux guest is about 5x faster than network timer. ** Sav

Re: [kvm-devel] [PATCH] add acpi powerbutton support

2008-01-14 Thread Guido Guenther
On Sun, Jan 13, 2008 at 03:48:04PM +0200, Avi Kivity wrote: > Okay, this is likely right as I was able to shutdown both Windows and Linux > with the following: Cool. > - backout the madt interrupt source override changes Should these stay, but with active low instead of active high? -- Guido --

Re: [kvm-devel] [PATCH] add acpi powerbutton support

2008-01-14 Thread Guido Guenther
On Sun, Jan 13, 2008 at 11:35:48AM +0200, Avi Kivity wrote: > Guido Guenther wrote: >> On Tue, Jan 08, 2008 at 10:50:00AM +0200, Avi Kivity wrote: >> >>> Yes, you can press the VM's power button (system_powerdown in the >>> monitor) and it will invoke the OS shutdown sequence. >>> >>> Only work

[kvm-devel] [PATCH][RESEND] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2

2008-01-14 Thread Christian Ehrhardt
Subject: [PATCH][RESEND] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2 From: Christian Ehrhardt <[EMAIL PROTECTED]> This Patch adds the callback assignment and handlers for powerpc_dcr_read and ppc_dcr_write which are called from libkvm. This is the part of the patch that c

Re: [kvm-devel] [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2

2008-01-14 Thread Christian Ehrhardt
Avi Kivity wrote: > Avi Kivity wrote: >> Christian Ehrhardt wrote: >>> Subject: [PATCH] fill kvm_callback with arch specific >>> dcr_read/dcr_write callbacks v2 >>> From: Christian Ehrhardt <[EMAIL PROTECTED]> >>> >>> This Patch adds the callback assignment and handlers for >>> powerpc_dcr_read >

[kvm-devel] [PATCH 2/2] qemu: Multi-profile DVD-ROM support

2008-01-14 Thread Carlo Marcelo Arenas Belon
This is version 2.2 of the original patch proposed to fix the MMC6 command for GET CONFIGURATION for multi profile CD/DVD support and that was originally committed as b64c20519d5826875679b6df85afebed27e1a9a8 cvs -q diff -up -r1.79 -r1.80 hw/ide.c Signed-off-by: Carlo Marcelo Arenas Belon <[EMAI

[kvm-devel] [PATCH 1/2] Revert "kvm: qemu: GET_CONFIGURATION fixes to allow OpenSolaris CD-ROM access"

2008-01-14 Thread Carlo Marcelo Arenas Belon
This reverts commit b64c20519d5826875679b6df85afebed27e1a9a8. Conflicts: qemu/hw/ide.c (keep uint64_t total_sectors) Signed-off-by: Carlo Marcelo Arenas Belon <[EMAIL PROTECTED]> --- qemu/hw/ide.c | 27 --- 1 files changed, 8 insertions(+), 19 deletions(-) dif

[kvm-devel] [PATCH 0/2] qemu: Multi-profile IDE DVD-ROM support

2008-01-14 Thread Carlo Marcelo Arenas Belon
This series replaces the current fix for the MMC6 GET CONFIGURATION emulation for the IDE CD-ROM with version 2.2 of the same fix which was committed in qemu. PATCH 1/2 : Revert "kvm: qemu: GET_CONFIGURATION fixes to allow OpenSolaris CD-ROM access" PATCH 2/2 : qemu: Multi-profile DVD-ROM supp