mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laura Abbott <labbott@fedoraproject.org>
To: Christoffer Dall <christoffer.dall@linaro.org>,
	Marc Zyngier <marc.zyngier@arm.com>
Cc: Laura Abbott <labbott@fedoraproject.org>,
	Russell King <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] arm: kvm: Fix STRICT_MM_TYPECHECK errors
Date: Tue, 10 Nov 2015 18:03:21 -0800	[thread overview]
Message-ID: <1447207401-12023-2-git-send-email-labbott@fedoraproject.org> (raw)
In-Reply-To: <1447207401-12023-1-git-send-email-labbott@fedoraproject.org>


PAGE_S2_DEVICE is a pgprot val and needs to be accessed using the proper
accessors. Switch to these accessors to avoid errors with
STRICT_MM_TYPECHECK.

Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
---
Found in the course of other work
---
 arch/arm/kvm/mmu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 6984342..43f8162 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -213,7 +213,8 @@ static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
 			kvm_tlb_flush_vmid_ipa(kvm, addr);
 
 			/* No need to invalidate the cache for device mappings */
-			if ((pte_val(old_pte) & PAGE_S2_DEVICE) != PAGE_S2_DEVICE)
+			if ((pte_val(old_pte) & pgprot_val(PAGE_S2_DEVICE)) !=
+			     pgprot_val(PAGE_S2_DEVICE))
 				kvm_flush_dcache_pte(old_pte);
 
 			put_page(virt_to_page(pte));
@@ -306,7 +307,8 @@ static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd,
 	pte = pte_offset_kernel(pmd, addr);
 	do {
 		if (!pte_none(*pte) &&
-		    (pte_val(*pte) & PAGE_S2_DEVICE) != PAGE_S2_DEVICE)
+		    (pte_val(*pte) & pgprot_val(PAGE_S2_DEVICE)) !=
+		     pgprot_val(PAGE_S2_DEVICE))
 			kvm_flush_dcache_pte(*pte);
 	} while (pte++, addr += PAGE_SIZE, addr != end);
 }
-- 
2.5.0


  reply	other threads:[~2015-11-11  2:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11  2:03 [PATCH 1/2] arm64: Fix STRICT_MM_TYPECHECKS errors from pgprot Laura Abbott
2015-11-11  2:03 ` Laura Abbott [this message]
2015-11-14  7:02   ` [PATCH 2/2] arm: kvm: Fix STRICT_MM_TYPECHECK errors Ard Biesheuvel
2015-11-11  5:51 ` [PATCH 1/2] arm64: Fix STRICT_MM_TYPECHECKS errors from pgprot Ard Biesheuvel
2015-11-11  6:02   ` Ard Biesheuvel
2015-11-12 20:21     ` [PATCHv2] arm64: Fix R/O permissions in mark_rodata_ro Laura Abbott
2015-11-15  7:38       ` Ard Biesheuvel
2015-11-16 22:50         ` Laura Abbott
2015-11-17  9:56           ` Ard Biesheuvel
2015-11-18 12:14       ` Catalin Marinas

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=1447207401-12023-2-git-send-email-labbott@fedoraproject.org \
    --to=labbott@fedoraproject.org \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --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

all inboxes | Powered by JetHome®