From: Scott Wood <scottwood@freescale.com>
To: kvm-ppc@vger.kernel.org
Subject: Re: Magic Page in e500v2
Date: Mon, 21 May 2012 15:41:18 +0000 [thread overview]
Message-ID: <4FBA621E.7030307@freescale.com> (raw)
In-Reply-To: <loom.20120521T133948-227@post.gmane.org>
On 05/21/2012 07:37 AM, Aashish Mittal wrote:
> Hi Alex
>
>> Hi Aashish,
>>
>> On 05/21/2012 01:51 PM, Aashish Mittal wrote:
>>> Hi
>>> I'm working on KVM optimizations on Powerpc e500v2 embedded
>>> architecture. For my
>>> project i'm trying to increase the size of shared region mapped my Magic
>>> Page
>>> between host and guest for paravirtual support. I was expecting this
>>> would
>>> possible since we are using a TLB1 entry to map the magic page entry
>>> inside the
>>> host. I'm trying to increase it's size to 1MB. I've declared a shared
>>> structure
>>> tcache of 1MB similar to vcpu->arch.shared and trying to map it in the
>>> guest
>>> virtual space. The shared page earlier is now the last page of this
>>> tcache
>>> structure.
>>>
>>> This is the modified code :
>>>
>>> Initialization in e500.c in function kvmppc_core_vcpu_create
>>>
>>> shared = (void*)__get_free_pages(GFP_KERNEL|__GFP_ZERO,10);
>>> vcpu->arch.tcache = (void*)(shared);
>>> vcpu->arch.shared = (void*)(shared + (((1<<
>>> 10)-1)<<PAGE_SHIFT));
>>
>> Did you also change the shared page elements to still be within the
>> first page? Otherwise the offset wouldn't fit into the immediate fields
>> of the asm instructions. We can't reach as low as -1MB with all
>> operations.
>
> Since i'm keeping the shared(magic page) to be as the last page of this 1
> MB section and trying to map the guest virtual address from 0xfff00000 to
> 0xffffffff while setting magic.mas2. Won't the magic page remain at it's
> original location i.e 0xfffff000 ?
The magic page API lets the guest specify the address. You can't know
whether the guest is going to put it at the beginning or the end of the
address space, and thus you can't know whether to keep the current magic
page contents at the beginning or the end. If you really need this it
should be a separate region set up by a separate hcall -- it would be
simpler that way even if this is just a local project not intended for
upstream (and thus ABI breakage isn't a big deal).
Why do you need such a large shared area?
> I've not changed anything on the shared page yet so the believe all the
> elements would remain to be on the first page ,
I thought you just said you put them on the last page.
Have you double checked to make sure all relevant code is agreeing on
exactly where the traditional magic area is, and that it is where you
think it is? Look at the actual instruction rewriting, check the values
KVM is seeing, etc.
-Scott
prev parent reply other threads:[~2012-05-21 15:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 11:51 Magic Page in e500v2 Aashish Mittal
2012-05-21 12:17 ` Alexander Graf
2012-05-21 12:49 ` Aashish Mittal
2012-05-21 13:17 ` Aashish Mittal
2012-05-21 15:41 ` Scott Wood [this message]
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=4FBA621E.7030307@freescale.com \
--to=scottwood@freescale.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox