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: 9987351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 636376029B for ; Thu, 5 Oct 2017 14:37:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A8BF28C68 for ; Thu, 5 Oct 2017 14:37:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F5ED28CA6; Thu, 5 Oct 2017 14:37:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D69F528C68 for ; Thu, 5 Oct 2017 14:37:29 +0000 (UTC) Received: from localhost ([::1]:40182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e07HF-0002Iq-3X for patchwork-qemu-devel@patchwork.kernel.org; Thu, 05 Oct 2017 10:37:29 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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; }