From nobody Sun Feb 8 18:04:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496796982917983.6198005015367; Tue, 6 Jun 2017 17:56:22 -0700 (PDT) Received: from localhost ([::1]:40661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIPGn-0000O1-AA for importer@patchew.org; Tue, 06 Jun 2017 20:56:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIOtt-0003b6-KB for qemu-devel@nongnu.org; Tue, 06 Jun 2017 20:32:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIOtq-0002GL-Az for qemu-devel@nongnu.org; Tue, 06 Jun 2017 20:32:41 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:34084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIOtq-0002GG-6i for qemu-devel@nongnu.org; Tue, 06 Jun 2017 20:32:38 -0400 Received: by mail-qt0-x242.google.com with SMTP id o21so22863108qtb.1 for ; Tue, 06 Jun 2017 17:32:38 -0700 (PDT) Received: from bigtime.twiddle.net.com (71-217-91-69.tukw.qwest.net. [71.217.91.69]) by smtp.gmail.com with ESMTPSA id m47sm29286qtc.36.2017.06.06.17.32.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jun 2017 17:32:37 -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=2lMoQBesf/X/8TP6TkCMYxtcFzLxysSTVmgmNUtz1yE=; b=DnYEalkrw7Cqca0IIVu/XnAIITqbVB1diQxSYqJfzIhr6PXaxkzXtK+HILHIDN2A7q kPkepAu39sVrmFoDW2xncWO5yQU74Bg8hqSC3Do3M9EECxtmLdy0/wHpFOY0gnOQI9Y9 7jWVKICzM8TpknWtVAhjR0B5zGcAwqT2lvqnEqqovVpLklauPhvk1VZckoK6KcxeWmrh NcX3fXow8kfpoZXthsJbx2TK9POinIrYkV8cb7VaveNpGJi7zn2SvNOuZ0zgUrcaphaf c8HTmrMhQJUkWGOoFl2HAZtmrtQWhaKKuPNw4WpYF3UNG2sxJxG7qjyIpyfpEbrgOID2 B4pg== 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=2lMoQBesf/X/8TP6TkCMYxtcFzLxysSTVmgmNUtz1yE=; b=W8y20X1xsbpmfeq4/ac+ukUmIOvk/Zif8JRSmTQ9rfmRriDlHVHQV5JbpP2h6vBvt6 6ZUCYcjfOTJFJXAjwm+PH8EpnVY31E/5d9UUtKrZocNI8JYAycrQw0+vMFSag+FwsLtm d/xFObn0zA9yEDfV6MP0im+fTQcQMb6bMU60MGBj26MMLnvNAX0Qe1pLqp1J+Kz5rcKp E6UO3FqG6MZJScd+/5sBXxJk/H3PLVtarTOL3kzV4m1E7d9aY6SSNR0Fw5tUBTSg5XOe gkuAhYuuT6LLLnpvkdn5cxVQDYy8lBWhEQNfRSBVfTMtRhGaeOW+wxRIPq31pWmXEpih r/4w== X-Gm-Message-State: AODbwcDWN6ryGk0DiprwqE/iAe1GvVLIb5x/ZdoeuIOCIhUjhN7qNzId 472Z/nA/yfj1G14Ow3c= X-Received: by 10.237.48.161 with SMTP id 30mr36285599qtf.201.1496795557549; Tue, 06 Jun 2017 17:32:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 17:31:05 -0700 Message-Id: <20170607003119.14778-57-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170607003119.14778-1-rth@twiddle.net> References: <20170607003119.14778-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PULL v2 56/70] 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 4ed0b65..2326f0b 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, uint= 64_t addr) { #ifndef CONFIG_USER_ONLY if ((addr & ~TARGET_PAGE_MASK) + len - 1 >=3D TARGET_PAGE_SIZE) { - return -addr & ~TARGET_PAGE_MASK; + return -(addr | TARGET_PAGE_MASK); } #endif return len; --=20 2.9.4