From patchwork Wed Oct 18 12:33:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 827575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="VaHAXOwS"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yHBRF3mRqz9s2G for ; Wed, 18 Oct 2017 23:37:45 +1100 (AEDT) Received: from localhost ([::1]:44444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nbT-0007ue-KO for incoming@patchwork.ozlabs.org; Wed, 18 Oct 2017 08:37:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXW-0005Do-TA for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXS-0003vp-UP for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:38 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:52727) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXS-0003vB-N5 for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:34 -0400 Received: by mail-lf0-x243.google.com with SMTP id b190so5601045lfg.9 for ; Wed, 18 Oct 2017 05:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gUAeEh9wE+ojaTv6GqbhCwzU/vQr1pJisavwD3/RGww=; b=VaHAXOwSxhRWFO4I8wLlFPLJLzaRpVAdUEgN2ZJ6H5GOa3moYx5DPEPtLi3ZdBaUxR Ft7XHi8+zcJTRjLHPxTv54FUtKo6B7k6blx0jXbFwxop4i+43IpLx8BRZhT6bh2SiyOx IfJzH0sXyUo4GWIWf7SUmeS5efkDN7fWCwtSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gUAeEh9wE+ojaTv6GqbhCwzU/vQr1pJisavwD3/RGww=; b=g21f2WCsmHDsHneuW/pbUsMqCrz0zQf3GGbwQB33YDGw75ErdiYMngm0Ed/QS2Y0E8 zXYKqe7qCgnSaXNE3EeO3UV6gx5xkGDGTyjqpvBYVkgE5+IZOm8w06b2xIqnoHJ2Zy/3 kGhhA4vh/E3EilP8Ka3cmo6jPNqeFaEtig0XAwlP/o/UnVTCD8Va0EZF0i3fd1J2FVvd bC4abjdiuTxC1ThERKfdH/dncKYwdEEFUJWm3y/OCowJRhOeVO1qTbDy920i8C6/1iq7 BqTsUPx8jBkmbhJhYgqI9Qas6tg133F/7CmH4SwYIuD1E9NbvJV+gl57r/cuGv6Nb35p AyHg== X-Gm-Message-State: AMCzsaWQbwECUJ8oY7HbO1zWHFRC5TIxO6qIM5i1klgX8cRt1jWKgnPt tYTTZaJg/INmmYDXYSx+awy5rxnxikE= X-Google-Smtp-Source: ABhQp+TafHsnVMH5jKGZzpKy9S5u/cXt0NbT38oQQsvIjHwmSvAIY3I1BKBTb9kBcOlqaZv6IwMgRw== X-Received: by 10.46.70.18 with SMTP id t18mr2346143lja.148.1508330013238; Wed, 18 Oct 2017 05:33:33 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:31 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:18 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 04/10] 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: Peter Maydell Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell 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 <= 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. Reviewed-by: Emilio G. Cota Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- 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 79062882ba..3b857fbc9c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -377,7 +377,7 @@ static int validate_guest_space(unsigned long guest_base, * then there is no way we can allocate it. */ if (test_page_addr >= guest_base - && test_page_addr <= (guest_base + guest_size)) { + && test_page_addr < (guest_base + guest_size)) { return -1; }