From patchwork Sun Jun 4 17:34: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: 771011 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wgmBg2Y14z9s0g for ; Mon, 5 Jun 2017 04:07:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DKwL4913"; dkim-atps=neutral Received: from localhost ([::1]:57966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHZw9-0003Yo-2h for incoming@patchwork.ozlabs.org; Sun, 04 Jun 2017 14:07:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHZS7-0008Gw-UI for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:36:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHZS5-000405-Ap for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:36:35 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:35824) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHZS5-0003z2-4l for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:36:33 -0400 Received: by mail-pg0-x242.google.com with SMTP id f127so7257052pgc.2 for ; Sun, 04 Jun 2017 10:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WL1hZoy4boXIdWsTYPmxEBfEFKVBziZ+X95eyyvv03Q=; b=DKwL49139VlEgL3y/P23zhJq9fVViNWCP2vUo+37NDNdaSpwuYjku1j55pAVXlEYDZ pe03o8RyHGhvRgoC7Z42zKKK/Eq9WywlfggKLLm1hKyoBqADN8TQaRvGH6kBuopxpwD6 1Gk+QNwUQ7kBfXYZJcU3cwZ2RctamuXpZq6TGZ9OqbppfcbBmx0ZpEYvWxbuBHsmpEdu uIyU+rXEwjREP6e0YTBehQV0Fa6Y74OUyQi/+kXfmM1z8vRQ/Zgndfl38OCRrw9CeZQB 6pu04W506+fqUyNATLpDQ9hmdJzLq6wImwqAWTqeygZJFzfXMnYvUkL+PcFtEWNDCYx/ S5cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=WL1hZoy4boXIdWsTYPmxEBfEFKVBziZ+X95eyyvv03Q=; b=suEuwGKFYBLBhc2N7gv+ivlBHOFOZvRoYMFi90YuC2zSy1yyl9qeYGBRFekHJHWEMA 5xBjKnpbOuTAybxiCxeK1zd/nDxNpseYYuAIwQKuUeDlKSrYmRikHrK07GVuijEGFXWw RhxHU+01qmeyWcLaPBvGsmBxE6V7mrTVh0CWJhycp0ZnMJ+/8apj41rYmrl0dZ8JHljv Jh0ZGCHVMuEpKtxMwvLgHByLEoQC2laXHepe7seWsbY+3lgCNZnt1ISFWaawvl4PjlCz hqlROGExEqdnOETEuvjV/IahCR8waL8rbKLuQznU0UNT0I4ALVh3UzwhKLBEikRDOFIK JOkA== X-Gm-Message-State: AODbwcBYWHQAtZHc4A6P4/5R0wLtcvU7tS/Tx+huGhqVfZz2LFXUsWI9 0UCpsSF0AOUTVgbVeeM= X-Received: by 10.98.88.196 with SMTP id m187mr1111098pfb.87.1496597792081; Sun, 04 Jun 2017 10:36:32 -0700 (PDT) Received: from bigtime.ASUS (cpe-98-155-27-246.hawaii.res.rr.com. [98.155.27.246]) by smtp.gmail.com with ESMTPSA id j191sm52854419pgc.53.2017.06.04.10.36.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jun 2017 10:36:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 4 Jun 2017 10:34:58 -0700 Message-Id: <20170604173509.29684-59-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170604173509.29684-1-rth@twiddle.net> References: <20170604173509.29684-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PULL 58/69] target/s390x: fix adj_len_to_page 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, aurelien@aurel32.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Aurelien Jarno adj_len_to_page doesn't return the correct result when the address is already page aligned and the length is bigger than a page. Fix that. Reviewed-by: Richard Henderson Signed-off-by: Aurelien Jarno Message-Id: <20170531220129.27724-20-aurelien@aurel32.net> Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index aaa347c..6dfa087 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -61,7 +61,7 @@ static inline uint32_t adj_len_to_page(uint32_t len, uint64_t addr) { #ifndef CONFIG_USER_ONLY if ((addr & ~TARGET_PAGE_MASK) + len - 1 >= TARGET_PAGE_SIZE) { - return -addr & ~TARGET_PAGE_MASK; + return -(addr | TARGET_PAGE_MASK); } #endif return len;