From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 07/23] Add SLB switching code for entry/exit
Date: Wed, 08 Jul 2009 04:38:16 +0000 [thread overview]
Message-ID: <1247027896.6066.101.camel@pasglop> (raw)
In-Reply-To: <1246976262-4826-8-git-send-email-agraf@suse.de>
On Tue, 2009-07-07 at 16:17 +0200, Alexander Graf wrote:
> This is the really low level of guest entry/exit code.
>
> Usually the Linux kernel resides in virtual memory 0xc000000000000000 to
> 0xffffffffffffffff. These addresses are mapped into every userspace
> application.
>
> When going into a 32 bit guest, this is perfectly fine. That one can't
> access memory that high anyways.
>
> Going into a 64 bit guest, the guest kernel probably is in the same
> virtual memory region as the host, so we need to switch between those two.
>
> During normal entry code we're in those virtual addresses though. So
> we need a small wrapper in real memory that switches from host to guest
> high SLB state and vice versa.
>
> To store both host and guest state in the SLB, we store guest kernel SLB
> entries in a different range (0x40000000000000000 - 0x7ffffffffffffffff).
>
> For details on which entries go where, please see the patch itself.
Note that we have an unused VSID bit at the moment on 64-bit afaik. We
could probably use that to differenciate guest kernel VSIDs from host
kernel VSIDs. That would avoid having to muck around with the EAs
themselves that much no ?
I'm not sure I understand exactly what you are doing here, we should
discuss this on IRC one of these days I suppose. But you should be able
to just get rid of the host kernel SLBs completely with some care, as
there are some critical code path where taking an exception without
having the SLB entry around for entry 0 and the kernel stack will
blow...
But just blow them off, and when returning to the kernel, just put back
the ones that are needed (aka slb_flush_and_rebolt). You will need to
play carefully with that though, look at the code in slb.c, as the real
pHyp hypervisor that may lie underneath will potentially muck around the
SLBs and will restore them occasionally from the special in-memory
shadows, so you probably want to switch the content of those too.
Of course none of that will work on legacy iSeries or Power3 but I think
we can safely say we don't care :-)
Cheers,
Ben.
next prev parent reply other threads:[~2009-07-08 4:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 14:17 [PATCH 07/23] Add SLB switching code for entry/exit Alexander Graf
2009-07-08 4:38 ` Benjamin Herrenschmidt [this message]
2009-07-08 7:23 ` Alexander Graf
2009-07-08 7:43 ` Benjamin Herrenschmidt
2009-07-16 13:30 ` Alexander Graf
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=1247027896.6066.101.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.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.