kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] arm/arm64: KVM: fix two build failured under STRICT_MM_TYPECHECKS
       [not found] <1435680290-13945-1-git-send-email-ard.biesheuvel@linaro.org>
@ 2015-06-30 16:04 ` Ard Biesheuvel
  2015-06-30 17:03   ` Catalin Marinas
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2015-06-30 16:04 UTC (permalink / raw)
  To: linux-arm-kernel, marc.zyngier, catalin.marinas; +Cc: Ard Biesheuvel, kvmarm

This fixes two instances where a pgprot_t is used as the operand
of a bitwise & operation. In order to comply with STRICT_MM_TYPECHECKS,
bitwise arithmetic on a pgprot_t should go via the pgprot_val()
accessor.

Cc: kvmarm@lists.cs.columbia.edu
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 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 1d5accbd3dcf..a255c7dd534b 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);
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] arm/arm64: KVM: fix two build failured under STRICT_MM_TYPECHECKS
  2015-06-30 16:04 ` [PATCH 2/2] arm/arm64: KVM: fix two build failured under STRICT_MM_TYPECHECKS Ard Biesheuvel
@ 2015-06-30 17:03   ` Catalin Marinas
  2015-07-01 10:56     ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2015-06-30 17:03 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: marc.zyngier, kvmarm, linux-arm-kernel

On Tue, Jun 30, 2015 at 06:04:50PM +0200, Ard Biesheuvel wrote:
> This fixes two instances where a pgprot_t is used as the operand
> of a bitwise & operation. In order to comply with STRICT_MM_TYPECHECKS,
> bitwise arithmetic on a pgprot_t should go via the pgprot_val()
> accessor.
> 
> Cc: kvmarm@lists.cs.columbia.edu
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

(I guess it will go via the kvm tree)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] arm/arm64: KVM: fix two build failured under STRICT_MM_TYPECHECKS
  2015-06-30 17:03   ` Catalin Marinas
@ 2015-07-01 10:56     ` Marc Zyngier
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2015-07-01 10:56 UTC (permalink / raw)
  To: Catalin Marinas, Ard Biesheuvel
  Cc: kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org

On 30/06/15 18:03, Catalin Marinas wrote:
> On Tue, Jun 30, 2015 at 06:04:50PM +0200, Ard Biesheuvel wrote:
>> This fixes two instances where a pgprot_t is used as the operand
>> of a bitwise & operation. In order to comply with STRICT_MM_TYPECHECKS,
>> bitwise arithmetic on a pgprot_t should go via the pgprot_val()
>> accessor.
>>
>> Cc: kvmarm@lists.cs.columbia.edu
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> 
> (I guess it will go via the kvm tree)

Yes, I'll queue it.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-01 10:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1435680290-13945-1-git-send-email-ard.biesheuvel@linaro.org>
2015-06-30 16:04 ` [PATCH 2/2] arm/arm64: KVM: fix two build failured under STRICT_MM_TYPECHECKS Ard Biesheuvel
2015-06-30 17:03   ` Catalin Marinas
2015-07-01 10:56     ` Marc Zyngier

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).