From patchwork Mon Oct 28 14:59:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 177936 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3514816ill; Mon, 28 Oct 2019 08:08:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxikWm0/fbNEo/bgaBy+wSEiiX7nhvSmdTXFQheie5fzksajYMQktORqGVCMI9Oq85pET1q X-Received: by 2002:ac8:405d:: with SMTP id j29mr6300622qtl.332.1572275296333; Mon, 28 Oct 2019 08:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572275296; cv=none; d=google.com; s=arc-20160816; b=YIpz8rFsCGcYFo8ut/XKlGktPT4WLLJT0z174vndbaI5zVysMIoFEkbjyIHPZdS6G1 Ram1LdIJqz/Irh/W9dInhbEXvhAlT52Jk2QfIhnMeJzivJJXyhEDHB9t5y6J1WdZXn7I IDGz1eT4xN5vYo1aKuQnILwk3DIWQKmTGdbLbGmtZOZ13+yo0OjfIUyKaZcwO2nBXaFb lBHO6kM3ixa1bAYefdLhaZ/7xzPvyrTHp8oklYGUQjitSF9XA4yyO4MMeFa3sRplj0qf JSuGnjd5mFuJh2ezrS/SXBohd1x2hLJQZMWeqkPSYjWbbcG5Y6LfCmklklo+Ha5XHNTK i5nA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=VpK7DgB24L4FBN+Cv8MDDt0jG1tSba2F0aG6/IXjc+c=; b=tji/L4yYvZV/qYLFht+VieAZutLyctCVLZNDJaymz7zJgnvFGzQdwQkJu76iZznyfw dlqJ1eZKq3UA9beD1Rj98+gz/KFmL0etKskqYoZv6dA0J1biFnivanHZimBka+D3evaY gaLSG/zankzyYfsZ3ZAWn3aNkNqK4VOeUhGH8kam6kZGdCdxG3tT9s10a7uVVmFLwTzJ f7+/Em/q38QCcAn8KMJRe18hnutteTfbPjYp4WwgX6aKwFAgl45gKV0vLUHlC4GNqp5X TK5eAQBaE2m5MF7s+toTktEB7TyutnZ95st/lLem3AIFSeV/fQJnhzvZ4GsNbD9i4BgD uz6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LbCnU1ZR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j6si8981962qtb.368.2019.10.28.08.08.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Oct 2019 08:08:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LbCnU1ZR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP6cx-0000fr-4Y for patch@linaro.org; Mon, 28 Oct 2019 11:08:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44546) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP6Ui-0007Tk-7f for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iP6Ug-00042Z-UW for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:44 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:56237) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iP6Ug-00042D-Or for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:42 -0400 Received: by mail-wm1-x32e.google.com with SMTP id g24so9816023wmh.5 for ; Mon, 28 Oct 2019 07:59:42 -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 :mime-version:content-transfer-encoding; bh=VpK7DgB24L4FBN+Cv8MDDt0jG1tSba2F0aG6/IXjc+c=; b=LbCnU1ZRv9oIe+RislOCKhs5ufeTZyJcaziK9nPnrBR3KthTPqIpcX34vjdHDozppm UJR4LrtaTZ7W2ejIUQKAUyDuHhzVJFihFeU7nVbjwIoNNIfr/DkNvP5OgtXWuG/6Obbk RcvrAwKorky/8M4HHW0nBMzljKbd9y5+R3SiU+FkNSyWU99tqH210N0ft1IYxDf8v2Er j9ittXMRFiHsQplJK+VCXCM82/KNH7Jd/mTakwpNVOCt8U0pWKs+hvmP7g0leY2OlmWX VJ7VvvS2k5r4bCEsVknCq2JoUs1XuqMKTNSdDq5bxua5WBhECORUpE9U0P43yl4Y7v29 VX7w== 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:mime-version:content-transfer-encoding; bh=VpK7DgB24L4FBN+Cv8MDDt0jG1tSba2F0aG6/IXjc+c=; b=TzV95ClcDDH4NFwX2a0steakIZ7d9yDtf2cMGI+spv+YZ0YjV+1xmZfsKrCe3RhVWv 77dpvRZI0YN3TExtNehhV7SNmgiX6MrvdwytMl2QSUQNq0qzosvd/WmB9bwqfEtkVLwA mZ/7/EpbTW6C9T1z2p/aWstQ/jC8YMeGZ7E5AgkLzYVvDrItk7rkGbaBbst4JnFfrM6P UVF0xtCl5KR79POUNZc2LQdoIm/qKWmlyKmm6hNoHimC+oUyq7srLMS4vo4UV+3AfAh/ Za1PNnmzBzxx2IFAKFbGlPI+3AgJU3+L+kSYu+LDZIDMkAMmiE4/p3mZ+EG7GLUxUmF0 yIUw== X-Gm-Message-State: APjAAAWG3qWSK0wEfCcTrlXOjKcuGZm1Xr+bLV0Jp3eT3X6RedIDzPFY QrJx4Y+JlY93jFvHrBb6UROpHgH0BXajuA== X-Received: by 2002:a1c:234c:: with SMTP id j73mr386073wmj.51.1572274781548; Mon, 28 Oct 2019 07:59:41 -0700 (PDT) Received: from localhost.localdomain (230.106.138.88.rev.sfr.net. [88.138.106.230]) by smtp.gmail.com with ESMTPSA id 143sm14842876wmb.33.2019.10.28.07.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 07:59:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 03/12] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN Date: Mon, 28 Oct 2019 15:59:28 +0100 Message-Id: <20191028145937.10914-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028145937.10914-1-richard.henderson@linaro.org> References: <20191028145937.10914-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Wei Yang Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Wei Yang Use ROUND_UP() to define, which is a little bit easy to read. Reviewed-by: Alex Bennée Reviewed-by: Michael S. Tsirkin Reviewed-by: David Gibson Reviewed-by: Juan Quintela Signed-off-by: Wei Yang Message-Id: <20191013021145.16011-2-richardw.yang@linux.intel.com> Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index ad9ab85eb3..255bb186ac 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -220,7 +220,7 @@ extern int target_page_bits; #define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS) #define TARGET_PAGE_MASK ~(TARGET_PAGE_SIZE - 1) -#define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK) +#define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) /* Using intptr_t ensures that qemu_*_page_mask is sign-extended even * when intptr_t is 32-bit and we are aligning a long long. @@ -228,9 +228,8 @@ extern int target_page_bits; extern uintptr_t qemu_host_page_size; extern intptr_t qemu_host_page_mask; -#define HOST_PAGE_ALIGN(addr) (((addr) + qemu_host_page_size - 1) & qemu_host_page_mask) -#define REAL_HOST_PAGE_ALIGN(addr) (((addr) + qemu_real_host_page_size - 1) & \ - qemu_real_host_page_mask) +#define HOST_PAGE_ALIGN(addr) ROUND_UP((addr), qemu_host_page_size) +#define REAL_HOST_PAGE_ALIGN(addr) ROUND_UP((addr), qemu_real_host_page_size) /* same as PROT_xxx */ #define PAGE_READ 0x0001