Re: [Xen-devel] Re: Next steps with pv_ops for Xen

2007-12-04 Thread Mark Williamson
> I am not quite clear about the purpose of pv-ops , what do we want to > deal with by developping "pv-ops"? is it used for HVM or for PV or KVM > or something ? I have seen it for a few months in the list ,and > "pv-ops"is an active project ,but i am not clear about what is the aim > of "pv-ops" ,

Re: [PATCH 4/8] unify paravirt parts of system.h

2007-12-04 Thread Denys Vlasenko
On Tuesday 04 December 2007 11:41, Glauber de Oliveira Costa wrote: > On Dec 4, 2007 5:18 PM, Avi Kivity <[EMAIL PROTECTED]> wrote: > > There is no cr8 register on i386. This had better be protected by an > > #ifdef. > > Sure. I mentioned it in the changelog. I, however, am not sure If I > agree i

Re: [PATCH 4/8] unify paravirt parts of system.h

2007-12-04 Thread Andi Kleen
On Tue, Dec 04, 2007 at 09:18:33PM +0200, Avi Kivity wrote: > Glauber de Oliveira Costa wrote: >> This patch moves the i386 control registers manipulation functions, >> wbinvd, and clts functions to system.h. They are essentially the same >> as in x86_64, except for the cr8 register, which we add.

Re: [PATCH 3/10] allow sched clock to be overridden by paravirt

2007-12-04 Thread Andi Kleen
On Tue, Dec 04, 2007 at 09:09:57AM -0200, Glauber de Oliveira Costa wrote: > This patch turns the sched_clock into native_sched_clock. > sched clock becomes a weak symbol, which can then give its > place to a paravirt definition. I ended up regretting that solution on i386, it would be better to s

Re: [PATCH 0/10 - V2] msr.h integration - fixups

2007-12-04 Thread Ingo Molnar
* Glauber de Oliveira Costa <[EMAIL PROTECTED]> wrote: > There's really nothing new here. > > No changes at all, just fixing errors raised by checkpatch, at ingo's > request. thanks, i picked them up. Ingo ___ Virtualization mailing list Vir

Re: [Xen-devel] Re: Next steps with pv_ops for Xen

2007-12-04 Thread Gerd Hoffmann
Stephen C. Tweedie wrote: > Hi, > > On Tue, 2007-12-04 at 13:01 +0100, Gerd Hoffmann wrote: > Who uses the gntdev device right now? >>> Good question! I'm aware of it being used in a few research projects, >>> and it seems to work for them (though I think it is mostly used with the >>> linux

Re: [PATCH 4/8] unify paravirt parts of system.h

2007-12-04 Thread Glauber de Oliveira Costa
On Dec 4, 2007 5:18 PM, Avi Kivity <[EMAIL PROTECTED]> wrote: > Glauber de Oliveira Costa wrote: > > This patch moves the i386 control registers manipulation functions, > > wbinvd, and clts functions to system.h. They are essentially the same > > as in x86_64, except for the cr8 register, which we

Re: [PATCH 4/8] unify paravirt parts of system.h

2007-12-04 Thread Avi Kivity
Glauber de Oliveira Costa wrote: This patch moves the i386 control registers manipulation functions, wbinvd, and clts functions to system.h. They are essentially the same as in x86_64, except for the cr8 register, which we add. + +static inline unsigned long native_read_cr8(void) +{ + unsi

[PATCH 8/10] change write msr functions interface

2007-12-04 Thread Glauber de Oliveira Costa
This patche changes the native_write_msr() and friends interface to explicitly take 2 32-bit registers instead of a 64-bit value. The change will ease the merge with 64-bit code. As the 64-bit value will be passed as two registers anyway in i386, the PVOP_CALL interface has to account for that and

[PATCH 7/8] move switch_to macro to system.h

2007-12-04 Thread Glauber de Oliveira Costa
This patch moves the switch_to() macro to system.h As those macros are fundamentally different between i386 and x86_64, they are enclosed around an ifdef. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/system.h| 61 +

[PATCH 5/8] remove unused macro

2007-12-04 Thread Glauber de Oliveira Costa
Mr. Grep says warn_if_not_ulong() is not used anymore anywhere in the code. So, we remove it. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/system_64.h |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/include/asm-x86/system_64.h b/includ

[PATCH 8/8] unify system.h

2007-12-04 Thread Glauber de Oliveira Costa
This patch finishes the unification of system.h file. i386 needs a constant to be defined, and it is defined inside an ifdef Other than that, pretty much nothing but includes are left in the arch specific headers, and they are deleted. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]>

[PATCH 6/8] unify smp parts of system.h

2007-12-04 Thread Glauber de Oliveira Costa
The memory barrier parts of system.h are not very different between i386 and x86_64, the main difference being the availability of instructions, which we handle with the use of ifdefs. They are consolidated in system.h file, and then removed from the arch-specific headers. Signed-off-by: Glauber

[PATCH 1/8] remove volatile keyword from clflush.

2007-12-04 Thread Glauber de Oliveira Costa
the p parameter is an explicit memory reference, and is enough to prevent gcc to being nasty here. The volatile seems completely not needed. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/system_32.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) di

[PATCH 4/8] unify paravirt parts of system.h

2007-12-04 Thread Glauber de Oliveira Costa
This patch moves the i386 control registers manipulation functions, wbinvd, and clts functions to system.h. They are essentially the same as in x86_64, except for the cr8 register, which we add. With this, system.h paravirt comes for free in x86_64. Signed-off-by: Glauber de Oliveira Costa <[EMAI

[PATCH 2/8] put together equal pieces of system.h

2007-12-04 Thread Glauber de Oliveira Costa
This patch puts together pieces of system_{32,64}.h that looks like the same. It's the first step towards integration of this file. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- arch/x86/kernel/process_64.c |2 +- include/asm-x86/system.h | 70

[PATCH 3/8] unify load_segment macro

2007-12-04 Thread Glauber de Oliveira Costa
This patch unifies the load_segment() macro, making them equal in both x86_64 and i386 architectures. The common version goes to system.h, and the old are deleted. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/system.h| 21 + include/as

[PATCH 9/10] make fixups wordsize agnostic

2007-12-04 Thread Glauber de Oliveira Costa
This patch uses the _ASM_ALIGN and _ASM_PTR macros to make the fixups in native_read/write_msr_safe look the same for x86_64 and i386. Besides using this macros, we also have to take the explicit instruction suffixes out. It's okay because all this instructions uses registers, and can be sized by t

[PATCH 7/10] change rdpmc interface

2007-12-04 Thread Glauber de Oliveira Costa
the rdpmc instruction gets a counter argument in rcx. However, the i386 version was ignoring it. To make both x86_64 and i386 versions the same, as well as to comply with the instruction semantics, this parameter is added in the i386 version Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECT

[PATCH 10/10] integrate i386 and x86_64 code in msr.h

2007-12-04 Thread Glauber de Oliveira Costa
This patches proceeds with the integration of msr.h, making the code unified, instead of having a version for each architecture. We stick with the native_* functions, and then paravirt comes for free. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/msr.h | 161 ++

[PATCH 0/8] Integrate system.h

2007-12-04 Thread Glauber de Oliveira Costa
Hi, In the same lines of the msr.h integration, here it goes a series for system.h. Again, after the headers are turned into one, the paravirt pieces related to system.h comes for free. ___ Virtualization mailing list Virtualization@lists.linux-founda

[PATCH 6/10] introduce native_read_tscp

2007-12-04 Thread Glauber de Oliveira Costa
Targetting paravirt, this patch introduces native_read_tscp, in place of rdtscp() macro. When in a paravirt guest, this will involve a function call, and thus, cannot be done in the vdso area. These users then have to call the native version directly Signed-off-by: Glauber de Oliveira Costa <[EMAI

[PATCH 4/10] split get_cycles_sync

2007-12-04 Thread Glauber de Oliveira Costa
This patch splits get_cycles_sync() into __get_cycles_sync(), and the rdtscll part. Paravirt guests cannot issue rdtscl directly, as it involves a function call in vdso area. So, using the __get_cycles_sync() base, we introduce vget_cycles_sync, which then calls the native version of rdtscll. Ide

[PATCH 5/10] unify cpuid functions

2007-12-04 Thread Glauber de Oliveira Costa
cpuid is not very different between i386 and x86_64. We move away the x86_64 version from msr.h, and unify them at processor.h, where they belong. cpuid() paravirt then comes for free. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/msr.h | 67

[PATCH 1/10] Wipe out traditional opt from x86_64 Makefile

2007-12-04 Thread Glauber de Oliveira Costa
Among other things, using -traditional as a gcc option stops us from using macro token pasting, which is a feature we heavily rely on. There was still a use of -traditional in arch/x86/kernel/Makefile_64, which this patch removes. I don't see any problems building kernels in my x86_64 box without

[PATCH 3/10] allow sched clock to be overridden by paravirt

2007-12-04 Thread Glauber de Oliveira Costa
This patch turns the sched_clock into native_sched_clock. sched clock becomes a weak symbol, which can then give its place to a paravirt definition. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- arch/x86/kernel/tsc_64.c | 15 ++- 1 files changed, 14 insertions(+),

[PATCH 2/10] unify msr smp funcs

2007-12-04 Thread Glauber de Oliveira Costa
The functions under #ifdef CONFIG_SMP in msr.h are the same for both x86_64 and i386, and this patches removes one of them, putting them in a single location Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/msr.h | 33 +++-- 1 files ch

[PATCH 0/10 - V2] msr.h integration - fixups

2007-12-04 Thread Glauber de Oliveira Costa
There's really nothing new here. No changes at all, just fixing errors raised by checkpatch, at ingo's request. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization

Re: [PATCH 0/10] Integrate msr.h

2007-12-04 Thread Glauber de Oliveira Costa
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ingo Molnar escreveu: > * Glauber de Oliveira Costa <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> This series of patches integrates msr.h header. What it really does, >> is a series of steps to allow us to get rid of duplicate code between >> i386 an

Re: [PATCH 0/10] Integrate msr.h

2007-12-04 Thread Ingo Molnar
* Glauber de Oliveira Costa <[EMAIL PROTECTED]> wrote: > Hello, > > This series of patches integrates msr.h header. What it really does, > is a series of steps to allow us to get rid of duplicate code between > i386 and x86_64 versions > > With this done, achieving paravirt for x86_64 gets re

[PATCH 1/10] Wipe out traditional opt from x86_64 Makefile

2007-12-04 Thread Glauber de Oliveira Costa
Among other things, using -traditional as a gcc option stops us from using macro token pasting, which is a feature we heavily rely on. There was still a use of -traditional in arch/x86/kernel/Makefile_64, which this patch removes. I don't see any problems building kernels in my x86_64 box without

[PATCH 4/10] split get_cycles_sync

2007-12-04 Thread Glauber de Oliveira Costa
This patch splits get_cycles_sync() into __get_cycles_sync(), and the rdtscll part. Paravirt guests cannot issue rdtscl directly, as it involves a function call in vdso area. So, using the __get_cycles_sync() base, we introduce vget_cycles_sync, which then calls the native version of rdtscll. Ide

[PATCH 10/10] integrate i386 and x86_64 code in msr.h

2007-12-04 Thread Glauber de Oliveira Costa
This patches proceeds with the integration of msr.h, making the code unified, instead of having a version for each architecture. We stick with the native_* functions, and then paravirt comes for free. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/msr.h | 161 ++

[PATCH 7/10] change rdpmc interface

2007-12-04 Thread Glauber de Oliveira Costa
the rdpmc instruction gets a counter argument in rcx. However, the i386 version was ignoring it. To make both x86_64 and i386 versions the same, as well as to comply with the instruction semantics, this parameter is added in the i386 version Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECT

[PATCH 9/10] make fixups wordsize agnostic

2007-12-04 Thread Glauber de Oliveira Costa
This patch uses the _ASM_ALIGN and _ASM_PTR macros to make the fixups in native_read/write_msr_safe look the same for x86_64 and i386. Besides using this macros, we also have to take the explicit instruction suffixes out. It's okay because all this instructions uses registers, and can be sized by t

[PATCH 0/10] Integrate msr.h

2007-12-04 Thread Glauber de Oliveira Costa
Hello, This series of patches integrates msr.h header. What it really does, is a series of steps to allow us to get rid of duplicate code between i386 and x86_64 versions With this done, achieving paravirt for x86_64 gets really easy, just a couple of extra code. The first patch was already sent

[PATCH 8/10] change write msr functions interface

2007-12-04 Thread Glauber de Oliveira Costa
This patche changes the native_write_msr() and friends interface to explicitly take 2 32-bit registers instead of a 64-bit value. The change will ease the merge with 64-bit code. As the 64-bit value will be passed as two registers anyway in i386, the PVOP_CALL interface has to account for that and

[PATCH 2/10] unify msr smp funcs

2007-12-04 Thread Glauber de Oliveira Costa
The functions under #ifdef CONFIG_SMP in msr.h are the same for both x86_64 and i386, and this patches removes one of them, putting them in a single location Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/msr.h | 33 +++-- 1 files ch

[PATCH 6/10] introduce native_read_tscp

2007-12-04 Thread Glauber de Oliveira Costa
Targetting paravirt, this patch introduces native_read_tscp, in place of rdtscp() macro. When in a paravirt guest, this will involve a function call, and thus, cannot be done in the vdso area. These users then have to call the native version directly Signed-off-by: Glauber de Oliveira Costa <[EMAI

[PATCH 3/10] allow sched clock to be overridden by paravirt

2007-12-04 Thread Glauber de Oliveira Costa
This patch turns the sched_clock into native_sched_clock. sched clock becomes a weak symbol, which can then give its place to a paravirt definition. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- arch/x86/kernel/tsc_64.c | 15 ++- 1 files changed, 14 insertions(+),

[PATCH 5/10] unify cpuid functions

2007-12-04 Thread Glauber de Oliveira Costa
cpuid is not very different between i386 and x86_64. We move away the x86_64 version from msr.h, and unify them at processor.h, where they belong. cpuid() paravirt then comes for free. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- include/asm-x86/msr.h | 67

Re: [Xen-devel] Re: Next steps with pv_ops for Xen

2007-12-04 Thread Stephen C. Tweedie
Hi, On Tue, 2007-12-04 at 13:01 +0100, Gerd Hoffmann wrote: > >> Who uses the gntdev device right now? > > > > Good question! I'm aware of it being used in a few research projects, > > and it seems to work for them (though I think it is mostly used with the > > linux-2.6.18-xen kernel). Anyone e

Re: [Xen-devel] Re: Next steps with pv_ops for Xen

2007-12-04 Thread Gerd Hoffmann
Derek Murray wrote: > Gerd Hoffmann wrote: >> Oh, for me it isn't robust at all, it crashes on the first munmap >> syscall. It is the Fedora 8 kernel. See attachment. Didn't try >> xensource 2.6.18 yet. > > My gut feeling is that something changed in mm between 2.6.18 and > 2.6.21, but that see

Re: [Xen-devel] Re: Next steps with pv_ops for Xen

2007-12-04 Thread Derek Murray
Gerd Hoffmann wrote: On this point I completely agree with you! If anyone has any less radical suggestions, then I'd be delighted to refactor the gntdev code to use them. However, I'm not currently aware of any alternative that maintains robustness to process crashes. Oh, for me it isn't robust