From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] ARM: KVM: Fix size check in __coherent_cache_guest_page Date: Sat, 07 Feb 2015 22:21:20 +0100 Message-ID: <54D681D0.8040309@web.de> References: <54D670EA.2090504@web.de> <20150207202648.53857923@arm.com> <54D678EA.90803@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HLKDESl1mmchoL5fm9rADA5bK96ETs3ts" Cc: kvm , kvmarm , Christoffer Dall To: Marc Zyngier Return-path: Received: from mout.web.de ([212.227.15.3]:63936 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756021AbbBGVV3 (ORCPT ); Sat, 7 Feb 2015 16:21:29 -0500 In-Reply-To: <54D678EA.90803@web.de> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HLKDESl1mmchoL5fm9rADA5bK96ETs3ts Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable From: Jan Kiszka The check is supposed to catch page-unaligned sizes, not the inverse. Signed-off-by: Jan Kiszka --- That resolves the crash, but the guest still doesn't boot (it does when removing -enable-kvm). Examining later. arch/arm/include/asm/kvm_mmu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mm= u.h index 1bca8f8..90052de 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h @@ -186,7 +186,7 @@ static inline void __coherent_cache_guest_page(struct= kvm_vcpu *vcpu, pfn_t pfn, =20 bool need_flush =3D !vcpu_has_cache_enabled(vcpu) || ipa_uncached; =20 - VM_BUG_ON(size & PAGE_MASK); + VM_BUG_ON(size & ~PAGE_MASK); =20 if (!need_flush && !icache_is_pipt()) goto vipt_cache; --=20 2.1.4 --HLKDESl1mmchoL5fm9rADA5bK96ETs3ts Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTWgdAACgkQitSsb3rl5xTlsgCfU3LeJLUbe0kE0an00iRVolr7 ZdAAn0rNKF34wzSDmZl8lPF4gpMy7vX8 =Mkt8 -----END PGP SIGNATURE----- --HLKDESl1mmchoL5fm9rADA5bK96ETs3ts--