From patchwork Mon Aug 22 23:23:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 599204 Delivered-To: patch@linaro.org Received: by 2002:a05:6918:5e84:b0:d4:ea33:5523 with SMTP id nd4csp2083212ysb; Mon, 22 Aug 2022 16:25:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR75f2yiA74tfp1EJ3vtCAVFT5u38PxhqPvrftCIMbqY2gIvt6II6oHEJUMnOJXTLh+KH8EY X-Received: by 2002:a05:620a:56d:b0:6bb:af44:3d6b with SMTP id p13-20020a05620a056d00b006bbaf443d6bmr14327882qkp.517.1661210740292; Mon, 22 Aug 2022 16:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661210740; cv=none; d=google.com; s=arc-20160816; b=D31KOSSSB2CIw3+ae0MhdTODXqOxoCCFWJAdYj+WJg8ocdpq7VheYcaFWIZF1fCZdF /Hhp2u5vZrdEP8ngCIv3saV3yZX9xNa8zpgp/PEV41GEU+MoI5SZpf5QBHbudZ/IpRdR TucmI6OiYKYuDLXQIosCZJg7ObUhGpdZhkuhuNmvS3PPK3WxSm1jC8oI+hiuLN2tN8Tl jg7WIOvGE9x51AtLxtOT6g6pHTjmKnySFQE5H6w+BD/JnVStSQBiaJ061jHt5ssRuAJV Z+sigf95o7sPf4TVKwApeZKuzLFcNIjKBIn+DLDhMV3aY0qXNLoZWugyHZ1z9gfhtHOX h46w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=eMqYEALQlNCHryVYkn9ayeWYJiH16krDhtfDzKR3N+4=; b=1G+LeDM8HfNKm1kPgWURDn5yAvTCOhXHLF1l7DnK31Eq7qsqitSS3Xrn9yHqPKDG7f owmabDNsMWuIP4kKnhRRusme3thR3gXC4o7ozT7rrazOfCK5AuFvGBIDCSWWFSZ8sGKw osHI1oDhwvKxC98Pi6xzN8Zq75Ijna7H6J9PyREfKPEXhbveAQ3Z7QdX6JxL17lw+MD9 /kguNNgFNaL3RbHcEl7pidhavKKpbi9/wbOWyirTnjlZvVTLUGc6iaYPGf3Z2nLg0N54 3Vx63MOKTTtDIbNA+nSMMzdoiKp6WzYkO4Tdkn0AhH1u8de+ao/GJpXyYEVDx+pJ3QmI A3yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TYQBcK0M; 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 a13-20020a056214062d00b004746102b1ccsi5390186qvx.489.2022.08.22.16.25.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Aug 2022 16:25:40 -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=TYQBcK0M; 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]:41374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQGnb-0005m2-Qv for patch@linaro.org; Mon, 22 Aug 2022 19:25:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQGlp-0005d0-91 for qemu-devel@nongnu.org; Mon, 22 Aug 2022 19:23:50 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:54838) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQGlj-0005am-L6 for qemu-devel@nongnu.org; Mon, 22 Aug 2022 19:23:45 -0400 Received: by mail-pj1-x1030.google.com with SMTP id bf22so12439989pjb.4 for ; Mon, 22 Aug 2022 16:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=eMqYEALQlNCHryVYkn9ayeWYJiH16krDhtfDzKR3N+4=; b=TYQBcK0MW3DxORsvXbqYjWpE/UmT9qOmwhv9wkrUvhF0j5rA6d5pKvtPzWcYl+9L/T qAvV1jms+Lx3KVQ1w0oVJOTP6V9RgCED3VI7DW0Wmr41+DVB7iFnL0tB2rdVZMZZELP1 GOqwBPzN1BPfoBDd3CMGf5t88lKe44qPn0Z8dezGE4QVRb3d4BE/2NgF/UkJTI53ZcHe TFt8Ynfifin+b5h9vfNuNvUP5sYDFYJSRHX2NDV7AzMKWqmXGfnVDITBA2K6vmUbeuBS 6fkEcoSnRs3k6Nliqc6XHg9gL08+hW76uj7rXLSDwz5pl9p2DdWXpeAf1Irj3GzXGq13 PUAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=eMqYEALQlNCHryVYkn9ayeWYJiH16krDhtfDzKR3N+4=; b=ZYAw68cKxjlcwbCZonAe7FyuuG+ysbqvSlTkJFtgHNCkszo2iH2QTmnXKct0cMdHzj ubeL0OdDFpyedQ1GQXSsQwQxZmSyPjyeM9d6TrJNGnwTll60+CgottKaG8L2ghaqHlxL pf9id/eRcP1bxvFr+g6FZr1XX70EX9+yB81BR5XsAt32pUh+zKM7/D4ts3MJNj4Mi8Tp 4H/2iA4Nw+hOpNtuEVzqQxT4GmZbPZZQL76kPC14rhK65p59ubFToyLmEqYrkinTh8jL lqeHeTPz6/7VGiI+s/7HVdXQsGM/bUWcgp1voBCK8TvCUFF8znrbG7T52yCXdTcqZUK2 HCYA== X-Gm-Message-State: ACgBeo3DQjzWe3cI+th0VRyHg3G2MrAW0JdL9zs+DMIFYm7NAYncQdcF 4chZpXH1AcrD5ubJI1kNcQcRJDX11qGQyg== X-Received: by 2002:a17:902:7b95:b0:172:9dc3:6c12 with SMTP id w21-20020a1709027b9500b001729dc36c12mr22486423pll.94.1661210622245; Mon, 22 Aug 2022 16:23:42 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:c3f1:b74f:5edd:63af]) by smtp.gmail.com with ESMTPSA id k17-20020aa79731000000b0052d3899f8c2sm3809112pfg.4.2022.08.22.16.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 16:23:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v3 02/17] accel/tcg: Use bool for page_find_alloc Date: Mon, 22 Aug 2022 16:23:23 -0700 Message-Id: <20220822232338.1727934-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822232338.1727934-1-richard.henderson@linaro.org> References: <20220822232338.1727934-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Bool is more appropriate type for the alloc parameter. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 34bf296250..a8f1c34c4e 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -465,7 +465,7 @@ void page_init(void) #endif } -static PageDesc *page_find_alloc(tb_page_addr_t index, int alloc) +static PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc) { PageDesc *pd; void **lp; @@ -533,11 +533,11 @@ static PageDesc *page_find_alloc(tb_page_addr_t index, int alloc) static inline PageDesc *page_find(tb_page_addr_t index) { - return page_find_alloc(index, 0); + return page_find_alloc(index, false); } static void page_lock_pair(PageDesc **ret_p1, tb_page_addr_t phys1, - PageDesc **ret_p2, tb_page_addr_t phys2, int alloc); + PageDesc **ret_p2, tb_page_addr_t phys2, bool alloc); /* In user-mode page locks aren't used; mmap_lock is enough */ #ifdef CONFIG_USER_ONLY @@ -651,7 +651,7 @@ static inline void page_unlock(PageDesc *pd) /* lock the page(s) of a TB in the correct acquisition order */ static inline void page_lock_tb(const TranslationBlock *tb) { - page_lock_pair(NULL, tb->page_addr[0], NULL, tb->page_addr[1], 0); + page_lock_pair(NULL, tb->page_addr[0], NULL, tb->page_addr[1], false); } static inline void page_unlock_tb(const TranslationBlock *tb) @@ -840,7 +840,7 @@ void page_collection_unlock(struct page_collection *set) #endif /* !CONFIG_USER_ONLY */ static void page_lock_pair(PageDesc **ret_p1, tb_page_addr_t phys1, - PageDesc **ret_p2, tb_page_addr_t phys2, int alloc) + PageDesc **ret_p2, tb_page_addr_t phys2, bool alloc) { PageDesc *p1, *p2; tb_page_addr_t page1; @@ -1290,7 +1290,7 @@ tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, * Note that inserting into the hash table first isn't an option, since * we can only insert TBs that are fully initialized. */ - page_lock_pair(&p, phys_pc, &p2, phys_page2, 1); + page_lock_pair(&p, phys_pc, &p2, phys_page2, true); tb_page_add(p, tb, 0, phys_pc & TARGET_PAGE_MASK); if (p2) { tb_page_add(p2, tb, 1, phys_page2); @@ -2219,7 +2219,7 @@ void page_set_flags(target_ulong start, target_ulong end, int flags) for (addr = start, len = end - start; len != 0; len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) { - PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1); + PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, true); /* If the write protection bit is set, then we invalidate the code inside. */