Re: [kvm-devel] [PATCH 1/2] kvmclock - the host part.

2008-02-13 Thread Glauber Costa
Avi Kivity wrote: Glauber de Oliveira Costa wrote: This is the host part of kvm clocksource implementation. As it does not include clockevents, it is a fairly simple implementation. We only have to register a per-vcpu area, and start writting to it periodically. The area is binary

[kvm-devel] [PATCH 0/15] Review: acpi processor hotplug

2008-02-22 Thread Glauber Costa
Hi, In this series, I'm sending the result-so-far of my work with acpi for processor hotplug. I'm able to put a cpu up and down (with the help of some udev scripts I wrote), but it still has some known bugs and issues. For x86_64 linux machines (because the kernel supports it), you can plug cpus

[kvm-devel] [PATCH 2/15] mark extra cpus as present

2008-02-22 Thread Glauber Costa
Mark cpus over smp_cpus as present, but disable. The OS can then recognize it and make room for future hotplug Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/rombios.h |2 ++ bios/rombios32.c | 21 + 2 files changed, 15 insertions(+), 8 deletions(-) diff

[kvm-devel] [PATCH 5/15] provide gpe _L0x methods

2008-02-22 Thread Glauber Costa
provide methods for gpe blk 0, even though they do nothing atm Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl

[kvm-devel] [PATCH 3/15] introduce cpu_set to qemu monitor

2008-02-22 Thread Glauber Costa
in this patch, cpu_set is introduced to qemu monitor semantics is : cpu_set x online|offline. it will then tell the acpi backend to signal cpu x. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c |3 +++ qemu/monitor.c | 16 qemu/sysemu.h |3 +++ 3

[kvm-devel] [PATCH 4/15] mark processors as presents

2008-02-22 Thread Glauber Costa
mark processors as present through the _STA method Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index e900795..cd42e23 100755 --- a/bios

[kvm-devel] [PATCH 6/15] provide operation region for pio to the gpes

2008-02-22 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index 7c954c3..d738b2f 100755 --- a/bios/acpi-dsdt.dsl +++ b/bios/acpi-dsdt.dsl @@ -27,6 +27,13

[kvm-devel] [PATCH 7/15] implement method _L00 for GPE0

2008-02-22 Thread Glauber Costa
This corresponds to the cpu hotplug functionality Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 114 1 files changed, 114 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index

[kvm-devel] [PATCH 9/15] initialize hot add system.

2008-02-22 Thread Glauber Costa
Register the pios, and grab cpu_model for future usage. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 35 +++ qemu/hw/pc.c |1 + 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index

[kvm-devel] [PATCH 8/15] isolate cpu initialization function in hw/pc.c

2008-02-22 Thread Glauber Costa
This patch wraps up the piece of code in hw/pc.c that actually allocates and initializates a cpu. After that, plan is to be able to start it later on. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/pc.c | 40 +++- qemu/hw/pc.h |1 + 2 files

[kvm-devel] [PATCH 10/15] handle gpe data for pio

2008-02-22 Thread Glauber Costa
actually grab and return data, instead of just being two bogus functions. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 36 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 02f6bab

[kvm-devel] [PATCH 11/15] manipulate the gpe bits and send sci up the os.

2008-02-22 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 42 ++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 60d3094..038e993 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw/acpi.c @@ -534,10

[kvm-devel] [PATCH 14/15] start a new cpu thread

2008-02-22 Thread Glauber Costa
spin up a new cpu thread if not yet running. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 038e993..93cbc68 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw

[kvm-devel] [PATCH 13/15] provide _MAT to acpi processor

2008-02-22 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 154 +++- 1 files changed, 140 insertions(+), 14 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index bdb591a..4ce7b6a 100755 --- a/bios/acpi-dsdt.dsl +++ b

[kvm-devel] [PATCH 15/15] provide _EJ0 method for processor removal

2008-02-22 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl| 14 ++ qemu/pc-bios/bios.bin | Bin 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index 4ce7b6a..33adfce 100755 --- a/bios/acpi-dsdt.dsl +++ b/bios

Re: [kvm-devel] [PATCH 4/15] mark processors as presents

2008-02-25 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: mark processors as present through the _STA method Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi

Re: [kvm-devel] [PATCH 4/15] mark processors as presents

2008-02-25 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: There is now code in rombios32.c to do this. It needs to be removed. See acpi_build_processor_ssdt(). Building the table by hand is trivial in the case where the processors are just _listed_, and can be easily justified. This first patch just add

[kvm-devel] [PATCH 0/15] acpi processor hotplug

2008-02-26 Thread Glauber Costa
Hi, I'm resending the series with avi's few comments merged, and a couple of others on my own: * _STA returns 0xF instead of 0x1. According to the specification, it means that the device, besides present, is also functional, enabled, and a couple of other cool things. * gpe_base and

[kvm-devel] [PATCH 2/15] mark extra cpus as present

2008-02-26 Thread Glauber Costa
Mark cpus over smp_cpus as present, but disable. The OS can then recognize it and make room for future hotplug Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/rombios.h |2 ++ bios/rombios32.c | 21 + 2 files changed, 15 insertions(+), 8 deletions(-) diff

[kvm-devel] [PATCH 1/15] Make a GPE register block be acessible.

2008-02-26 Thread Glauber Costa
gpe is acessible when its address listed by BIOS is !0. This patch makes gpe blk 0 available, and 4 bytes in length Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/rombios32.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c

[kvm-devel] [PATCH 4/15] mark processors as presents

2008-02-26 Thread Glauber Costa
mark processors as present through the _STA method Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index e900795..244e906 100755 --- a/bios

[kvm-devel] [PATCH 3/15] introduce cpu_set to qemu monitor

2008-02-26 Thread Glauber Costa
in this patch, cpu_set is introduced to qemu monitor semantics is : cpu_set x online|offline. it will then tell the acpi backend to signal cpu x. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c |4 qemu/monitor.c | 16 qemu/sysemu.h |3 +++ 3

[kvm-devel] [PATCH 6/15] provide operation region for pio to the gpes

2008-02-26 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index 392d402..1dba157 100755 --- a/bios/acpi-dsdt.dsl +++ b/bios/acpi-dsdt.dsl @@ -27,6 +27,13

[kvm-devel] [PATCH 5/15] provide gpe _L0x methods

2008-02-26 Thread Glauber Costa
provide methods for gpe blk 0, even though they do nothing atm Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl

[kvm-devel] [PATCH 8/15] isolate cpu initialization function in hw/pc.c

2008-02-26 Thread Glauber Costa
This patch wraps up the piece of code in hw/pc.c that actually allocates and initializates a cpu. After that, plan is to be able to start it later on. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/pc.c | 40 +++- qemu/hw/pc.h |1 + 2 files

[kvm-devel] [PATCH 7/15] implement method _L00 for GPE0

2008-02-26 Thread Glauber Costa
This corresponds to the cpu hotplug functionality Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 114 1 files changed, 114 insertions(+), 0 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index

[kvm-devel] [PATCH 9/15] initialize hot add system.

2008-02-26 Thread Glauber Costa
Register the pios, and grab cpu_model for future usage. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 34 ++ qemu/hw/pc.c |1 + qemu/sysemu.h |1 + 3 files changed, 36 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b

[kvm-devel] [PATCH 11/15] manipulate the gpe bits and send sci up the os.

2008-02-26 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 42 ++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 7340f15..5a6d1a8 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw/acpi.c @@ -534,10

[kvm-devel] [PATCH 12/15] isolate cpu thread creation in qemu-kvm.c

2008-02-26 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/qemu-kvm.c |9 +++-- qemu/qemu-kvm.h |1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index ffc59d5..59fe9df 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -351,6

[kvm-devel] [PATCH 13/15] provide _MAT to acpi processor

2008-02-26 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/acpi-dsdt.dsl | 154 +++- 1 files changed, 140 insertions(+), 14 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index 194a051..7dffb6d 100755 --- a/bios/acpi-dsdt.dsl +++ b

[kvm-devel] [PATCH 14/15] start a new cpu thread

2008-02-26 Thread Glauber Costa
spin up a new cpu thread if not yet running. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 5a6d1a8..e44c8b5 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw

[kvm-devel] [PATCH 10/15] handle gpe data for pio

2008-02-26 Thread Glauber Costa
actually grab and return data, instead of just being two bogus functions. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/acpi.c | 36 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 119b59a

[kvm-devel] [PATCH 15/15] remove acpi_build_processor_ssdt

2008-02-26 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- bios/rombios32.c | 55 -- 1 files changed, 0 insertions(+), 55 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c index f2db740..77e71ac 100755 --- a/bios/rombios32.c +++ b/bios

[kvm-devel] use smp_cpus as lapic id

2008-03-03 Thread Glauber Costa
in the MP APIC tables. Signed-off-by: Glauber Costa [EMAIL PROTECTED] diff --git a/bios/rombios32.c b/bios/rombios32.c index 77e71ac..af18390 100755 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -983,7 +983,7 @@ #endif putstr(q, ISA ); /* ioapic */ -ioapic_id = MAX_CPUS

Re: [kvm-devel] Stop the clock!

2008-03-04 Thread Glauber Costa
Avi Kivity wrote: With paravirt clocksource, reboot and kexec are broken: the clock keeps updating after the reboot, and the new kernel will have a random memory location trampled occasionally. So we need to stop the clock on kexec (in the guest) and reboot (in the host). On the host

[kvm-devel] [PATCH 8/8] provide -cpu-map option

2008-03-04 Thread Glauber Costa
this patch introduces a -cpu-map option. It has the form C:x,y,z..., and have the effect of setting the affinity mask of vcpu C to processors x,y,z... Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/vl.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git

[kvm-devel] [PATCH 3/8] get thread id at thread's creation

2008-03-04 Thread Glauber Costa
store the thread id through our new call as soon as the process is created. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/qemu-kvm.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 8ee3bf8..1aeb97b 100644 --- a/qemu/qemu

[kvm-devel] [PATCH 5/8] initialize affinities

2008-03-04 Thread Glauber Costa
store default process affinities before we get the chance to process any options Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/vl.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/qemu/vl.c b/qemu/vl.c index f10fbd8..6a94724 100644 --- a/qemu/vl.c +++ b/qemu

[kvm-devel] [PATCH 1/8] add thread id to vcpu structure

2008-03-04 Thread Glauber Costa
This allow us to track which thread is currently running the cpu Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/qemu-kvm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 051946e..43e0f2e 100644 --- a/qemu/qemu-kvm.c +++ b

[kvm-devel] [PATCH 0/8] RFC: vcpu pinning at qemu start

2008-03-04 Thread Glauber Costa
Hi guys, Here's a first series of patch aiming at vcpu pinning support in qemu. Ideally, as vcpu as just normal threads, the usual userspace tools can be used to set cpu affinities mask. However, It makes it very difficult to _start_ a vm with vcpus pinned, since we don't know the thread ids

[kvm-devel] [PATCH 2/8] provide a gettid function

2008-03-04 Thread Glauber Costa
Since glibc does not provide a gettid call directly, only through syscall, we wrap one for kvm Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/qemu-kvm.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 43e0f2e..8ee3bf8

[kvm-devel] [PATCH 4/8] store and set cpu affinities

2008-03-04 Thread Glauber Costa
This patch provides a cpu_set variable to vcpu_info structure. It stores the current cpu mask for a thread. We also provide a wrapper for storing a provided affinity, and a function to set default affinities: The default affinities are current process' Signed-off-by: Glauber Costa [EMAIL

[kvm-devel] [PATCH 6/8] stabilish default affinity for newly created cpus

2008-03-04 Thread Glauber Costa
Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/qemu-kvm.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index a36fbf6..80fe8e5 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -68,6 +68,12 @@ void

Re: [kvm-devel] [PATCH 0/8] RFC: vcpu pinning at qemu start

2008-03-04 Thread Glauber Costa
Anthony Liguori wrote: Glauber Costa wrote: Hi guys, Here's a first series of patch aiming at vcpu pinning support in qemu. Ideally, as vcpu as just normal threads, the usual userspace tools can be used to set cpu affinities mask. However, It makes it very difficult to _start_ a vm

Re: [kvm-devel] [PATCH 0/8] RFC: vcpu pinning at qemu start

2008-03-04 Thread Glauber Costa
Joerg Roedel wrote: On Tue, Mar 04, 2008 at 01:21:53PM -0300, Glauber Costa wrote: Hi guys, Here's a first series of patch aiming at vcpu pinning support in qemu. Ideally, as vcpu as just normal threads, the usual userspace tools can be used to set cpu affinities mask. However, It makes

Re: [kvm-devel] [PATCH 0/8] RFC: vcpu pinning at qemu start

2008-03-04 Thread Glauber Costa
Daniel P. Berrange wrote: On Tue, Mar 04, 2008 at 01:28:24PM -0600, Anthony Liguori wrote: Glauber Costa wrote: My main interest is in management tools being able to specify pinning set ups at VM creation time. As I said, it can be done through tools like taskset, but then you'd have

Re: [kvm-devel] [PATCH 0/8] RFC: vcpu pinning at qemu start

2008-03-04 Thread Glauber Costa
Anthony Liguori wrote: Glauber Costa wrote: My main interest is in management tools being able to specify pinning set ups at VM creation time. As I said, it can be done through tools like taskset, but then you'd have to know: * when are the threads created * which thread ids corresponds

Re: [kvm-devel] [PATCH 0/8] RFC: vcpu pinning at qemu start

2008-03-05 Thread Glauber Costa
Anthony Liguori wrote: Glauber Costa wrote: Anthony Liguori wrote: No, it can't. Because at the time qemu starts, no vcpu - thread id relationship exists at all. And we don't know when it will. Sure we do. The vcpu - thread id relationship is valid after kvm_init_ap() is called which

Re: [kvm-devel] [PATCH 0/8] RFC: vcpu pinning at qemu start

2008-03-05 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: Hi guys, Here's a first series of patch aiming at vcpu pinning support in qemu. Ideally, as vcpu as just normal threads, the usual userspace tools can be used to set cpu affinities mask. However, It makes it very difficult to _start_ a vm with vcpus

[kvm-devel] [PATCH 0/4] kvmclock fixes

2008-03-05 Thread Glauber Costa
Hi, With this series, I'm introducing the ability to turn off the kvmclock. It is done by writting any thing to the first three bits of the address passed as a parameter to the msr. For that to work properly, we should make absolutely sure the guest is aligned. If we really care about

[kvm-devel] [PATCH 1/4] [PATCH] kvmclock: release time_page if msr is rewritten

2008-03-05 Thread Glauber Costa
If the calling cpu rewrites the system clock msr for any reason, release the page we allocated in the last time Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kvm/x86.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

[kvm-devel] [PATCH 2/4] [PATCH] cacheline-align kvmclock structures

2008-03-05 Thread Glauber Costa
Align the kvm_vcpu_time array to the size of a cacheline. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/kvmclock.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index b8da3bf..d82406a 100644

[kvm-devel] [PATCH 3/4] [PATCH] kvmclock: allow it to be turned off

2008-03-05 Thread Glauber Costa
Use the lower 3 lower bits of the system time msr to turn off the clock. This means that all clock registration has to be aligned in a 4-byte boundary Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kvm/x86.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git

[kvm-devel] [PATCH 4/4] [PATCH] cleanup leftovers

2008-03-05 Thread Glauber Costa
clean this leftover in kvmclock.c Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/kvmclock.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index d82406a..8ff12b6 100644 --- a/arch/x86/kernel

[kvm-devel] [PATCH 0/3] Expose thread id through info cpus

2008-03-05 Thread Glauber Costa
Hey, This patch series expose the actual thread id of each cpu via the qemu monitor. It is done through info cpus, which I though would be the most natural command to do it. (If you disagree, please voice it) Goal is to allow tools like libvirt to easily grab it and feed taskset for thinks like

[kvm-devel] [PATCH] use a thread id variable

2008-03-05 Thread Glauber Costa
This patch introduces a thread_id variable to CPUState. It's duty will be to hold the process, or more generally, thread id of the current executing cpu Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/cpu-defs.h |1 + qemu/exec.c |5 + 2 files changed, 6 insertions(+), 0

[kvm-devel] [PATCH] augment info cpus

2008-03-05 Thread Glauber Costa
This patch exposes the thread id associated with each cpu through the already well known info cpus interface. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/monitor.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/monitor.c b/qemu/monitor.c index 0874671

Re: [kvm-devel] [PATCH 3/4] [PATCH] kvmclock: allow it to be turned off

2008-03-06 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: Use the lower 3 lower bits of the system time msr to turn off the clock. This means that all clock registration has to be aligned in a 4-byte boundary 3 bits - 8 bytes. dohh!! true /me ashamed. How about just using just bit 0 as an enable bit

[kvm-devel] [PATCH 2/2] [PATCH] disable kvm clock unless addr's LSB is set.

2008-03-06 Thread Glauber Costa
Use LSB of the address passed through the msr to enable/disable the clock. Setting it to 1 enables it, setting it to 0 disables it. As the guest data structures are aligned anyway, this won't be a problem, as this bit is free. Guest is changed accordingly Signed-off-by: Glauber Costa [EMAIL

[kvm-devel] [PATCH 0/2] provide disable clock functionality.

2008-03-06 Thread Glauber Costa
Avi, Hope this is better - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/

[kvm-devel] [PATCH 1/2] [PATCH] use per cpu variables instead of a vector

2008-03-06 Thread Glauber Costa
replace hv_clock vector in kvmclock with a percpu variable that is cacheline aligned. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/kvmclock.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel

[kvm-devel] [PATCH] disable clock before rebooting.

2008-03-06 Thread Glauber Costa
This patch writes 0 (actually, what really matters is that the LSB is cleared) to the system time msr before rebooting/shutting down the machine. Without it, we can have a random memory location being written when the guest comes back Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86

Re: [kvm-devel] [PATCH] disable clock before rebooting.

2008-03-07 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: This patch writes 0 (actually, what really matters is that the LSB is cleared) to the system time msr before rebooting/shutting down the machine. Without it, we can have a random memory location being written when the guest comes back

[kvm-devel] [PATCH 1/2] [PATCH] allow machine_crash_shutdown to be replaced

2008-03-07 Thread Glauber Costa
This patch a llows machine_crash_shutdown to be replaced, just like any of the other functions in machine_ops Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/crash.c |3 ++- arch/x86/kernel/reboot.c |7 ++- include/asm-x86/reboot.h |1 + 3 files changed, 9

[kvm-devel] [PATCH 0/2] prevent memory corruption across reboots

2008-03-07 Thread Glauber Costa
Avi, I tracked down the kexec paths that requires overloading of machine_ops to two. So here's a simpler version, that'll probably be a best fit. thanks - This SF.net email is sponsored by: Microsoft Defy all challenges.

[kvm-devel] [PATCH 2/2] [PATCH] disable clock before rebooting.

2008-03-07 Thread Glauber Costa
of kernel_kexec() (sys.c) and crash_shutdown, used in the path of crash_kexec() (kexec.c) Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/kvmclock.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86

Re: [kvm-devel] [PATCH] disable clock before rebooting.

2008-03-07 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: as for kexec, it uses precisely the shutdown function, doesn't it? Or is it crash_shutdown? Humm, /me looks, and I think it's the later, right? Only on crash-triggered kexecs. It can also happen via sys_reboot(). Which, it appears, goes through

Re: [kvm-devel] [PATCH 1/2] [PATCH] allow machine_crash_shutdown to be replaced

2008-03-07 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: This patch a llows machine_crash_shutdown to be replaced, just like any of the other functions in machine_ops er, against what tree is this? doesn't apply to kvm.git. It'd be kvm.git with the machine_ops non-static functions patch. However

Re: [kvm-devel] [Qemu-devel] [PATCH] use a thread id variable

2008-03-17 Thread Glauber Costa
On Sun, Mar 9, 2008 at 11:52 AM, Gilad Ben-Yossef [EMAIL PROTECTED] wrote: Jamie Lokier wrote: Gilad Ben-Yossef wrote: Glauber Costa wrote: This patch introduces a thread_id variable to CPUState. It's duty will be to hold the process, or more generally, thread id of the current

[kvm-devel] [PATCH 3/3] disable clock before rebooting.

2008-03-17 Thread Glauber Costa
of kernel_kexec() (sys.c) and crash_shutdown, used in the path of crash_kexec() (kexec.c) Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/kvmclock.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86

[kvm-devel] [PATCH 0/3] kvmclock: shutdown clock before reboot

2008-03-17 Thread Glauber Costa
Avi, This series now apply ontop of kvm.git. Only the needed function from machine_ops is made non-static. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.

[kvm-devel] [PATCH 1/3] allow machine_crash_shutdown to be replaced

2008-03-17 Thread Glauber Costa
This patch a llows machine_crash_shutdown to be replaced, just like any of the other functions in machine_ops Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/crash.c |3 ++- arch/x86/kernel/reboot.c |7 ++- include/asm-x86/reboot.h |1 + 3 files changed, 9

[kvm-devel] [PATCH 2/3] make native_machine_shutdown non-static

2008-03-17 Thread Glauber Costa
it will allow external users to call it. It is mainly useful for routines that will override its machine_ops field for its own special purposes, but want to call the normal shutdown routine after they're done Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/reboot.c |2

[kvm-devel] [PATCH] use slots_lock to protect writes to the wall clock

2008-03-17 Thread Glauber Costa
As Marcelo pointed out, we need slots_lock to protect against slots changing under our nose during wall clock writing. This patch address this issue. Signed-off-by: Glauber Costa [EMAIL PROTECTED] CC: Marcelo Tosatti [EMAIL PROTECTED] --- arch/x86/kvm/x86.c | 10 ++ 1 files changed, 6

Re: [kvm-devel] [PATCH] use slots_lock to protect writes to the wall clock

2008-03-18 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: This lock is fairly annoying. What do you think about taking it in vcpu_run unconditionally and only dropping it while in guest mode? Most exits are mmu (or with npt, mmio) so they need to take it anyway. Can't see the point. This is taken before

Re: [kvm-devel] [PATCH] use slots_lock to protect writes to the wall clock

2008-03-18 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: As Marcelo pointed out, we need slots_lock to protect against slots changing under our nose during wall clock writing. This patch address this issue. Applied, thanks. This lock is fairly annoying. What do you think about taking

[kvm-devel] [PATCH 0/3 - resend] kvmclock reboot

2008-03-18 Thread Glauber Costa
Avi, Hope this series is okay now. Thanks for the testing - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/

[kvm-devel] [PATCH 2/3] [PATCH] make native_machine_shutdown non-static

2008-03-18 Thread Glauber Costa
it will allow external users to call it. It is mainly useful for routines that will override its machine_ops field for its own special purposes, but want to call the normal shutdown routine after they're done Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/reboot.c |2

[kvm-devel] [PATCH 3/3] [PATCH] disable clock before rebooting.

2008-03-18 Thread Glauber Costa
of kernel_kexec() (sys.c) and crash_shutdown, used in the path of crash_kexec() (kexec.c) Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/kvmclock.c | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86

Re: [kvm-devel] [PATCH 0/3 - resend] kvmclock reboot

2008-03-18 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: Avi, Hope this series is okay now. Thanks for the testing Applied, thanks. [Once a patchset has been applied and pushed (as seen on kvm-commits), I prefer incremental patches] But I think this is a very good case of an exception, since

Re: [kvm-devel] [PATCH 0/3 - resend] kvmclock reboot

2008-03-18 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: [Once a patchset has been applied and pushed (as seen on kvm-commits), I prefer incremental patches] But I think this is a very good case of an exception, since the applied patches would break bisect. I prefer to hear damn glommer! because

[kvm-devel] [PATCH 0/20] dma_ops for i386

2008-03-25 Thread Glauber Costa
Hello, Here there is a series of 20 patches that lays the foundations for using dma_ops in i386 in the very same way x86_64, as well as many other architectures already do. The functions themselves for i386 are placed in a pci-base_32.c, but just a few among them are actually implemented. Most

[kvm-devel] [PATCH 01/20] x86: move dma_ops struct definition to dma-mapping.h

2008-03-25 Thread Glauber Costa
take it off the x86_64 specific header Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- include/asm-x86/dma-mapping.h| 54 ++ include/asm-x86/dma-mapping_64.h | 49 -- 2 files changed, 54 insertions(+), 49 deletions

[kvm-devel] [PATCH 04/20] x86: move dma_map_sg to common header

2008-03-25 Thread Glauber Costa
the old i386 implementation is moved to pci-base_32.c Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c| 19 +++ include/asm-x86/dma-mapping.h|8 +++- include/asm-x86/dma-mapping_32.h | 20 include/asm-x86

[kvm-devel] [PATCH 03/20] x86: move dma_unmap_single to common header

2008-03-25 Thread Glauber Costa
i386 base does not need it, so it gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h| 10 ++ include/asm-x86/dma-mapping_32.h |7 --- include/asm-x86/dma-mapping_64.h |8

[kvm-devel] [PATCH 06/20] x86: move dma_sync_single_for_cpu to common header

2008-03-25 Thread Glauber Costa
i386 gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h| 12 include/asm-x86/dma-mapping_32.h |6 -- include/asm-x86/dma-mapping_64.h | 11 --- 4 files changed, 13

[kvm-devel] [PATCH 02/20] x86: implement dma_map_single through dma_ops

2008-03-25 Thread Glauber Costa
That's already the name of the game for x86_64. For i386, we add a pci-base_32.c, that will hold the default operations. The function call itself goes through dma-mapping.h , the common header Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/Makefile |1 + arch/x86

[kvm-devel] [PATCH 07/20] x86: move dma_sync_single_for_device to common header

2008-03-25 Thread Glauber Costa
i386 gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h| 11 +++ include/asm-x86/dma-mapping_32.h |7 --- include/asm-x86/dma-mapping_64.h | 11 --- 4 files changed, 12

[kvm-devel] [PATCH 05/20] x86: move dma_unmap_sg to common header

2008-03-25 Thread Glauber Costa
i386 gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h|9 + include/asm-x86/dma-mapping_32.h |8 include/asm-x86/dma-mapping_64.h |8 4 files changed, 10

[kvm-devel] [PATCH 09/20] x86: move dma_sync_single_range_for_device to common header

2008-03-25 Thread Glauber Costa
i386 gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h| 14 ++ include/asm-x86/dma-mapping_32.h |8 include/asm-x86/dma-mapping_64.h | 12 4 files

[kvm-devel] [PATCH 11/20] x86: move dma_sync_sg_for_device to common header

2008-03-25 Thread Glauber Costa
i386 gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h| 11 +++ include/asm-x86/dma-mapping_32.h |7 --- include/asm-x86/dma-mapping_64.h | 12 4 files changed

[kvm-devel] [PATCH 10/20] x86: move dma_sync_sg_for_cpu to common header

2008-03-25 Thread Glauber Costa
i386 gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h|9 + include/asm-x86/dma-mapping_32.h |6 -- include/asm-x86/dma-mapping_64.h | 11 --- 4 files changed, 10

[kvm-devel] [PATCH 12/20] x86: move alloc and free coherent to common header

2008-03-25 Thread Glauber Costa
they are the same between architectures (except for the fact that x86_64 has duplicate code) move them to dma-mapping.h Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- include/asm-x86/dma-mapping.h| 10 ++ include/asm-x86/dma-mapping_32.h |9 - include/asm-x86/dma

[kvm-devel] [PATCH 16/20] x86: align to clflush size

2008-03-25 Thread Glauber Costa
Do it instead of using the conservative approach we're currently doing. This is the way x86_64 does, and this patch makes this piece of code the same between them, ready to be integrated Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- include/asm-x86/dma-mapping_32.h |2 +- 1 files

[kvm-devel] [PATCH 08/20] x86: move dma_sync_single_range_for_cpu to common header

2008-03-25 Thread Glauber Costa
i386 gets an empty function Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|1 + include/asm-x86/dma-mapping.h| 11 +++ include/asm-x86/dma-mapping_32.h |7 --- include/asm-x86/dma-mapping_64.h | 12 4 files changed

[kvm-devel] [PATCH 20/20] x86: delete the arch-specific dma-mapping headers.

2008-03-25 Thread Glauber Costa
all the code that is left is ready to be merged as-is in dma-mapping.h Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- include/asm-x86/dma-mapping.h| 19 +-- include/asm-x86/dma-mapping_32.h | 23 --- include/asm-x86/dma-mapping_64.h | 17

[kvm-devel] [PATCH 14/20] x86: move dma_cache_sync to common header

2008-03-25 Thread Glauber Costa
they are the same in both architectures. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- include/asm-x86/dma-mapping.h|6 ++ include/asm-x86/dma-mapping_32.h |7 --- include/asm-x86/dma-mapping_64.h |7 --- 3 files changed, 6 insertions(+), 14 deletions(-) diff

[kvm-devel] [PATCH 13/20] x86: move dma_map_page and dma_unmap_page to common header

2008-03-25 Thread Glauber Costa
They are similar enough to do this move. the macro version is ugly, and we use inline functions instead Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- include/asm-x86/dma-mapping.h| 14 ++ include/asm-x86/dma-mapping_32.h | 15 --- include/asm-x86/dma

[kvm-devel] [PATCH 15/20] x86: move dma_supported and dma_set_mask to pci-dma_32.c

2008-03-25 Thread Glauber Costa
This is the way x86_64 does, so this make them equal. They have to be extern now in the header, and the extern definition is moved to the common dma-mapping.h header Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c | 33

[kvm-devel] [PATCH 18/20] x86: unify dma_mapping_error

2008-03-25 Thread Glauber Costa
We provide a map_error function in pci-base_32.c to make sure i386 keeps with the same behaviour it used to. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c|7 +++ include/asm-x86/dma-mapping.h|8 include/asm-x86/dma-mapping_32.h

  1   2   >