kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tsuyoshi Ozawa <ozadev@t-oza.net>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: R/W HG memory mappings with kvm?
Date: Tue, 29 Sep 2009 03:27:41 +0900	[thread overview]
Message-ID: <411a180c0909281127i749cb88aqae2bf1653d4de6ea@mail.gmail.com> (raw)

Hello,

>>  Sorry about that. The issue is the BUG in gfn_to_pgn where the pfn is
>>  not calculated correctly after looking up the vma.

>>  I still don't see how to get the physical address from the vma, since
>>  vm_pgoff is zero, and the vm_ops are not filled. The vma does not seem
>>  to store the physical base address.

> So it seems the only place the pfns are stored are in the ptes themselves. Is there an API to recover the ptes from a virtual address? We could use that instead.

I'm also trying to share H/G memory with another solution -
by overwriting shadow page table.

It seems that gfn_to_pfn is the key function which associate
guest memoy with host memory. So I changed gfn_to_pfn
as follows:

pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn)
{
    ...
    } else
        if ( shared_gfn && shared_gfn == gfn ){
            return shared_pfn;  // return pfn which is wanted to share
        }else {
            pfn = page_to_pfn(page[0]);
        }
    }
    ...
}

Here, shared_gfn is registered by walking soft mmu with gva.
And shared_pfn is the page frame number which is hostside.
By rewriting adobe, kvm is foxed and make up new shadow
page table with new mapping after zap all pages.

But I failed to share the memory. Do I have any misunderstanding?

Regards,
Tsuyoshi Ozawa

             reply	other threads:[~2009-09-28 18:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-28 18:27 Tsuyoshi Ozawa [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-07-05 22:41 R/W HG memory mappings with kvm? Stephen Donnelly
2009-07-06  7:38 ` Avi Kivity
2009-07-07 22:23   ` Stephen Donnelly
2009-07-08  4:36     ` Avi Kivity
2009-07-08 21:33       ` Stephen Donnelly
2009-07-09  8:10         ` Avi Kivity
2009-07-08 21:45       ` Cam Macdonell
2009-07-08 22:01         ` Stephen Donnelly
2009-07-09  6:01           ` Cam Macdonell
2009-07-09 22:38             ` Stephen Donnelly
2009-07-10 17:03               ` Cam Macdonell
2009-07-12 21:28                 ` Stephen Donnelly
     [not found]             ` <5f370d430907262256rd7f9fdalfbbec1f9492ce86@mail.gmail.com>
2009-07-27 14:48               ` Cam Macdonell
2009-07-27 21:32                 ` Stephen Donnelly
2009-07-28  8:54                   ` Avi Kivity
2009-07-28 23:06                     ` Stephen Donnelly
2009-08-13  4:07                       ` Stephen Donnelly
2009-08-19 12:14                         ` Avi Kivity
2009-08-23 21:59                           ` Stephen Donnelly
2009-08-24  4:55                             ` Avi Kivity
2009-08-26 10:22                               ` Avi Kivity
2009-08-27  2:39                                 ` Stephen Donnelly
2009-08-27  2:34                               ` Stephen Donnelly
2009-08-27  4:08                                 ` Avi Kivity
2009-08-30 22:33                                   ` Stephen Donnelly
2009-08-31  8:44                                     ` Avi Kivity
2009-08-31 21:13                                       ` Stephen Donnelly
2009-09-09 12:50                                         ` Avi Kivity
2009-07-29 23:52                     ` Cam Macdonell
2009-07-30  9:31                       ` Avi Kivity

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=411a180c0909281127i749cb88aqae2bf1653d4de6ea@mail.gmail.com \
    --to=ozadev@t-oza.net \
    --cc=avi@redhat.com \
    --cc=kvm@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;
as well as URLs for NNTP newsgroup(s).