From nobody Tue Feb 10 19:17:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1571849430; cv=none; d=zoho.com; s=zohoarc; b=Iubix9Yev6ZtossX18ZHWzx2EMR5UodfVIOLSFTiFLvlbHmY0dm7q3YmUZiGfJDMVeaqmhOqzjOfRGAZLR8VlmDzHfa1/rdPcNV8XigyOHiiDB7Vujl6yUwDlpzhpo70ib1Bwq5ll98hkM1s1Mb+vZLXAxhGOiVy7+HXMFlqfiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571849430; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=VdwoVOQvGjyK5xwO9CwTmTvaoS1oPRDJG2i202FKHeA=; b=KcJH1WvSwRbKKOpyMYXEMyr3u7gIPB3HaJza/nm+EKKL5y3LGUMP3nnCXDctUmyUDKOGZvvWJxd5EwyeQ7YYbzI33FLB2ahulVCCpr3tXe5qn2Vym0J4cdvW3aS8UB9BUJNm40WUWDOkihVQqo5cjd6XBtvWn/JBzi533i0O5JM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571849430607302.5743394614269; Wed, 23 Oct 2019 09:50:30 -0700 (PDT) Received: from localhost ([::1]:41662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNJq8-0002qb-Ch for importer@patchew.org; Wed, 23 Oct 2019 12:50:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42496) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNIp1-0004cO-3T for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:45:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNIoz-0005RH-33 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:45:14 -0400 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:46766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNIox-0005Ki-2p for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:45:11 -0400 Received: by mail-qt1-x82f.google.com with SMTP id u22so32898232qtq.13 for ; Wed, 23 Oct 2019 08:45:09 -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 o1sm2456272qtb.82.2019.10.23.08.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 08:45: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=VdwoVOQvGjyK5xwO9CwTmTvaoS1oPRDJG2i202FKHeA=; b=K3Y/xAHulnNNkqoZ/f937AsEOym8U2bSpJC+sPBBbW+dYInTBLMUarGjWz/8pd3Fto BqzAZleXOIMYOnW79c2Kk5xoEdMp79nwd9yBk7M5YciIH5SyoviOKAJhyGjmlhUB9hjy g775Gf07wETmxgEuzSCy0j37hpPqANcbYLNQ6fF0QDwV2lyVmcdg8Af2xgR59TphVPSV YAsjidGwfzRGvQ0a7fG/Nbhoic2TMgTpOR530Jhxh3yM6Dbhpq8PsqYnvT8C0us86r4J Pt6akoAzwDHrURwgNGVjt2nRXB5CAwde8XHmjWHl3HIOxiaugQtjBsaV+FY2OsZr/J2T k8jQ== 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=VdwoVOQvGjyK5xwO9CwTmTvaoS1oPRDJG2i202FKHeA=; b=Y1xfFbPY/5QHUH0170WOqpJ3joNow5+xINe/2gbhqokSLzX+pligL4MI1LaX7l/E8T 3nJ0rFYV0fTddCtHWyFswMyY8l9S4ckqSMf/+7kKBagoRkYfUaNkcfPoUGBTbUhaTtII 7p+TMrcAaRSCZHeLyStbZuG78w+J5xqGD8GrmPDLhuHG4mPzd+Bnrxq52RUnXYmKW7W6 btHV4gqEnmEgXDf59yT6vXeZ6D5cUu6CL1NvoLfH/03EZNZ++zSIJVAMV89oJyTt/wbs fAxdxvwZ91lVfNvn8e+gbDjhFxuN4LkjY4pcR9gZlqXMP6p0fpeVZsKKZVATlV7MVBTh XPuQ== X-Gm-Message-State: APjAAAWHlA2xL4YtKegi7uuJ8tVcE54euWajZLkOoqTTgt4lpYVtwY72 EreyKb1c+d89ovLEh/Qq1nKcViiiwVY= X-Google-Smtp-Source: APXvYqzRWKfHdcLWb0b285JXTRO/5Zi7ypt4kW927Gpob4oTKwjRFeyOkes6JX1ttBU5zswG6e1uGA== X-Received: by 2002:a05:6214:1ca:: with SMTP id c10mr5266708qvt.233.1571845508689; Wed, 23 Oct 2019 08:45:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 1/7] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN Date: Wed, 23 Oct 2019 11:44:59 -0400 Message-Id: <20191023154505.30521-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023154505.30521-1-richard.henderson@linaro.org> References: <20191023154505.30521-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82f 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: pbonzini@redhat.com, alex.bennee@linaro.org, Wei Yang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Wei Yang Use ROUND_UP() to define, which is a little bit easy to read. Reviewed-by: Michael S. Tsirkin Reviewed-by: David Gibson 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(-) 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; =20 #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) =20 /* 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; =20 -#define HOST_PAGE_ALIGN(addr) (((addr) + qemu_host_page_size - 1) & qemu_h= ost_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_si= ze) =20 /* same as PROT_xxx */ #define PAGE_READ 0x0001 --=20 2.17.1