From nobody Mon May 6 02:05:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507047730176136.10092640328526; Tue, 3 Oct 2017 09:22:10 -0700 (PDT) Received: from localhost ([::1]:59425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzPxF-0001pe-CG for importer@patchew.org; Tue, 03 Oct 2017 12:21:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzPwN-0001VV-Nm for qemu-devel@nongnu.org; Tue, 03 Oct 2017 12:21:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzPwM-00017i-TF for qemu-devel@nongnu.org; Tue, 03 Oct 2017 12:21:03 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dzPwM-0000yV-MK for qemu-devel@nongnu.org; Tue, 03 Oct 2017 12:21:02 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1dzPwC-00070e-GT; Tue, 03 Oct 2017 17:20:52 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 3 Oct 2017 17:21:43 +0100 Message-Id: <1507047703-10774-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The 32-bit ARM validate_guest_space() check tests whether the specified -R value leaves enough space for us to put the commpage in at 0xffff0f00. However it was incorrectly doing a <=3D check for the check against (guest_base + guest_size), which meant that it wasn't permitting the guest space to butt right up against the commpage. Fix the comparison, so that -R values all the way up to 0xffff0000 work correctly. Signed-off-by: Peter Maydell Reviewed-by: Emilio G. Cota --- linux-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 7906288..3b857fb 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -377,7 +377,7 @@ static int validate_guest_space(unsigned long guest_bas= e, * then there is no way we can allocate it. */ if (test_page_addr >=3D guest_base - && test_page_addr <=3D (guest_base + guest_size)) { + && test_page_addr < (guest_base + guest_size)) { return -1; } =20 --=20 2.7.4