From patchwork Thu Oct 5 14:35:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 821838 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="gtcVb/7m"; 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 3y7Fhn1s9Lz9sNr for ; Fri, 6 Oct 2017 01:36:57 +1100 (AEDT) Received: from localhost ([::1]:40182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e07Gh-0002Iq-8a for incoming@patchwork.ozlabs.org; Thu, 05 Oct 2017 10:36:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e07G0-0002Gv-MC for qemu-devel@nongnu.org; Thu, 05 Oct 2017 10:36:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e07Fv-0001sx-W4 for qemu-devel@nongnu.org; Thu, 05 Oct 2017 10:36:12 -0400 Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]:56424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e07Fv-0001sK-RY for qemu-devel@nongnu.org; Thu, 05 Oct 2017 10:36:07 -0400 Received: by mail-qt0-x232.google.com with SMTP id 34so8618267qtb.13 for ; Thu, 05 Oct 2017 07:36:07 -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=95+f3I17oa+hAr3IQ9BfOqpphaiQAkB08avVzG839m8=; b=gtcVb/7me/Pd6xxk5y3KhL3w2XcHG5cYT3t1dvOY3jhUvLJUMI+YS0MZ6G0R13QnJd e0S6D3jZVXFk7lpgqSyI0tKWBUT4oxZYEGMKHrFlp/Oxew3z0McPzkGGKTNcd3Vbi7Kg 17YaqWBoD7KOuDmg1hN7NKh8lRLsZsiaoUrv4= 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=95+f3I17oa+hAr3IQ9BfOqpphaiQAkB08avVzG839m8=; b=AW9CuTlc1OPIm/Rusr+G+6vhMgKOAvBNp/9kWpgHAB5gq33OuejxxwtWm07094Sg3b atFNFdSNBS+u5mr4RmqVlqcqhG9rVw8Y4HSFmjKfb7XD4AHVM1bTkAWWtdgrbDarkbel xFul7TCuBq5ok7+SKozTUPS2OOZIhlB61Td8wUrvi+qWMw4ysapWPs+Q/Vyv4eRJqzKO i3HHQmMKVx+a/9fDe3+tfWBXwf4dsIWgsAqxi9E6dSvKpXeGhd+Q304umRubgz4pm4+I ei8n3QZFgzIqMmFi1QxcmO4BX0Y/jJPX0A2/J7dohAKJtm6RhgPmwVxe7P1vzEddzkbS nygQ== X-Gm-Message-State: AMCzsaVrBuJ/1eIe/mA2Yi7z7SlpkiDiOjVpgCtmUcqn1B0x9O+kVL9I XHoygaYT0AhDwEjvcOA0CuRFiISfUSI= X-Google-Smtp-Source: AOwi7QAuBbDrkFJlcNnQAjnkgu35ZUj63H9hRgZ0Qf7YGvxbNzWUMoUubYcR2G646eD463Ddlq9hFw== X-Received: by 10.129.175.83 with SMTP id x19mr5238617ywj.289.1507214167032; Thu, 05 Oct 2017 07:36:07 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2606:a000:7a4a:b100::1b]) by smtp.gmail.com with ESMTPSA id c13sm8277148ywm.101.2017.10.05.07.36.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Oct 2017 07:36:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 5 Oct 2017 10:35:58 -0400 Message-Id: <20171005143601.21584-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171005143601.21584-1-richard.henderson@linaro.org> References: <20171005143601.21584-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::232 Subject: [Qemu-devel] [PATCH v2 1/4] 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@linaro.org, riku.voipio@iki.fi 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 Message-Id: <1507047703-10774-1-git-send-email-peter.maydell@linaro.org> Signed-off-by: Richard Henderson --- 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; }