Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Pavel Fedin <p.fedin@samsung.com>
To: 'Christoffer Dall' <christoffer.dall@linaro.org>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	'Marc Zyngier' <marc.zyngier@arm.com>
Subject: RE: [PATCH] KVM: arm: Fix crash in free_hyp_pgds() if timer initialization fails
Date: Fri, 06 Nov 2015 16:43:56 +0300	[thread overview]
Message-ID: <006d01d11899$2f7932f0$8e6b98d0$@samsung.com> (raw)
In-Reply-To: <20151106114223.GI5819@cbox>

 Hello!

> > > Did you check if PAGE_HYP_DEVICE can mean something sane on a stage-2
> > > page table entry and vice verse?
> >
> >  I tried to, the chain of macros and variables is complicated enough not to
> > get 200% sure, but anyway PAGE_HYP_DEVICE (as well as PAGE_S2_DEVICE)
> > includes PROT_PTE_DEVICE, so this is definitely device.
> >  I even tried to construct some mask in order to make a single check for only
> > DEVICE flags, but, to make things even less understandable and predictable,
> > the same code with different bitfields is reused by ARM64. So, i thought that
> > it will be more reliable just to add a second test.
> 
> The thing I want to avoid is PAGE_HYP_DEVICE covering some normal S2
> mapping, which we *should* flush but that we now end up ignoring?  That
> doesn't sound like it can be the case because the device bit is the same
> bit for both types of page tables, correct?

 Yes, this is exactly what i think. If DEVICE bit is set, then it's somehow
device memory and it doesn't need flashing.

 Or, in order to be 200% sure, we could modify the whole unmapping logic to carry
over a flag, telling whether we are removing normal or HYP mappings. But wouldn't
this be much more complicated?

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia



  reply	other threads:[~2015-11-06 13:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27  7:40 [PATCH] KVM: arm: Fix crash in free_hyp_pgds() if timer initialization fails Pavel Fedin
2015-11-05 15:24 ` Christoffer Dall
2015-11-05 18:38   ` [PATCH] KVM: arm: Don't try to flush hyp-mode device mappings kbuild test robot
2015-11-05 23:11   ` kbuild test robot
2015-11-06  9:32   ` [PATCH] KVM: arm: Fix crash in free_hyp_pgds() if timer initialization fails Pavel Fedin
2015-11-06 11:42     ` Christoffer Dall
2015-11-06 13:43       ` Pavel Fedin [this message]
2015-11-06 13:50         ` Marc Zyngier
2015-11-06 14:06           ` Pavel Fedin

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='006d01d11899$2f7932f0$8e6b98d0$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=marc.zyngier@arm.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