All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org, glin@suse.de,
	agraf@suse.de, brogers@suse.de, afaerber@suse.de,
	lnussel@suse.de, edk2-devel@lists.sf.net, stable@vger.kernel.org
Subject: Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots
Date: Mon, 2 Sep 2013 19:16:17 +0300	[thread overview]
Message-ID: <20130902161617.GG10142@redhat.com> (raw)
In-Reply-To: <5224B608.3080303@redhat.com>

On Mon, Sep 02, 2013 at 06:00:08PM +0200, Paolo Bonzini wrote:
> Il 02/09/2013 11:25, Gleb Natapov ha scritto:
> > On Mon, Sep 02, 2013 at 05:20:15PM +0800, Xiao Guangrong wrote:
> >> On 08/30/2013 08:41 PM, Paolo Bonzini wrote:
> >>> Page tables in a read-only memory slot will currently cause a triple
> >>> fault because the page walker uses gfn_to_hva and it fails on such a slot.
> >>>
> >>> OVMF uses such a page table; however, real hardware seems to be fine with
> >>> that as long as the accessed/dirty bits are set.  Save whether the slot
> >>> is readonly, and later check it when updating the accessed and dirty bits.
> >>
> >> Paolo, do you know why OVMF is using readonly memory like this?
> >>
> > Just a guess, but perhaps they want to move to paging mode as early as
> > possible even before memory controller is fully initialized.
> 
> More precisely they want to move to 64-bit mode as early as possible,
> and that requires paging.
> 
> >> AFAIK, The fault trigged by this kind of access can hardly be fixed by
> >> userspace since the fault is trigged by pagetable walking not by the current
> >> instruction. Do you have any idea to let uerspace emulate it properly?
> >
> > Not sure what userspace you mean here, but there shouldn't be a fault in the
> > first place if ROM page tables have access/dirty bit set and they do.
> 
> Yep.  Actually they do not set dirty on the PD/PDP/PML4, only on the
> bottom level (which is also fine).
> 
They do it for a good reason, dirty bit exists only on the bottom level :)

--
			Gleb.

      reply	other threads:[~2013-09-02 16:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30 12:41 [PATCH] KVM: mmu: allow page tables to be in read-only slots Paolo Bonzini
2013-09-01  9:17 ` Gleb Natapov
2013-09-02  9:42   ` Xiao Guangrong
2013-09-02  9:49     ` Gleb Natapov
2013-09-02 10:05       ` Xiao Guangrong
2013-09-02 10:11         ` Gleb Natapov
2013-09-02 15:58           ` [edk2] " Paolo Bonzini
2013-09-02 15:58             ` Paolo Bonzini
2013-09-02 16:27             ` Gleb Natapov
2013-10-14 15:28   ` Paolo Bonzini
2013-09-02  9:20 ` Xiao Guangrong
2013-09-02  9:25   ` Gleb Natapov
2013-09-02 10:00     ` Xiao Guangrong
2013-09-02 10:07       ` Gleb Natapov
2013-09-02 15:56         ` [edk2] " Paolo Bonzini
2013-09-02 15:56           ` Paolo Bonzini
2013-09-02 16:26           ` Gleb Natapov
2013-09-02 16:00     ` [edk2] " Paolo Bonzini
2013-09-02 16:00       ` Paolo Bonzini
2013-09-02 16:16       ` Gleb Natapov [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=20130902161617.GG10142@redhat.com \
    --to=gleb@redhat.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=brogers@suse.de \
    --cc=edk2-devel@lists.sf.net \
    --cc=glin@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lnussel@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=xiaoguangrong@linux.vnet.ibm.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 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.