From patchwork Tue Oct 4 14:10:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 612298 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp243753pvb; Tue, 4 Oct 2022 08:19:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NiqmM6DZBCHB8oLe14qFLQBYIunsWX1aooW6xteG5kl5h8qUzwFP/MVzStrI429UvIttS X-Received: by 2002:ad4:4eed:0:b0:4b1:89ce:2c6b with SMTP id dv13-20020ad44eed000000b004b189ce2c6bmr8414103qvb.91.1664896768204; Tue, 04 Oct 2022 08:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664896768; cv=none; d=google.com; s=arc-20160816; b=I7JyxJC44FS8+jTAPYRbaomlaIJ+UFUvwm1P7X59T4B9agFUDCzo19Otr5laq7K4ng ELzKsmbeDEpNLuouKd/ioCxPz/X8SaUDzzOmiv68FPqX+lgcCFKk6zUMzLuYXF3Kghet beHvyk4vxhvIXBpisjXSDxBCdVZM2raKW8SWG3DHVJP9nXhcSKBAKE7RagPnejNqr8Op bTF92Tfzm0Cy6E66GbcO9rKYPsR+6XdgNyXPHumxsJCsWCMy4ogF2oPUH7nUDk2y8PAf jf/Zorzi06mNk2PCQ0y4/CW9xEe/N/bBb3ANQndE4a3ZZSH4wqv5TG46/habJSrWmPU1 msdw== 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=cLUCkFTb6+JnLlWzn7HnttSYfDBpIhciH0RgPU16KNQ=; b=yUmnkzFnsbe7PJiWGZ7IXMOmgTIVUsf0SkANdUQCKxFkZKIu5o4mRX0/nr8yjuZ09D dgrs3Zh+G47fsYe+SxR7goYCjf8/8HUWJfBr5t76s4lEYI5Pm2lzalqeFtl0RFP8elmA ZE4nTxPDiNurGjJC5Vh4C888uXr1JSn8lG5Y1vV4BKCKxmA16fdElVpTP/PPmAV+9k0G 7bldcdwaaHBP3U3LGd3ltorGemy9gXo5mGsg6jzOuaXOAABooBsrwCVCBMP5tZkcSLSV 1u65AXaQnjHJvHFID2p4dNctXZ9yhzF3kWltvazD10MhxZ4I1xiD1k/FeCE4aBflJKsX hEhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mhogLRbX; 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 q3-20020a05620a0c8300b006b9e43e818esi4852611qki.761.2022.10.04.08.19.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Oct 2022 08:19:28 -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=mhogLRbX; 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]:40942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofjhf-000759-N9 for patch@linaro.org; Tue, 04 Oct 2022 11:19:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofidg-0002qr-Bw for qemu-devel@nongnu.org; Tue, 04 Oct 2022 10:11:17 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:41495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofide-0004PI-M8 for qemu-devel@nongnu.org; Tue, 04 Oct 2022 10:11:16 -0400 Received: by mail-pj1-x102a.google.com with SMTP id x32-20020a17090a38a300b00209dced49cfso10648604pjb.0 for ; Tue, 04 Oct 2022 07:11:14 -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:subject:date; bh=cLUCkFTb6+JnLlWzn7HnttSYfDBpIhciH0RgPU16KNQ=; b=mhogLRbXv6FJrqbHqDhqTHBgtbcEBYeaxsralmTapSob74gC2iGDujPAF2kT5Nfq+H 2dpkm84gZCE3cYIQXqPKUHNceRiOuY72W2bKOwihS8d8RqXj8aIMlV+bDKCnY+Fju84p /zjsgg1Jft85rdTvEdzT456x1ebDys0Tf3zJ/bL+8YXjQ2+AVpMxcybhqwCOzR30lIpl TNBMxiLA0BtHWuJyihhAG3nyTobjVrcW1TlU6jsutlA9qv1Y5SVvuToxyrJoBtbMU9jF F7S6LAzdP8aP974oqVaojZjZJjIRkVKVrlClLz2ZN0xEyMdkobc7fStWFnKvlD890ZTS wf0g== 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 :subject:date; bh=cLUCkFTb6+JnLlWzn7HnttSYfDBpIhciH0RgPU16KNQ=; b=WKNeK9iPSTsqIPuehZb6Bxwe+qvbT+0YXI6d7fLMZVkNQigNkPAmVjR6+S6o0o4gC3 uNG870H0gPAnP4hjfWkQq1wNl6uUaFw1sutkiBT8I8xM1vrq8wt8mH5NpqkeUgFmLTx0 wc5U4NXvSWmZk4j3YT7OerD6K4pdfYXFkgYUOe52W5Cr64CHfJg9u0g1wDyiP6img++G iWoabxpkhlJnGSOPxsm3iA7jnISBI/VlVko2xA25DYBxZB/1vscZd78+AzUIY9jXTEnY EftgjcHNVaTdnpyBtquMx9MS0/iO2GDbHfSpqUIPC3e/vdtKlaZtUIu/HLu8vZKAFPeL FReg== X-Gm-Message-State: ACrzQf3qfXqKABFtnBuw7xnMgg0j7bSolSL5P/+u+8nYuq5K6tbklYnl mtV0wKvHbmo2me/6u7skxJK5Fd/R+ew7wg== X-Received: by 2002:a17:90b:3b91:b0:202:91d7:6a5d with SMTP id pc17-20020a17090b3b9100b0020291d76a5dmr17175206pjb.101.1664892673248; Tue, 04 Oct 2022 07:11:13 -0700 (PDT) Received: from stoup.. ([2605:ef80:8015:12b0:403e:a15b:ff5e:d439]) by smtp.gmail.com with ESMTPSA id y5-20020aa79ae5000000b00561382a5a25sm1240357pfp.26.2022.10.04.07.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 07:11:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v7 11/18] accel/tcg: Use bool for page_find_alloc Date: Tue, 4 Oct 2022 07:10:44 -0700 Message-Id: <20221004141051.110653-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004141051.110653-1-richard.henderson@linaro.org> References: <20221004141051.110653-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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 autolearn=ham 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. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé 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 59432dc558..ca685f6ede 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. */