public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Ben-Ami Yassour <benami@il.ibm.com>
Cc: aliguori@us.ibm.com, Han Weidong <weidong.han@intel.com>,
	"Kay, Allen M" <allen.m.kay@intel.com>,
	Muli Ben-Yehuda <muli@il.ibm.com>,
	Amit Shah <amit.shah@qumranet.com>,
	andrea@qumranet.com, kvm@vger.kernel.org
Subject: Re: [PATCH] Handle vma regions with no backing page
Date: Wed, 04 Jun 2008 12:48:09 +0300	[thread overview]
Message-ID: <484664D9.6040407@qumranet.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0806031413010.8803@cluwyn.haifa.ibm.com>

Ben-Ami Yassour wrote:
> Anthony Liguori <aliguori@us.ibm.com> wrote on 04/29/2008 05:32:09 PM:
>
>> Subject
>>
>> [PATCH] Handle vma regions with no backing page
>>
>> This patch allows VMA's that contain no backing page to be used for 
>> guest
>> memory.  This is a drop-in replacement for Ben-Ami's first page in 
>> his direct
>> mmio series.  Here, we continue to allow mmio pages to be represented 
>> in the
>> rmap.
>
>>  struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn)
>>  {
>> -   return pfn_to_page(gfn_to_pfn(kvm, gfn));
>> +   pfn_t pfn;
>> +
>> +   pfn = gfn_to_pfn(kvm, gfn);
>> +   if (pfn_valid(pfn))
>> +      return pfn_to_page(pfn);
>> +
>> +   return NULL;
>>  }
>
> We noticed that pfn_valid does not always works as expected by this 
> patch to indicate that a pfn has a backing page.
> We have seen a case where CONFIG_NUMA was not set and then where 
> pfn_valid returned 1 for an mmio pfn.
> We then changed the config file with CONFIG_NUMA set and it worked 
> fine as expected (since a different implementation of pfn_valid was 
> used).
>
> How should we overcome this issue?
>

Looks like we need to reintroduce a refcount bit in the pte, and check 
the page using the VMA.

Nick Piggin's lockless pagecache patches, which have the same issue, 
also introduce a pte_special bit.  We could follow a similar route.

http://www.mail-archive.com/linux-arch@vger.kernel.org/msg04789.html

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  parent reply	other threads:[~2008-06-04  9:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 11:17 [PATCH] Handle vma regions with no backing page Ben-Ami Yassour
2008-06-03 11:39 ` Andrea Arcangeli
2008-06-04 15:09   ` Ben-Ami Yassour
2008-06-04 16:17     ` Muli Ben-Yehuda
2008-06-04 19:34       ` Andrea Arcangeli
2008-06-04 19:41         ` Anthony Liguori
2008-06-04 19:51           ` Andrea Arcangeli
2008-06-04 19:59             ` Dave Hansen
2008-06-04  9:48 ` Avi Kivity [this message]
2008-06-04 16:48   ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2008-04-29 14:32 Anthony Liguori
2008-04-29 14:54 ` Andrea Arcangeli
2008-04-29 15:14   ` Anthony Liguori

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=484664D9.6040407@qumranet.com \
    --to=avi@qumranet.com \
    --cc=aliguori@us.ibm.com \
    --cc=allen.m.kay@intel.com \
    --cc=amit.shah@qumranet.com \
    --cc=andrea@qumranet.com \
    --cc=benami@il.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=muli@il.ibm.com \
    --cc=weidong.han@intel.com \
    /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