From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: lguest@ozlabs.org
Cc: glommer@gmail.com, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, rusty@rustcorp.com.au,
rostedt@goodmis.org,
Glauber de Oliveira Costa <gcosta@redhat.com>
Subject: [PATCH 09/16] map_switcher_in_guest() per-vcpu
Date: Thu, 20 Dec 2007 11:33:49 -0200 [thread overview]
Message-ID: <11981576833314-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1198157678759-git-send-email-gcosta@redhat.com>
The switcher needs to be mapped per-vcpu, because different vcpus
will potentially have different page tables (they don't have to,
because threads will share the same).
So our first step is the make the function receive a vcpu struct
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
---
drivers/lguest/lg.h | 3 ++-
drivers/lguest/page_tables.c | 4 +++-
drivers/lguest/x86/core.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h
index db2edd6..f6e9020 100644
--- a/drivers/lguest/lg.h
+++ b/drivers/lguest/lg.h
@@ -173,7 +173,8 @@ void guest_pagetable_clear_all(struct lguest *lg);
void guest_pagetable_flush_user(struct lguest *lg);
void guest_set_pte(struct lguest *lg, unsigned long gpgdir,
unsigned long vaddr, pte_t val);
-void map_switcher_in_guest(struct lguest *lg, struct lguest_pages *pages);
+void map_switcher_in_guest(struct lguest_vcpu *vcpu,
+ struct lguest_pages *pages);
int demand_page(struct lguest *info, unsigned long cr2, int errcode);
void pin_page(struct lguest *lg, unsigned long vaddr);
unsigned long guest_pa(struct lguest *lg, unsigned long vaddr);
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index fffabb3..7fb8627 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -634,8 +634,10 @@ void free_guest_pagetable(struct lguest *lg)
* Guest (and not the pages for other CPUs). We have the appropriate PTE pages
* for each CPU already set up, we just need to hook them in now we know which
* Guest is about to run on this CPU. */
-void map_switcher_in_guest(struct lguest *lg, struct lguest_pages *pages)
+void map_switcher_in_guest(struct lguest_vcpu *vcpu,
+ struct lguest_pages *pages)
{
+ struct lguest *lg = vcpu->lg;
pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages);
pgd_t switcher_pgd;
pte_t regs_pte;
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 3d21c6d..9bf2213 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -92,7 +92,7 @@ static void copy_in_guest_info(struct lguest_vcpu *vcpu,
pages->state.host_cr3 = __pa(current->mm->pgd);
/* Set up the Guest's page tables to see this CPU's pages (and no
* other CPU's pages). */
- map_switcher_in_guest(lg, pages);
+ map_switcher_in_guest(vcpu, pages);
/* Set up the two "TSS" members which tell the CPU what stack to use
* for traps which do directly into the Guest (ie. traps at privilege
* level 1). */
--
1.5.0.6
next prev parent reply other threads:[~2007-12-20 13:37 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-20 13:33 [PATCH 0/16] lguest: introduce vcpu structure Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 01/16] introduce vcpu struct Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 02/16] adapt lguest launcher to per-cpuness Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 03/16] initialize vcpu Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 04/16] per-cpu run guest Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 05/16] make write() operation smp aware Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 06/16] make hypercalls use the vcpu struct Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 07/16] per-vcpu lguest timers Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 08/16] per-vcpu interrupt processing Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa [this message]
2007-12-20 13:33 ` [PATCH 10/16] make emulate_insn receive a vcpu struct Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 11/16] make registers per-vcpu Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 12/16] replace lguest_arch with lguest_vcpu_arch Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 13/16] per-vcpu lguest task management Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 14/16] makes special fields be per-vcpu Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 15/16] make pending notifications per-vcpu Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 16/16] per-vcpu lguest pgdir management Glauber de Oliveira Costa
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-20 13:33 ` [PATCH 15/16] make pending notifications per-vcpu Glauber de Oliveira Costa
2007-12-25 23:47 ` [PATCH 13/16] per-vcpu lguest task management Rusty Russell
2007-12-25 23:47 ` Rusty Russell
2007-12-20 13:33 ` [PATCH 11/16] make registers per-vcpu Glauber de Oliveira Costa
2007-12-25 23:47 ` [PATCH 09/16] map_switcher_in_guest() per-vcpu Rusty Russell
2007-12-25 23:47 ` Rusty Russell
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-25 23:40 ` [PATCH 05/16] make write() operation smp aware Rusty Russell
2007-12-25 23:40 ` Rusty Russell
2007-12-20 13:33 ` Glauber de Oliveira Costa
2007-12-25 23:38 ` [PATCH 04/16] per-cpu run guest Rusty Russell
2007-12-25 23:38 ` Rusty Russell
2007-12-20 13:33 ` [PATCH 03/16] initialize vcpu Glauber de Oliveira Costa
2007-12-25 23:35 ` [PATCH 02/16] adapt lguest launcher to per-cpuness Rusty Russell
2007-12-26 14:24 ` Steven Rostedt
2007-12-27 0:08 ` Rusty Russell
2007-12-27 0:08 ` Rusty Russell
2007-12-26 14:24 ` Steven Rostedt
2007-12-25 23:35 ` Rusty Russell
2007-12-25 23:34 ` [PATCH 01/16] introduce vcpu struct Rusty Russell
2007-12-25 23:34 ` Rusty Russell
2007-12-25 23:54 ` [PATCH 0/16] lguest: introduce vcpu structure Rusty Russell
2007-12-25 23:54 ` Rusty Russell
2008-01-06 17:33 ` Glauber de Oliveira Costa
2008-01-07 0:53 ` Rusty Russell
2008-01-07 0:53 ` Rusty Russell
2008-01-06 17:33 ` Glauber de Oliveira Costa
-- strict thread matches above, loose matches on Subject: below --
2008-01-07 13:05 [PATCH 0/16 -v2] lguest smp infrastructure Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 01/16] introduce vcpu struct Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 02/16] adapt lguest launcher to per-cpuness Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 03/16] initialize vcpu Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 04/16] per-cpu run guest Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 05/16] make write() operation smp aware Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 06/16] make hypercalls use the vcpu struct Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 07/16] per-vcpu lguest timers Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 08/16] per-vcpu interrupt processing Glauber de Oliveira Costa
2008-01-07 13:05 ` [PATCH 09/16] map_switcher_in_guest() per-vcpu Glauber de Oliveira Costa
2008-01-07 13:05 ` Glauber de Oliveira Costa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11981576833314-git-send-email-gcosta@redhat.com \
--to=gcosta@redhat.com \
--cc=glommer@gmail.com \
--cc=lguest@ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.