From patchwork Sun Sep 22 03:54:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174197 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1305264ill; Sat, 21 Sep 2019 20:58:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaBMsHV66YORUVWbuUR+5ZEkirXfVhKahJ38k5qN2XZIk50cBjBGz+KPUZgo98ccngmXQ4 X-Received: by 2002:a17:906:f51:: with SMTP id h17mr24880189ejj.197.1569124704087; Sat, 21 Sep 2019 20:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569124704; cv=none; d=google.com; s=arc-20160816; b=WEjaH9Xy2IFMLtk8vg6cRfoMy0x2rXROQ9GwV+8E4wvclkFCnZXrNQ/JVV/HwZDzn8 WrEx1CFEFyNUKl+57tvwmKn7LZ/WKKcPonM/TD/QBvN9Zg5MBBh1/PEhHBT+ESmF8I3H 9fQdcv7Sp2h5VhgzcydGwbU8Yno1jD2qDTrXz6pMevvN+Pyo3Mz5Zhv94/jITX3X2XEM Pm1ZGDtifGjyOazuSB4Ax8RFYr//tHP0vYY4Po/2qK3PoQp/tjDb9jyqgUM4+YmfSN+J hZS0dEcMYvz0lLXO8enQkGsdRcjyevO/0HJO2KEaw3Nz2LyH4OBEB95p0GDNOl5815qO 9o5w== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=W4TalZMvNpabdLXEj4HQqHc5U6U5Ly8Q0gdLiyGbKsA=; b=W10SvyqztHaCltKoQskOmoOKdixAOUKTQ47lbsVMRWyIqiblWlbtbhqSiqTjdVLJAP 3tnxBZDS8DLxYZPy6oatrn4X4T9TChMmYFZNagTN/G9rv8cB7vTfHTb6eQJXquGiXQfJ qaL3XVsfhQvMf+yzgPATeYL2BbQuWGrsNFheEK1bnwDDyxNOc79wyPW32FnQVOqP4QAd DFhiG7E75MGLp34dEJdwGFUehIaosC+Q3ABuiPx2LLCs/0loLlJTCUbJ+yJUS3+IIBj3 s4KIZM0Ht28fMPXCyKuNRY7kKIpJirUxbK5Wl7zBIPLUHbYejhaPjO+B0KADhkr/8NyG +c8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=x8p780Cb; 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=fail (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 b8si2483742eju.351.2019.09.21.20.58.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Sep 2019 20:58:24 -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=fail header.i=@linaro.org header.s=google header.b=x8p780Cb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBt0w-00055H-VA for patch@linaro.org; Sat, 21 Sep 2019 23:58:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40834) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBsxr-0001RP-0N for qemu-devel@nongnu.org; Sat, 21 Sep 2019 23:55:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBsxp-00087o-LR for qemu-devel@nongnu.org; Sat, 21 Sep 2019 23:55:10 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:37467) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBsxp-00087S-Fn for qemu-devel@nongnu.org; Sat, 21 Sep 2019 23:55:09 -0400 Received: by mail-pf1-x42f.google.com with SMTP id y5so6991129pfo.4 for ; Sat, 21 Sep 2019 20:55:09 -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=W4TalZMvNpabdLXEj4HQqHc5U6U5Ly8Q0gdLiyGbKsA=; b=x8p780CbKob8dCvUE8xsXqi57cfTErXtuStAryUfGLUqg/cWctViWjMIT5FCgyEWMS GNZ+WzMu9NypWIRV+NZSJTeQqzQciAN85seJulHg7T0HRND2P0kZ05LDfJIu3LLVlpgf lYzE4WjfcGy+aw23zqavaHJby5kleoTv8TcEzjImuEXr0WlZaU49OQ+P3oIbxkrQwwJh 6WZreK1W92wyLgkZpsXfSjznqULoe28tEDtkBQpOkcDKMqMlxDhPiIAYmcjm29U72A2m +fUeNyJXTZgW4r13JVhKlc8NykNi+8BWvaytKJBlQ2bbipFSdX+ygRK9o7FEen6M110o HIBA== 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=W4TalZMvNpabdLXEj4HQqHc5U6U5Ly8Q0gdLiyGbKsA=; b=mjTOw1Okb6uEOcwRYTCBZSDptKqA+P3kNwExtI235zTtIQtAhl6cgm0iFVgAuyEOGw JKTiwhSO+OSb6l8YDqYkIXV6Ae44izLA7sobKfXvkn1WTlCPFh7apqoF034gBkQutrrK YZ3aPvCkRXCgi7fQPwRaktvFd/4ohKLqm+FLW6+iFtQoC5joEZPUdDW9RteBeQUuz3J0 pEcRKgRMpxzvXSucDipXVSd9Rt2nT2KqSVgU9ZBFXIoHbJng+6tv31PW45ouAMhIGdVg tiW0KAKt108iG2A/fiPS9w/SNUpcPpdSBJW9hqpwDTNoYS4YWpE38mYp0cA2NCcuV/qv aTfQ== X-Gm-Message-State: APjAAAVLzcUdztQJn90Zg+WH7gKjotXcrazieon99cR/snNvSPVoNVfj y+nGwHC0XoFnHoRNMTzdUCaxxNYIszY= X-Received: by 2002:a63:724e:: with SMTP id c14mr23828003pgn.120.1569124508144; Sat, 21 Sep 2019 20:55:08 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id z4sm6452921pjt.17.2019.09.21.20.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2019 20:55:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 06/20] exec: Tidy TARGET_PAGE_ALIGN Date: Sat, 21 Sep 2019 20:54:44 -0700 Message-Id: <20190922035458.14879-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190922035458.14879-1-richard.henderson@linaro.org> References: <20190922035458.14879-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::42f 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, stefanha@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use TARGET_PAGE_MASK twice instead of TARGET_PAGE_SIZE once. This is functionally identical, but will help a following patch. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: David Hildenbrand diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 34d36cebca..5246770271 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -226,7 +226,8 @@ extern const TargetPageBits target_page; #define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS) #define TARGET_PAGE_MASK ((target_long)-1 << TARGET_PAGE_BITS) -#define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK) +#define TARGET_PAGE_ALIGN(addr) \ + (((addr) + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK) /* 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.