Hi folks,
After some time away from it, and a big rebase as a consequence, here is
the updated version of paravirt_ops for x86_64, heading to inclusion.
Your criticism is of course, very welcome.
Have fun
--
arch/x86_64/Kconfig | 11
arch/x86_64/ia32/syscall32.c |2
Later on, the paravirt_ops patch will deference the vm_area_struct
in asm/pgtable.h. It means this define must be after the struct
definition
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
include/linux/mm.h | 14 +-
1
This patch turns the flush_tlb routines into native versions.
In case paravirt is not defined, the natives are defined into
the actually used ones. flush_tlb_others() goes in smp.c, unless
we smp is not in the game
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven
This patch turns the irq_flags and halt routines into the
native versions.
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
include/asm-x86_64/irqflags.h | 32 +++-
1 files changed, 27 insertions(+), 5
Export math_state_restore symbol, so it can be used for hypervisors.
They are commonly loaded as modules.
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
arch/x86_64/kernel/traps.c |1 +
1 files changed, 1 insertions(+), 0
When paravirtualization is disabled, the kernel is always
running at ring 0. So report it in the appropriate macro
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
include/asm-x86_64/segment.h |4
1 files changed, 4
This patch turns the basic descriptor handling into native_
functions. It is basically write_idt, load_idt, write_gdt,
load_gdt, set_ldt, store_tr, load_tls, and the ones
for updating a single entry.
In the process of doing that, we change the definition of
load_LDT_nolock, and caller sites have
This patch turns makes the basic operations in msr.h out of native
ones. Those operations are: rdmsr, wrmsr, rdtsc, rdtscp, rdpmc, and
cpuid. After they are turned into functions, some call sites need
casts, and so we provide them.
There is also a fixup needed in the functions located in the
This patch introduces a new macro/function that informs a paravirt
guest when its page table is not more in use, and can be released.
In case we're not paravirt, just do nothing.
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
Besides not elegant, it is now even forbidden, since it can
break paravirtualized guests. load_cr3 should call write_cr3()
instead.
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
include/asm-x86_64/mmu_context.h |2 +-
1 files
This patch turns the page operations (set and make a page table)
into native_ versions. The operations itself will be later
overriden by paravirt.
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
include/asm-x86_64/page.h | 36
Okay, this one is obviously wrong, my fault (it doesn't do what it
says it does in the body of the e-mail. Resending...
--
Glauber de Oliveira Costa.
Free as in Freedom
http://glommer.net
The less confident you are, the more serious you have to act.
arch/x86_64/kernel/tce.c|2 -
This function/macro will allow a paravirt guest to be notified we changed
the current task cr3, and act upon it. It's up to them
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
include/asm-x86_64/mmu_context.h | 17
under paravirt, read cr2 cannot be issued directly anymore.
So wrap it in a macro, defined to the operation itself in case
paravirt is off, but to something else if we have paravirt
in the game
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL
This patch introduces apply_paravirt(), a function that shall
be called by i386/alternative.c to apply replacements to
paravirt_functions. It is defined to an do-nothing function
if paravirt is not enabled.
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt
This patch replaces syscall_init by x86_64_syscall_init.
The former will be later replaced by a paravirt replacement
in case paravirt is on
Signed-off-by: Glauber de Oliveira Costa [EMAIL PROTECTED]
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
arch/x86_64/kernel/setup64.c |8 +++-
This patch add provisions for time related functions so they
can be later replaced by paravirt versions.
it basically encloses {g,s}et_wallclock inside the
already existent functions update_persistent_clock and
read_persistent_clock, and defines {s,g}et_wallclock
to the core of such functions.
This patch add paravirtualization hooks in the arch initialization
process. paravirt_arch_setup() lets the guest issue any specific
initialization routine, and skip all the rest if it see fits, which
it signals by a proper return value.
In case the initialization continues, we hook at least
With paravirt on, we cannot issue operations like swapgs, sysretq,
iretq, cli, sti. So they have to be changed into macros, that will
be later properly replaced for the paravirt case.
The sysretq is a little bit more complicated, and is replaced
by a sequence of three instructions. It is
This is finally, the patch we were all looking for. This
patch adds a paravirt.h header with the definition of paravirt_ops
struct. Also, it defines a bunch of inline functions that will
replace, or hook, the other calls. Every one of those functions
adds an entry in the parainstructions section
+#define SYSRETQ \
+ movq%gs:pda_oldrsp,%rsp;\
+ swapgs; \
+ sysretq;
When the macro does more than sysret it should have a different
name
*/
@@ -264,13 +270,64 @@ struct thread_struct {
set_fs(USER_DS);
\
} while(0)
-#define get_debugreg(var, register) \
- __asm__(movq %%db #register , %0\
- :=r
-static void discover_ebda(void)
+void native_ebda_info(unsigned *addr, unsigned *size)
I guess it would be better to use the resources frame work here.
Before checking EBDA check if it is already reserved. Then lguest/Xen
can reserve these areas and stop using it.
+/* Overridden in
+#ifdef CONFIG_PARAVIRT
+#include asm/paravirt.h
+# ifdef CONFIG_X86_VSMP
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+ return !(flags X86_EFLAGS_IF) || (flags X86_EFLAGS_AC);
+}
+# else
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+
On Wednesday 08 August 2007 06:19, Glauber de Oliveira Costa wrote:
+static __always_inline long long vget_cycles_sync(void)
Why is there a copy of this function now? That seems wrong
+ native_read_tscp(p);
The instruction is called rdtscp not read_tscp. Please follow that
+config PARAVIRT
+ bool Paravirtualization support (EXPERIMENTAL)
This should be hidden and selected by the clients as needed
(I already did this change on i386)
Users know nothing about paravirt, they just know about Xen, lguest
etc.
Strictly you would at least need a !X86_VSMP
Hi Andi,
Thanks for all the comments, it's greatly appreciated.
On Wed, 8 Aug 2007, Andi Kleen wrote:
+#define SYSRETQ\
+ movq%gs:pda_oldrsp,%rsp;\
+ swapgs; \
+
On Wed, 8 Aug 2007, Andi Kleen wrote:
Strictly you would at least need a !X86_VSMP dependency, but
with the vsmp change i requested that will be unnecessary
Is this really synced with the latest version of the i386 code?
Glauber started the paravirt ops 64 a second time around, from scratch
On Wed, 8 Aug 2007, Andi Kleen wrote:
Probably not, but this part of the code I don't fully understand.
I would suggest to defer all this until at least one example to test it
(except vsmp which is too simple) is around.
Who uses that code? NMIs and debug regs? Lguest only has the host
--
On Wed, 8 Aug 2007, Andi Kleen wrote:
Steven Rostedt [EMAIL PROTECTED] writes:
On Wed, 8 Aug 2007, Andi Kleen wrote:
Probably not, but this part of the code I don't fully understand.
I would suggest to defer all this until at least one example to test it
(except vsmp
When I said this part of the code I don't fully understand I was not
talking about entry.S. I understand entry.S very well, but the comment
was originally on the paranoid_restore code. Which I thought had to deal
with NMIs and such that I didn't worry about that I simply did the
default.
If you were talking about the general iretq = INTERRUPT_RETURN, then the
answer is Yes, they are sufficient. The first version of lguest ran the
guest kernel in ring 3 (using dual page tables for guest kernel and guest
user). The current version I'm pushing runs lguest in ring 1, and the
ENTRY adds alignment. Why do you need that export anyways?
The paravirt ops struct points to it.
But the paravirt_ops probably won't need it as an export. So I guess
andi is right.
--
Glauber de Oliveira Costa.
Free as in Freedom
http://glommer.net
The less confident you are, the more
On Wed, Aug 08, 2007 at 09:47:05AM -0400, Steven Rostedt wrote:
/me working very hard to get lguest64 ready for public display
Here's a snippet from my version of core.c. I've been thinking of ways to
optimize it, but for now it works fine. This was done for both ring 3 and
ring 1 lguest
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
-static void discover_ebda(void)
+void native_ebda_info(unsigned *addr, unsigned *size)
I guess it would be better to use the resources frame work here.
Before checking EBDA check if it is already reserved. Then lguest/Xen
can reserve these
On Wednesday 08 August 2007 15:58:06 Glauber de Oliveira Costa wrote:
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
+#define SYSRETQ \
+ movq%gs:pda_oldrsp,%rsp;\
+ swapgs;
On Wednesday 08 August 2007 16:08:25 Glauber de Oliveira Costa wrote:
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
-static void discover_ebda(void)
+void native_ebda_info(unsigned *addr, unsigned *size)
I guess it would be better to use the resources frame work here.
Before
On Wednesday 08 August 2007 16:10:28 Glauber de Oliveira Costa wrote:
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
+#ifdef CONFIG_PARAVIRT
+#include asm/paravirt.h
+# ifdef CONFIG_X86_VSMP
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+ return
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
On Wednesday 08 August 2007 06:19, Glauber de Oliveira Costa wrote:
+static __always_inline long long vget_cycles_sync(void)
Why is there a copy of this function now? That seems wrong
Yeah, the other one is in i386 headers, so We probably wan't
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
On Wednesday 08 August 2007 16:10:28 Glauber de Oliveira Costa wrote:
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
+#ifdef CONFIG_PARAVIRT
+#include asm/paravirt.h
+# ifdef CONFIG_X86_VSMP
+static inline int
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
+#ifdef CONFIG_PARAVIRT
+#include asm/paravirt.h
+# ifdef CONFIG_X86_VSMP
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+ return !(flags X86_EFLAGS_IF) || (flags X86_EFLAGS_AC);
+}
+# else
+static inline
The instruction is called rdtscp not read_tscp. Please follow that
Although the operation consists in reading tscp.
There is no tscp register
-Andi
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
On 8/8/07, Arjan van de Ven [EMAIL PROTECTED] wrote:
On Wed, 2007-08-08 at 01:19 -0300, Glauber de Oliveira Costa wrote:
With paravirualization, hypervisors needs to handle the gdt,
that was right to this point only used at very early
inialization code. Hypervisors are commonly modules, so
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
Is this really synced with the latest version of the i386 code?
Roasted already commented on this. I will check out and change it here.
+#ifdef CONFIG_PARAVIRT
+#include asm/paravirt.h
+#endif
+#include linux/errno.h
+#include
Glauber de Oliveira Costa wrote:
Hi folks,
After some time away from it, and a big rebase as a consequence, here
is
the updated version of paravirt_ops for x86_64, heading to inclusion.
Your criticism is of course, very welcome.
Have fun
Do you assume that the kernel ougtht to use 2MB
On 8/8/07, Nakajima, Jun [EMAIL PROTECTED] wrote:
Glauber de Oliveira Costa wrote:
Hi folks,
After some time away from it, and a big rebase as a consequence, here
is
the updated version of paravirt_ops for x86_64, heading to inclusion.
Your criticism is of course, very welcome.
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
Similar.
I don't think so. They are live here, but restore_args follows, so we
can safely clobber anything here. Right?
The non argument registers cannot be clobbered.
But they are not. Yeah, I ommited it in the changelog, (it is in a
comment
--
On Wed, 8 Aug 2007, Andi Kleen wrote:
On Wed, Aug 08, 2007 at 09:47:05AM -0400, Steven Rostedt wrote:
[...]
asm volatile (pushq %2; pushq %%rsp; pushfq; pushq %3; call *%6;
/* The stack we pushed is off by 8, due to the
previous pushq */
On Thursday 09 August 2007 01:18:57 Rusty Russell wrote:
On Wed, 2007-08-08 at 11:49 -0300, Glauber de Oliveira Costa wrote:
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
+EXPORT_SYMBOL(paravirt_ops);
Definitely _GPL at least.
Sure.
We ended up making it EXPORT_SYMBOL in i386
Glauber de Oliveira Costa wrote:
On 8/8/07, Nakajima, Jun [EMAIL PROTECTED] wrote:
Glauber de Oliveira Costa wrote:
Hi folks,
After some time away from it, and a big rebase as a consequence,
here is
the updated version of paravirt_ops for x86_64, heading to
inclusion.
Your
On 8/8/07, Nakajima, Jun [EMAIL PROTECTED] wrote:
So, unless I'm very wrong, it only makes sense to talk about not
supporting large pages in the guest level. But it is not a
paravirt_ops problem.
Some MMU-related PV techiniques (including Xen, and direct paging mode
for Xen/KVM) need to
Add a generic lg.h file to call the architecture specific one.
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
drivers/lguest/lg.h |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h
new file mode 100644
index 000..4c4356e
Have the lguest launcher include e820.h via asm/e820.h instead of explicitly
saying i386.
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
Documentation/lguest/lguest.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/lguest/lguest.c
The lguest_dma_info is also generic across architectures.
Move it to the generic lg.h
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
drivers/lguest/i386/lg.h | 11 ---
drivers/lguest/lg.h | 11 +++
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git
Make a i386 directory in the lguest directory, and move the lg.h into
it. This will clear the way for other archs to have their own lg.h
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
drivers/lguest/i386/lg.h | 300 ++
drivers/lguest/lg.h |
Move the io struct into the lg.h file since the io.c is generic to other
architectures.
Also added a proper ifdef for the generic lg.h.
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
drivers/lguest/i386/lg.h | 11 ++-
drivers/lguest/lg.h | 16
2 files
The hvc_lguest uses __pa in the const initialization.
In some architectures, __pa() is not constant so this fails in compiles.
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
drivers/char/hvc_lguest.c |8 +++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -46,7 +46,7 @@ typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
#include ../../include/linux/lguest_launcher.h
-#include ../../include/asm-i386/e820.h
+#include ../../include/asm/e820.h
Couldn't
On Wed, 08 Aug 2007 20:32:13 -0400 Steven Rostedt [EMAIL PROTECTED]
wrote:
Add a generic lg.h file to call the architecture specific one.
Please combine this with the previous patch so that the tree will build
at each step.
--
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
On Wed, 08 Aug 2007 20:32:15 -0400 Steven Rostedt [EMAIL PROTECTED]
wrote:
diff --git a/drivers/lguest/i386/lg.h b/drivers/lguest/i386/lg.h
index 64f0abe..c5ea14c 100644
--- a/drivers/lguest/i386/lg.h
+++ b/drivers/lguest/i386/lg.h
@@ -20,6 +20,8 @@
#include linux/err.h
#include
--
On Thu, 9 Aug 2007, Stephen Rothwell wrote:
On Wed, 08 Aug 2007 20:32:13 -0400 Steven Rostedt [EMAIL PROTECTED]
wrote:
Add a generic lg.h file to call the architecture specific one.
Please combine this with the previous patch so that the tree will build
at each step.
Yeah, I wanted
[
Changes since last version.
- Move lg.h to include/asm instead (suggested by Rusty Russel)
- All steps of the series compiles (suggested by Stephen Rothwell)
- Better ifdef header naming (suggested by Stephen Rothwell)
- Added Andi Kleen to CC (forgot to on V1)
]
Hi all,
I've been
Add a generic lg.h that can be included from lguest files.
This file will hold the data that can be shared across archs.
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
arch/i386/kernel/asm-offsets.c|2 +-
drivers/lguest/core.c |2 +-
Have the lguest launcher include e820.h via asm/e820.h instead of explicitly
saying i386.
Signed-off-by: Steven Rostedt [EMAIL PROTECTED]
---
Documentation/lguest/lguest.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/lguest/lguest.c
Steven Rostedt wrote:
/*
* x86 arch doesn't have an easy way to find out where
* gs is located. So we need to read the MSR. But first
* we need to save off the rcx, rax and rdx.
Why don't you store it in gs? movq %gs:my_gs_base, %rax?
J
Glauber de Oliveira Costa wrote:
On 8/8/07, Nakajima, Jun [EMAIL PROTECTED] wrote:
Glauber de Oliveira Costa wrote:
Hi folks,
After some time away from it, and a big rebase as a consequence, here
is
the updated version of paravirt_ops for x86_64, heading to
Hi Steven,
On Thu, 09 Aug 2007 00:36:31 -0400 Steven Rostedt [EMAIL PROTECTED]
wrote:
Well, some may be merged with x86_64 later, but for now we move them
out of the way. Later on we can start seeing how we can combine
some of these files to be arch generic.
Signed-off-by: Steven Rostedt
Andi Kleen wrote:
@@ -264,13 +270,64 @@ struct thread_struct {
set_fs(USER_DS);
\
} while(0)
-#define get_debugreg(var, register) \
-__asm__(movq %%db #register , %0\
-
On 8/8/07, Andi Kleen [EMAIL PROTECTED] wrote:
@@ -264,13 +270,64 @@ struct thread_struct {
set_fs(USER_DS);
\
} while(0)
-#define get_debugreg(var, register) \
- __asm__(movq %%db
Glauber de Oliveira Costa wrote:
The interrupt initialization routine becomes native_init_IRQ and will
be overriden later in case paravirt is on.
The interrupt vector is made global, so paravirt guests can reference
it in their initializations.
Why? And if so, wouldn't it be better to add
70 matches
Mail list logo