From patchwork Fri Oct 25 14:21:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 177747 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3788213ill; Fri, 25 Oct 2019 07:31:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqztUXpkgEvgbKU8HnCuBHISGZDOpxiR7Rsb6Mlx80hZQ+Xv2qrds7xVHhBMywYikeQPb0Bs X-Received: by 2002:ac8:7007:: with SMTP id x7mr3205943qtm.89.1572013887322; Fri, 25 Oct 2019 07:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572013887; cv=none; d=google.com; s=arc-20160816; b=egnS+x9CzGaiTe4wQszi7fRIbDdMSwV5Jvunr/2mIaJ5bLz6JpecNudzl59xpCLNtz /3aW+DcTsPXuebent5RnqT9NKKqp0KKfCdwHK5FKaZ+9ilJk887dslHSKwi+9OalmTsl FedCXGIRnSviwlYHN/HIRXL1V9rfWzUc8ZOPHd13xdBj+jdgn3crG5G9TR2/i+WM03xm cMOeK+C2Z2LQPKIrc7HsDFEV6uohFUHX0Z9W1q+RT24MnRVgzlPdzv5kddXkWAaBke/s kniD4onO2zmN1kB0nYhUXW5Wj14+gzcuQtb8ZyC3ms/toExoyQ5vCNr4PCBp+4q5doCZ yFUA== 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=JK6Z8vGB9Rw3osrNEIyf9H+8aSvCTAjejby4jJ0TjaeVtG6QS5eyxwtbdIKLdSeyVq 23Z64fqrZIqeCtRHSve7tqrabXsXoV2NqKkDJ37lg4oqTqHYqFxOIB02OU4vfDj0YSiI XnB+/pvdtf1xoqmFfNh28dzzuYQU4fjDNqJN/tzcYlaDYJ/SWCK1OHkSEiJmw7wchfMr ECzrbACKGErNhgY4K4EQsS21jdEvP4UpaetQfObOLl+KfFP9jRfG+UJWzUu3ZgMZ6T5c ZBMFyFyST702lc2w4kn0NVMa+7D8Up7IEdTIdaTAqM8Q9nG4si91wRVVsHyDbLe2pWde j4RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NKHdQx3W; 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 z14si1659714qtm.393.2019.10.25.07.31.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 07:31:27 -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=NKHdQx3W; 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]:32890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iO0ce-0006C8-Rv for patch@linaro.org; Fri, 25 Oct 2019 10:31:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44304) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iO0Tf-0004zz-CK for qemu-devel@nongnu.org; Fri, 25 Oct 2019 10:22:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iO0Te-0001bm-70 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 10:22:07 -0400 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]:42378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iO0Te-0001bU-3H for qemu-devel@nongnu.org; Fri, 25 Oct 2019 10:22:06 -0400 Received: by mail-qt1-x836.google.com with SMTP id w14so3450665qto.9 for ; Fri, 25 Oct 2019 07:22:06 -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=NKHdQx3WHGsT1oovR+8zWm0MC0caxY7W2vBEDb8/QV/jg+IEudIICMPSugi1BDWdIk bX7J0lpZxdAk1DPNxkqlpmheARYeiHCgo79up1+lYQsDOvHhDwYNFqy8tb6C/xGBh6rx D1bLqDumpRBteAVV+NXp+iysNDrYJUrS4lL/LG6FUXer+wzleqZ/2PiNAA70kgx/UxFW P5anqgU1K9WEAZ3DfETLkb0gA2zrj+39mR1yOQWdwz4NAJoH31zLi3NiYRIBZu5fm3Y6 Saa8fRCmJM3vup4adb4rmo7BAdC4ltb/p8SUVL3syLAHxeO+pXxkzF5Ofze27L+XYroa W6Vg== 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=GXHExrxnO2kKX24Rtku7/r09NMWSPCNdCbG+snBuEsVqhnzTmbGcRDeUyOLaAS4i5I e3kI2qMxqzPB/Qj4Blu19WtVsC0QTZNb8uKNGWrHOmmjY2uoOuavRH6zCeEq1DkQG/bn 8CxnL1MYLxptBOSXPLUxHfI0gm4s0dkB/s7Ag4zseL+uI4sDxhj+de7XbfRnzSI9YE/S 3Upyu8UZOYdsXzf1apoWZSqm4sxfCbJVrJ9Bf7dxRByr/V67vjj/9OHZuguuItkoXwJh Jvs7icOGn9cKBcTvpdtRpoH7HPHSCtJjVxoBYPd4ng/QNC0L4GS81OuF9skfUkFrC3Hb RIwg== X-Gm-Message-State: APjAAAUbJIxypvteYzV/+YXwmJ+84ZIlLSfv5BhwlrE1iW7P0cXMzp/M +/p67UawBrWn7BH7bs8XvkfjjuIxNQE= X-Received: by 2002:ad4:4583:: with SMTP id x3mr3500514qvu.162.1572013325031; Fri, 25 Oct 2019 07:22:05 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id q17sm1137050qtq.58.2019.10.25.07.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 07:22:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/12] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN Date: Fri, 25 Oct 2019 10:21:50 -0400 Message-Id: <20191025142159.12459-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025142159.12459-1-richard.henderson@linaro.org> References: <20191025142159.12459-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: 2607:f8b0:4864:20::836 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