[kvm-devel] [PATCH 0/13] New shot at QEMUAccel

2008-05-15 Thread Glauber Costa
Hi guys, This is a new version of the QEMUAccel work. To start with, I decided to keep the name for now. We don't have that many functions that are not cpu-related to justify splitting the structure into many. Plus, this is one of the less confusing names we came up with. The code I'm posting is

[kvm-devel] [PATCH 03/13] [PATCH] introduce QEMUAccel and fill it with interrupt specific driver

2008-05-15 Thread Glauber Costa
This patch introduces QEMUAccel, a placeholder for function pointers that aims at helping qemu to abstract accelerators such as kqemu and kvm (actually, the 'accelerator' name was proposed by avi kivity, since he loves referring to kvm that way). To begin with, the accelerator is given the

[kvm-devel] [PATCH 02/13] [PATCH] split kqemu_init into two

2008-05-15 Thread Glauber Costa
we separate kqemu_init() into a part that depends on env, and other that does not. The later can be initialized earlier --- exec.c|3 +++ kqemu.c | 10 +++--- target-i386/helper2.c |2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git

[kvm-devel] [PATCH 01/13] [PATCH] make cpu_exec_init symmetric

2008-05-15 Thread Glauber Costa
we put all the code that needs to be executed only at cpu0 out of cpu_exec_init(), in exec_init(). It is executed before machine_init(), and only once. With this change, code cpu_exec_init() is completely symmetric. --- exec-all.h |1 + exec.c | 15 +-- vl.c |1 +

[kvm-devel] [PATCH 04/13] [PATCH] init env made accel driver

2008-05-15 Thread Glauber Costa
--- exec-all.h|8 +++- kqemu.c |1 + target-i386/helper2.c |4 +--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/exec-all.h b/exec-all.h index 7b2d97d..9e211dc 100644 --- a/exec-all.h +++ b/exec-all.h @@ -580,6 +580,7 @@ static inline

[kvm-devel] [PATCH 11/13] [PATCH] wrap modify_page through accel calls

2008-05-15 Thread Glauber Costa
--- exec-all.h |8 +++- exec.c | 24 +--- kqemu.c| 26 +++--- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/exec-all.h b/exec-all.h index ed96a22..04112e0 100644 --- a/exec-all.h +++ b/exec-all.h @@ -586,6 +586,7 @@

[kvm-devel] [PATCH 07/13] [PATCH] separate accelerator part of info profiler

2008-05-15 Thread Glauber Costa
--- exec-all.h |8 kqemu.c| 35 +++ monitor.c | 27 ++- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/exec-all.h b/exec-all.h index f1bd7ae..689973d 100644 --- a/exec-all.h +++ b/exec-all.h @@ -584,6

[kvm-devel] [PATCH 08/13] [PATCH] move kqemu externs to kqemu.h

2008-05-15 Thread Glauber Costa
--- cpu-all.h |5 - kqemu.h |6 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 7e77f76..5336a29 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -1053,14 +1053,9 @@ static inline int64_t profile_getclock(void) return

[kvm-devel] [PATCH 06/13] [PATCH] turn info kqemu into generic info accelerator

2008-05-15 Thread Glauber Costa
--- exec-all.h |8 kqemu.c| 24 monitor.c | 36 +--- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/exec-all.h b/exec-all.h index bfc6576..f1bd7ae 100644 --- a/exec-all.h +++ b/exec-all.h @@ -583,6

[kvm-devel] [PATCH 10/13] [PATCH] set_notdirty goes through accel wrapper

2008-05-15 Thread Glauber Costa
--- exec-all.h |8 +++- exec.c | 18 +++--- kqemu.c| 23 +++ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/exec-all.h b/exec-all.h index 689973d..ed96a22 100644 --- a/exec-all.h +++ b/exec-all.h @@ -585,6 +585,7 @@ typedef

[kvm-devel] [PATCH 12/13] [PATCH] remove kqemu reference from hw/pc.c

2008-05-15 Thread Glauber Costa
Instead, route cpu_get_ticks through accel driver. --- exec-all.h | 11 +++ hw/pc.c| 13 ++--- kqemu.c|4 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/exec-all.h b/exec-all.h index 04112e0..f62ff38 100644 --- a/exec-all.h +++ b/exec-all.h

[kvm-devel] [PATCH 13/13] [PATCH] build list of available accelerators

2008-05-15 Thread Glauber Costa
instead of hardcoding kqemu_start() in exec.c, which would require such a hack for all available accelerators, semantics of register_qemu_accel() is changed a little bit. It only builds a list of available accelerators. The last one registered is the first tried. This is a temporary solution,

[kvm-devel] [PATCH 09/13] [PATCH] move disabling code to kqemu.c instead of vl.c

2008-05-15 Thread Glauber Costa
this is for the case in which we run more than one cpu --- kqemu.c |3 ++- vl.c|4 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/kqemu.c b/kqemu.c index 6d46dfb..94366ec 100644 --- a/kqemu.c +++ b/kqemu.c @@ -164,6 +164,7 @@ static void

[kvm-devel] [PATCH 05/13] [PATCH] wrap cache flushing functions into accel drivers

2008-05-15 Thread Glauber Costa
--- exec-all.h | 16 ++-- exec.c | 12 ++-- kqemu.c| 15 +-- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/exec-all.h b/exec-all.h index 9e211dc..bfc6576 100644 --- a/exec-all.h +++ b/exec-all.h @@ -581,6 +581,8 @@ static inline

Re: [kvm-devel] [PATCH 0/4] paravirt clock patches

2008-05-09 Thread Glauber Costa
Marcelo Tosatti wrote: On Wed, May 07, 2008 at 08:45:12PM +0200, Gerd Hoffmann wrote: Ok folks, here is the band aid fix for testing from the odd bugs department. Goes on top of the four patches of this series. A real, clean solution is TBD. Tomorrow I hope (some urgent private problems

[kvm-devel] [PATCH] fixup 3dnow! support

2008-05-06 Thread Glauber Costa
qemu recently added support for 3dnow instructions. Because of that, 3dnow will be featured among cpuid bits. But this will break kvm in cpus that don't have those instructions (which includes my laptop). So we fixup our cpuid before exposing it to the guest. Signed-off-by: Glauber Costa [EMAIL

Re: [kvm-devel] [PATCH] fixup 3dnow! support

2008-05-06 Thread Glauber Costa
Alexander Graf wrote: On May 6, 2008, at 6:27 PM, Glauber Costa wrote: qemu recently added support for 3dnow instructions. Because of that, 3dnow will be featured among cpuid bits. But this will break kvm in cpus that don't have those instructions (which includes my laptop). So we fixup

[kvm-devel] [PATCH 0/4] Presenting accelerators for better abstraction

2008-05-02 Thread Glauber Costa
Hey guys, This was already discussed, mostly on kvm-devel (but qemu list always copied, if you remember), and here is the pre work I've done. I don't feel it to be mergeable yet, but with your comments, I expect to get it in a good shape soon. This is not extensibly tested (but it will).

[kvm-devel] [PATCH 4/4] [PATCH] wrap cache flushing functions into accel drivers

2008-05-02 Thread Glauber Costa
--- exec-all.h | 16 ++-- exec.c | 12 ++-- kqemu.c|2 ++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/exec-all.h b/exec-all.h index 784d0ac..9925a80 100644 --- a/exec-all.h +++ b/exec-all.h @@ -578,6 +578,8 @@ typedef struct QEMUAccel {

[kvm-devel] [PATCH 2/4] [PATCH] exec interrupt made abstract by accel_yyy()

2008-05-02 Thread Glauber Costa
--- cpu-exec.c | 29 ++--- exec-all.h | 10 ++ kqemu.c|3 +++ 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 3246264..79da619 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -35,6 +35,22 @@ #include

[kvm-devel] [PATCH 3/4] [PATCH] init env made accel driver

2008-05-02 Thread Glauber Costa
--- exec-all.h|8 +++- kqemu.c |1 + target-i386/helper2.c |4 +--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/exec-all.h b/exec-all.h index 621e1ca..784d0ac 100644 --- a/exec-all.h +++ b/exec-all.h @@ -577,6 +577,7 @@ static inline

[kvm-devel] [PATCH 1/4] [PATCH] introduce QEMUAccel and fill it with interrupt specific driver

2008-05-02 Thread Glauber Costa
-off-by: Glauber Costa [EMAIL PROTECTED] --- block-raw-posix.c |5 - exec-all.h| 18 +- exec.c|2 ++ kqemu.c | 26 -- vl.c |6 +- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git

Re: [kvm-devel] [Qemu-devel] [PATCH 1/4] [PATCH] introduce QEMUAccel and fill it with interrupt specific driver

2008-05-02 Thread Glauber Costa
Jamie Lokier wrote: Glauber Costa wrote: This patch introduces QEMUAccel, a placeholder for function pointers that aims at helping qemu to abstract accelerators such as kqemu and kvm (actually, the 'accelerator' name was proposed by avi kivity, since he loves referring to kvm that way

Re: [kvm-devel] [Qemu-devel] [PATCH 1/4] [PATCH] introduce QEMUAccel and fill it with interrupt specific driver

2008-05-02 Thread Glauber Costa
Paul Brook wrote: Maybe 'VCPU' would be a clearer name? QEMU provides its own VCPU, and KQEMU+QEMU also provide one toegether. While KVM provides essentially one or more whole VCPUs by itself and uses QEMU's drivers only doesn't it? -- Jamie VCPU is rather confusing with the vcpus

[kvm-devel] [PATCH] make setup_secondary_clock definition dependent on local apic

2008-04-30 Thread Glauber Costa
since the pv_apic_ops are only present if CONFIG_X86_LOCAL_APIC is compiled in, kvmclock failed to build without this option. This patch fixes this Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/kvmclock.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff

[kvm-devel] [PATCH] use common code for i386 and x86_64

2008-04-30 Thread Glauber Costa
There is no reason why should i386 and x86_64 code for rdtsc be different. Unify them. --- cpu-all.h | 11 +-- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 2a2b197..1c9e2a3 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -930,16 +930,7 @@ static

[kvm-devel] [PATCH] remove target ifdefs from vl.c

2008-04-29 Thread Glauber Costa
This patch goes towards the direction of increasing general modularity of the code. Code in vl.c that used to live inside target ifdefs, are moved to inside the target directories, in a new file called machine.c. They are the cpu save/load and machine registration --- Makefile.target|

[kvm-devel] [PATCH] [RFC] try to reduce kvm impact in core qemu code.

2008-04-29 Thread Glauber Costa
Hi. This is a proposal for reducing the impact of kvm functions in core qemu code. This is by all means not ready, but I felt like posting it, so a discussion on it could follow. The idea in this patch is to replace the specific kvm details from core qemu files like vl.c, with driver_yyy()

Re: [kvm-devel] [PATCH] [RFC] try to reduce kvm impact in core qemu code.

2008-04-29 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: Hi. This is a proposal for reducing the impact of kvm functions in core qemu code. This is by all means not ready, but I felt like posting it, so a discussion on it could follow. The idea in this patch is to replace the specific kvm details from

Re: [kvm-devel] [PATCH] [RFC] try to reduce kvm impact in core qemu code.

2008-04-29 Thread Glauber Costa
Anthony Liguori wrote: Glauber Costa wrote: Avi Kivity wrote: Glauber Costa wrote: Hi. This is a proposal for reducing the impact of kvm functions in core qemu code. This is by all means not ready, but I felt like posting it, so a discussion on it could follow. The idea

Re: [kvm-devel] pv clock: kvm is incompatible with xen :-(

2008-04-24 Thread Glauber Costa
Gerd Hoffmann wrote: Glauber Costa wrote: Gerd Hoffmann wrote: Jeremy Fitzhardinge wrote: Xen could change the parameters in the instant after get_time_values(). That change could be as a result of suspend-resume, so the parameters and the tsc could be wildly different. Ah, ok, forgot

Re: [kvm-devel] [PATCH 1/4] Add helper functions for paravirtual clocksources.

2008-04-24 Thread Glauber Costa
by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ads! ads! -- Glauber Costa. Free as in Freedom http://glommer.net The less

Re: [kvm-devel] [PATCH 4/4] kvm/guest: fix paravirt clocksource to be compartible with xen.

2008-04-24 Thread Glauber Costa
ts.tv_sec; } Here it is. Despite some needed cleanups, patches look beautiful to me. -- Glauber Costa. Free as in Freedom http://glommer.net The less confident you are, the more serious you have to act. - This SF.net email

Re: [kvm-devel] paravirt clock stil causing hangs in kvm-65

2008-04-24 Thread Glauber Costa
anyone that is able to reproduce this problem (a subgroup of human beings that does not include me) test it with them applied? If it still fails, please let me know asap -- Glauber Costa. Free as in Freedom http://glommer.net The less confident you are, the more serious you have to act

Re: [kvm-devel] [Qemu-devel] Re: [PATCH 0/3] Qemu crashes with pci passthrough

2008-04-24 Thread Glauber Costa
On Sat, Apr 19, 2008 at 6:11 PM, Glauber Costa [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 1:27 PM, Avi Kivity [EMAIL PROTECTED] wrote: Glauber de Oliveira Costa wrote: Hi, I've got some qemu crashes while trying to passthrough an ide device to a kvm guest. After some

[kvm-devel] [PATCH 0/10] Factorize code in translate.c

2008-04-24 Thread Glauber Costa
Hi, This series is an (initial) attempt to make qemu code a little bit more modular. In this patch series specifically, I'm removing some #ifdef TARGET_* from the general-purpose translate.c, and rather, replacing them with a common function implemented in architecture specific files. Any rants

[kvm-devel] [PATCH 02/10] arm: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-arm/translate.c |5 + translate-all.c|2 +- 2 files changed, 6 insertions(+), 1

[kvm-devel] [PATCH 01/10] i386: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- exec-all.h |3 +++ target-i386/translate.c | 23 +++ translate-all.c

[kvm-devel] [PATCH 03/10] sparc: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-sparc/translate.c | 20 translate-all.c | 18 +- 2

[kvm-devel] [PATCH 04/10] ppc: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-ppc/translate.c | 42 ++ translate-all.c| 40

[kvm-devel] [PATCH 05/10] m68k: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-m68k/translate.c |5 + translate-all.c |2 +- 2 files changed, 6 insertions(+), 1

[kvm-devel] [PATCH 06/10] mips: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-mips/translate.c |8 translate-all.c |4 +--- 2 files changed, 9

[kvm-devel] [PATCH 07/10] alpha: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-alpha/translate.c |5 + translate-all.c |2 +- 2 files changed, 6 insertions(+), 1

[kvm-devel] [PATCH 08/10] sh4: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-sh4/translate.c |7 +++ translate-all.c|3 +-- 2 files changed, 8 insertions(+), 2

[kvm-devel] [PATCH 09/10] cris: replace code inside ifdef with generic function

2008-04-24 Thread Glauber Costa
this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-cris/translate.c |6 ++ translate-all.c |2 +- 2 files changed, 7 insertions(+), 1

[kvm-devel] [PATCH 10/10] remove arch-specific ifdefs from translate-all.c

2008-04-24 Thread Glauber Costa
As the current state of matters, all architectures call a function with the same name and signature for updating the pc. Remove the ifdefs, leading to a cleaner code --- translate-all.c | 19 +-- 1 files changed, 1 insertions(+), 18 deletions(-) diff --git a/translate-all.c

Re: [kvm-devel] pv clock: kvm is incompatible with xen :-(

2008-04-22 Thread Glauber Costa
Gerd Hoffmann wrote: Jeremy Fitzhardinge wrote: Xen could change the parameters in the instant after get_time_values(). That change could be as a result of suspend-resume, so the parameters and the tsc could be wildly different. Ah, ok, forgot the rdtsc in the picture. With that in mind I

Re: [kvm-devel] paravirt clock stil causing hangs in kvm-65

2008-04-19 Thread Glauber Costa
and host), while I'm off ? -- Glauber Costa. Free as in Freedom http://glommer.net The less confident you are, the more serious you have to act. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss

Re: [kvm-devel] [Qemu-devel] Re: [PATCH 0/3] Qemu crashes with pci passthrough

2008-04-19 Thread Glauber Costa
at that. -- Glauber Costa. Free as in Freedom http://glommer.net The less confident you are, the more serious you have to act. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event

[kvm-devel] [PATCH] kvm: move kvmclock initialization inside kvm_guest_init

2008-04-16 Thread Glauber Costa
It makes no sense for the clock initialization to be hanging around in setup_32.c when we have a generic kvm guest initialization function available. So, we move kvmclock_init() inside such a function, leading to a cleaner code. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel

Re: [kvm-devel] [PATCH] use NR_IRQS for irq count

2008-04-09 Thread Glauber Costa
Amit Shah wrote: * On Tuesday 08 April 2008 22:34:36 Glauber Costa wrote: Instead of artificially limiting irq numbers, use arch provided NR_IRQS Signed-off-by: Glauber Costa [EMAIL PROTECTED] Thanks, applied. Going forward, we're going to use the in-kernel approach for interrupt

[kvm-devel] [PATCH 0/28] integrate dma_ops

2008-04-08 Thread Glauber Costa
Hi, This is the final integration of dma_ops between x86_64 and i386. The final code is closer to x86_64 than to i386, which is obviously expected. At the end, pci-dma_{32,64}.c are gone, pci-nommu_64.c is gone, and the temporary pci-base_32.c is gone too. This patchset received the same level

[kvm-devel] [PATCH 02/28] x86: delete empty functions from pci-nommu_64.c

2008-04-08 Thread Glauber Costa
This functions are now called conditionally on their existence in the struct. So just delete them, instead of keeping an empty implementation. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-nommu_64.c | 15 --- 1 files changed, 0 insertions(+), 15 deletions

[kvm-devel] [PATCH 01/28] x86: introduce pci-dma.c

2008-04-08 Thread Glauber Costa
This patch introduces pci-dma.c, a common file for pci dma between i386 and x86_64. As a start, dma_set_mask() is the same between architectures, and is placed there. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/Makefile |2 +- arch/x86/kernel/pci-dma.c| 14

[kvm-devel] [PATCH 03/28] x86: implement mapping_error in pci-nommu_64.c

2008-04-08 Thread Glauber Costa
inconditionally. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-nommu_64.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/pci-nommu_64.c b/arch/x86/kernel/pci-nommu_64.c index 90a7c40..a4e8ccf 100644 --- a/arch/x86/kernel/pci

[kvm-devel] [PATCH 05/28] x86: use sg_phys in x86_64

2008-04-08 Thread Glauber Costa
To make the code usable in i386, where we have high memory mappings, we drop te virt_to_bus(sg_virt()) construction in favour of sg_phys. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-nommu_64.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[kvm-devel] [PATCH 06/28] x86: use dma_length in i386

2008-04-08 Thread Glauber Costa
This is done to get the code closer to x86_64. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c |1 + include/asm-x86/scatterlist.h |2 -- 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/pci-base_32.c b/arch/x86/kernel/pci

[kvm-devel] [PATCH 14/28] x86: merge iommu initialization parameters

2008-04-08 Thread Glauber Costa
we merge the iommu initialization parameters in pci-dma.c Nice thing, that both architectures at least recognize the same parameters. usedac i386 parameter is marked for deprecation Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- Documentation/feature-removal-schedule.txt |7 +++ arch

[kvm-devel] [PATCH 12/28] x86: move x86_64-specific to common code.

2008-04-08 Thread Glauber Costa
This patch moves the bootmem functions, that are largely x86_64-specific into pci-dma.c. The code goes inside an ifdef. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma.c| 73 ++ arch/x86/kernel/pci-dma_64.c | 68

[kvm-devel] [PATCH 15/28] x86: move dma_coherent functions to pci-dma.c

2008-04-08 Thread Glauber Costa
They are placed in an ifdef, since they are i386 specific the structure definition goes to dma-mapping.h. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma.c | 81 +++ arch/x86/kernel/pci-dma_32.c | 85

[kvm-devel] [PATCH 16/28] x86: isolate coherent mapping functions

2008-04-08 Thread Glauber Costa
i386 implements the declare coherent memory API, and x86_64 does not it is reflected in pieces of dma_alloc_coherent and dma_free_coherent. Those pieces are isolated in separate functions, that are declared as empty macros in x86_64. This way we can make the code the same. Signed-off-by: Glauber

[kvm-devel] [PATCH 18/28] x86: move bad_dma_address

2008-04-08 Thread Glauber Costa
It goes to pci-dma.c, and is removed from the arch-specific files. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma.c|2 ++ arch/x86/kernel/pci-dma_32.c |4 arch/x86/kernel/pci-dma_64.c |2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff

[kvm-devel] [PATCH 21/28] x86: retry allocation if failed

2008-04-08 Thread Glauber Costa
This patch puts in the code to retry allocation in case it fails. By its own, it does not make much sense but making the code look like x86_64. But later patches in this series will make we try to allocate from zones other than DMA first, which will possibly fail. Signed-off-by: Glauber Costa

[kvm-devel] [PATCH 17/28] x86: adjust dma_free_coherent for i386

2008-04-08 Thread Glauber Costa
We call unmap_single, if available. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c index 78c7640..49166a4 100644 --- a/arch/x86

[kvm-devel] [PATCH 20/28] x86: use numa allocation function in i386

2008-04-08 Thread Glauber Costa
We can do it here to, in the same way x86_64 does. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c | 27 ++- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c index

[kvm-devel] [PATCH 23/28] x86: don't try to allocate from DMA zone at first

2008-04-08 Thread Glauber Costa
If we fail, we'll loop into the allocation again, and then allocate in the DMA zone. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci

[kvm-devel] [PATCH 22/28] x86: use a fallback dev for i386

2008-04-08 Thread Glauber Costa
We can use a fallback dev for cases of a NULL device being passed (mostly ISA) This comes from x86_64 implementation. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/x86

[kvm-devel] [PATCH 25/28] x86: remove kludge from x86_64

2008-04-08 Thread Glauber Costa
The claim is that i386 does it. Just it does not. So remove it. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_64.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index b956f59

[kvm-devel] [PATCH 26/28] x86: return conditional to mmu

2008-04-08 Thread Glauber Costa
Just return our allocation if we don't have an mmu. For i386, where this patch is being applied, we never have. So our goal is just to have the code to look like x86_64's. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c | 34

[kvm-devel] [PATCH 27/28] x86: don't do dma if mask is NULL.

2008-04-08 Thread Glauber Costa
if the device hasn't provided a mask, abort allocation. Note that we're using a fallback device now, so it does not cover the case of a NULL device: just drivers passing NULL masks around. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c |3 +++ 1 files changed

[kvm-devel] [PATCH 28/28] x86: integrate pci-dma.c

2008-04-08 Thread Glauber Costa
The code in pci-dma_{32,64}.c are now sufficiently close to each other. We merge them in pci-dma.c. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/Makefile |2 +- arch/x86/kernel/pci-dma.c| 175 ++ arch/x86/kernel/pci

[kvm-devel] [PATCH 10/28] x86: unify pci-nommu

2008-04-08 Thread Glauber Costa
merge pci-base_32.c and pci-nommu_64.c into pci-nommu.c Their code were made the same, so now they can be merged. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/Makefile |5 +- arch/x86/kernel/pci-base_32.c | 60 arch/x86/kernel/pci-dma.c

[kvm-devel] [PATCH 11/28] x86: move pci fixup to pci-dma.c

2008-04-08 Thread Glauber Costa
via_no_dac provides a fixup that is the same for both architectures. Move it to pci-dma.c. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma.c | 18 ++ arch/x86/kernel/pci-dma_32.c | 13 - arch/x86/kernel/pci-dma_64.c | 15

[kvm-devel] [PATCH 09/28] x86: move initialization functions to pci-dma.c

2008-04-08 Thread Glauber Costa
initcalls that triggers the various possibiities for dma subsys are moved to pci-dma.c. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma.c| 25 + arch/x86/kernel/pci-dma_64.c | 23 --- 2 files changed, 25 insertions

[kvm-devel] [PATCH 08/28] x86: move definition to pci-dma.c

2008-04-08 Thread Glauber Costa
Move dma_ops structure definition to pci-dma.c, where it belongs. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-base_32.c | 11 --- arch/x86/kernel/pci-dma.c |3 +++ arch/x86/mm/init_64.c |3 --- 3 files changed, 11 insertions(+), 6

[kvm-devel] [PATCH 04/28] x86: Add flush_write_buffers in nommu functions

2008-04-08 Thread Glauber Costa
This patch adds flush_write_buffers() in some functions of pci-nommu_64.c They are added anywhere i386 would also have it. This is not a problem for x86_64, since flush_rite_buffers() an nop for it. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-nommu_64.c |2 ++ 1

[kvm-devel] [PATCH 13/28] x86: merge dma_supported

2008-04-08 Thread Glauber Costa
The code for both arches are very similar, so this patch merge them. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma.c| 44 ++ arch/x86/kernel/pci-dma_32.c | 24 -- arch/x86/kernel/pci-dma_64.c | 44

[kvm-devel] [PATCH] use NR_IRQS for irq count

2008-04-08 Thread Glauber Costa
Instead of artificially limiting irq numbers, use arch provided NR_IRQS Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- irqhook/irqhook_main.c | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/irqhook/irqhook_main.c b/irqhook/irqhook_main.c index 5f414d1

[kvm-devel] [PATCH 24/28] x86: unify gfp masks

2008-04-08 Thread Glauber Costa
Use the same gfp masks for x86_64 and i386. It involves using HIGHMEM or DMA32 where necessary, for the sake of code compatibility, (no real effect), and using the NORETRY mask for i386. Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- arch/x86/kernel/pci-dma_32.c |6 -- arch/x86

Re: [kvm-devel] [Qemu-devel] [PATCH] ignore reads to the EOI register.

2008-03-28 Thread Glauber Costa
Aurelien Jarno wrote: On Wed, Mar 26, 2008 at 09:57:16PM -0300, Glauber Costa wrote: They seem legal in real hardware, even though the EOI is a write-only register. By legal I mean they are completely ignored, but at least, don't cause any bits to be set at ESR. Without this patch, some

Re: [kvm-devel] [PATCH 2/3] [PATCH] unregister pci device

2008-03-27 Thread Glauber Costa
Avi Kivity wrote: Glauber Costa wrote: If we fail after we have allocated the pci device, we have to get rid of it. Otherwise, a bogus device will be found on the bus Maybe, alter the order so the device is registered last thing. This may help avoid races with pci passthrough hotplug

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

2008-03-26 Thread Glauber Costa
Ingo Molnar wrote: * Ingo Molnar [EMAIL PROTECTED] wrote: what i came up is the prototype 32-bit fix below - this works on 32-bit but breaks 64-bit because we pass in physical addresses instead of virtual direct addresses. i'll fix the 64-bit side but that means materially touching all

[kvm-devel] [PATCH 0/3] fixups for pci passthrough

2008-03-26 Thread Glauber Costa
Amit, those fixups apply ontop of your kvm-userspace tree. They are general small fixups for the whole thing thanks - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just

[kvm-devel] [PATCH 2/3] [PATCH] unregister pci device

2008-03-26 Thread Glauber Costa
If we fail after we have allocated the pci device, we have to get rid of it. Otherwise, a bogus device will be found on the bus Signed-off-by: Glauber Costa [EMAIL PROTECTED] --- qemu/hw/passthrough/passthrough.c | 11 +++ qemu/hw/pci.c |6 ++ qemu/hw/pci.h

[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

  1   2   >