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: 116284 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6017010qgn; Wed, 18 Oct 2017 05:38:54 -0700 (PDT) X-Received: by 10.55.17.33 with SMTP id b33mr2195137qkh.58.1508330334575; Wed, 18 Oct 2017 05:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330334; cv=none; d=google.com; s=arc-20160816; b=SP36+kbEpBYTNJM9tRDbtpE+c31cRxz9ur8GoedL2pRbn8RO9aRk6pjbuGX8/8jSqb rOS77gb5dkHWEARmoM3+XF/QWHMDJWI61yTY5BIJqYt1TU/nselW24LtJqKFpJDivW13 pOXvK/IMg9BVYQPG7/ceNbD7X+FlTEfsoU5fP8+XPogH0BgdSgvh3vvY701Dpiubl/SH K/pewkcgT0OQDzzj2lqyGYGPKahTe3+04yDihCdIw9bMXuNfiY9alrDWdhfoLPQC/jV5 Okm0QIZICGwrcfJvp/9RY/c9TOoXNfXKdlW99hPsFYLA/9XJHaqK8kbax+T1xhWZTO3x TtDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=gUAeEh9wE+ojaTv6GqbhCwzU/vQr1pJisavwD3/RGww=; b=cG4i/bLFFR+xodRe35SveOMWPpBL15Witeb7w+2qG9XqF12jltuEF4pezuQeMw7SKl gdv8ykHh2lF66zJbhrL66d4E8Hi+sTjt+nHRa1UzOPypIZAdPbRNTs6FfKfuO+GOUPUf iy2F7fEXSv9TNh0VsrMsstJAnrvGk9WeG5Gjq8VnfGVyITg6jugTSoRz1DuS5+8QpB3q e2Pgz7t6ps5sFnDej03foY1hHkmFDTjOGFNYBPtqmOkwQ5GB4RrLFcY8CC3cweTH8zlS WrEWncvAhk4X9lccsbxzI4SRrhhW0Gut7kb4K2LokTb1eCTs5p4BtnFUbeVoxWgK2N57 3vsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VaHAXOwS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b29si3988165qta.377.2017.10.18.05.38.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VaHAXOwS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nca-0000Mj-Ga for patch@linaro.org; Wed, 18 Oct 2017 08:38:52 -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+patch=linaro.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(-) -- 2.14.2 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; }