From nobody Sun Feb 8 18:29:46 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; 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=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1570933150; cv=none; d=zoho.com; s=zohoarc; b=YL0elGctujj0Lp8R/bt3MAN7zwnyr2CSzx730Y/V2yOBtyMJaZsgaNLZxa87oKbLcWJjMd5lnosZf0woa34dE5SZEsmnpQlitbjbffLE5E9tFZbdnbNHzUjnORxZva5rH2iQdQ8P57iEgScEaRnlkBESrgqZ96fihsuHQlHa3fY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570933150; 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=h7XtRxp6exnO96g1GKzw7lsKek3x/EsaoKCYo7KZgQs=; b=DwZug5vJYmigWsd1GvlRwlmrLRF3SuDMehNXXxaD0ShGAJ9YoAibO6Vv1KqUTr4dgH9yR86ko7iwgBwMLEWdQ+wBOhF5oSZc8KFQqpjwXY2CeMwAXqDGVQqTi25hWPBpUcViHLRmH0sMscDdv8ViyxKSUYyrlpBS4y4gm1ENxUU= ARC-Authentication-Results: i=1; mx.zoho.com; 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=fail 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 1570933150083752.5286917925848; Sat, 12 Oct 2019 19:19:10 -0700 (PDT) Received: from localhost ([::1]:37224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJTTQ-0000u7-T0 for importer@patchew.org; Sat, 12 Oct 2019 22:19:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57597) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJTPr-0006JO-H2 for qemu-devel@nongnu.org; Sat, 12 Oct 2019 22:15:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJTPq-00028u-CQ for qemu-devel@nongnu.org; Sat, 12 Oct 2019 22:15:27 -0400 Received: from mga09.intel.com ([134.134.136.24]:56369) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iJTPq-00020i-4J; Sat, 12 Oct 2019 22:15:26 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2019 19:15:24 -0700 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga004.jf.intel.com with ESMTP; 12 Oct 2019 19:15:18 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,290,1566889200"; d="scan'208";a="346407424" From: Wei Yang To: pbonzini@redhat.com, ehabkost@redhat.com, imammedo@redhat.com, kwolf@redhat.com, mreitz@redhat.com, stefanha@redhat.com, fam@euphon.net, den@openvz.org, marcandre.lureau@redhat.com, kraxel@redhat.com, mst@redhat.com, rth@twiddle.net, cohuck@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, mark.cave-ayland@ilande.co.uk, david@gibson.dropbear.id.au, yuval.shaia@oracle.com, marcel.apfelbaum@gmail.com, alex.williamson@redhat.com, quintela@redhat.com, dgilbert@redhat.com, armbru@redhat.com, sw@weilnetz.de Subject: [PATCH 1/2] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN Date: Sun, 13 Oct 2019 10:11:44 +0800 Message-Id: <20191013021145.16011-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191013021145.16011-1-richardw.yang@linux.intel.com> References: <20191013021145.16011-1-richardw.yang@linux.intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.24 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: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, qemu-block@nongnu.org, Wei Yang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use ROUND_UP() to define, which is a little bit easy to read. Signed-off-by: Wei Yang Reviewed-by: David Gibson Reviewed-by: Juan Quintela Reviewed-by: Michael S. Tsirkin Reviewed-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