From patchwork Fri Sep 30 21:26:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 610961 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1755042pvb; Fri, 30 Sep 2022 14:35:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69dT18Ubge/D33R1+aHV8fQ9XXe1Y8KfZy/uSzZww3piEsHsafrCCe4bu29XKH2xSVGM5I X-Received: by 2002:ac8:7f4c:0:b0:35c:ceb3:4409 with SMTP id g12-20020ac87f4c000000b0035cceb34409mr8542761qtk.138.1664573732207; Fri, 30 Sep 2022 14:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664573732; cv=none; d=google.com; s=arc-20160816; b=YZ0SfEsFFgWs3Q1iv5KzjaQV25JkNayK47sZM3es8JVda09QG5sEolKni7c/jE60OZ zRTQ7s9Myejz1uGbNGbj3SXteYPARMlZ21HScaJzuLn6dkHaUu1IisAjOr4hfCjnye01 EO7uhzNlnHsXHCPf/A4ICMlK5qiXqFhUWpmaA1fEBqivhB4ywTYhlkZYGbSdxxT9u0G7 QTSH52985A6Eexvpav9a79H2vLoBScDPKAVyao9EOpZ7gvU9l8NtoUu5BfEUTsSJt3TT Q+tw1vWukimJ+2wc0MORQKKkFHpjXD9+48G7t94fPtWwFuBcUgy6/lPG+/sSXPb47UVL QG2g== 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=O6+FrGZuXCvGrV7dqGe8BBGQ+t6UvtTQYmyArs/AuTp9q9ZpCCl6ZZGx554lIdbHhG 8+p6EdxY9XCuZ9ppb0GuE8c48NRuXpE4A/7aVHWdalQpI8gp9z7BAE8DaenUnIurMfiL 10kOIwy3RHoTTrgDaMko0BAMmOxgY9ZXGhduq/BgzDok6zhinR3Ok1q4HB0X4zEFDI+j 994UOKHCPTkfjSw+vEgQUMeeHQ3xW7GmGxFbJAafJVws67Dw7fB4vJ5JQGxUMzrtFNXo 9cSQKp1FZxGG7/xcVVkEa88nzWyX5jkB5WJlL9UFCRKUff0ngGwwmSmJjSTaCpbX14LW UXgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dpp0QS1Q; 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 if15-20020a0562141c4f00b004ac7550f141si1807286qvb.131.2022.09.30.14.35.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Sep 2022 14:35:32 -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=dpp0QS1Q; 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]:48502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeNfP-0008IZ-Nx for patch@linaro.org; Fri, 30 Sep 2022 17:35:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeNX4-0006nd-8a for qemu-devel@nongnu.org; Fri, 30 Sep 2022 17:26:54 -0400 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]:33700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oeNX2-0005Pp-Fi for qemu-devel@nongnu.org; Fri, 30 Sep 2022 17:26:53 -0400 Received: by mail-qk1-x730.google.com with SMTP id h28so3635202qka.0 for ; Fri, 30 Sep 2022 14:26:52 -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=dpp0QS1Q/gtJ8GNcMr4xSFosa6KzRxwb+om6i4QYBGqJiWYYh8q57nKgjr86iSkZLY qkVF4DSpERyAqjutLT/UjNN5MCNc2NGwxEaDzZnac8kJiyCEOKckxz9N4/PFM4LNkkg+ tDEPuCj8TtJERBu366gWuIdJgrIU1vCVAlt1SODs+X0l/FhLfOoZJNsP5hpfDgUGmr// J2LFNUNqORUsS5VHTfHrv8MYxvPVUWzjsaAHdBg2fHZ48KDoH0fFzfczzsQt78gq7zWY cT0wn3C0Mp4s1cleneD/10AIwI1rO1M9X8zDngYsuU1m0iwkVUwmTV0vUDYXT0SpUWU8 Iwcw== 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=nqLAGGlTPGFAr0Gm+LfqtP9P3WyPwVMByuMCZgQxO1U/TPtAeJ/PAKW/NYSKeJ4tA+ efW4+djk0i1Hygt+FgJh534iYIt2Fjd36ILeMZbkGmFEQAYPrhy6eFNNckA0L3zOACyh WiiFbVL1NX4F3eQAlTYQfC2cOcYXsJcWNaIzpKlSY34uh+L+9aI+dSMPDiCLYI50D7Tc GDKv/OOlgaxlCSWdQxXrohCfy/2aWa6yxzW9cB1odUbp0Fq7zsvANeq56KB0CNV17qP4 K7KqzxLsXm61rWGRWsGcVLC7ULsmNJ/9sKsxD+ZW9UFhdBfq3c0Se6ZqyqNhFYgsPsr+ CAjQ== X-Gm-Message-State: ACrzQf3OBgg/xPkzpQkJ63MGa97AiRcfvDj7w9KpqYA1roufyyofx5s7 eWbhxnnImmB0EWN9HC/SD7P7SCMgGLAdCA== X-Received: by 2002:a05:620a:404f:b0:6ce:8c88:406d with SMTP id i15-20020a05620a404f00b006ce8c88406dmr7584386qko.358.1664573211519; Fri, 30 Sep 2022 14:26:51 -0700 (PDT) Received: from stoup.. ([2605:ef80:80a1:5a60:d0d7:468b:5667:114b]) by smtp.gmail.com with ESMTPSA id l18-20020a05620a28d200b006ce813bb306sm3696370qkp.125.2022.09.30.14.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 14:26:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linux.org, alex.bennee@linux.org, =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Subject: [PATCH v6 11/18] accel/tcg: Use bool for page_find_alloc Date: Fri, 30 Sep 2022 14:26:15 -0700 Message-Id: <20220930212622.108363-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220930212622.108363-1-richard.henderson@linaro.org> References: <20220930212622.108363-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::730; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x730.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. */