From patchwork Sun Sep 25 10:51:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 609142 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1275378pvb; Sun, 25 Sep 2022 04:15:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64/ZyjBl8gCnUYGAqKthW3mPBYtgZx+Z/JUANiEaplOsTt3Lwk7P0CVBpswwB2U5w4AnBs X-Received: by 2002:a37:5ac5:0:b0:6cf:7c04:118e with SMTP id o188-20020a375ac5000000b006cf7c04118emr6377841qkb.215.1664104505344; Sun, 25 Sep 2022 04:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664104505; cv=none; d=google.com; s=arc-20160816; b=IK5tT7CPnGteC32g2Daavnxodr+wufUTHDAK98GR3yh3Gi6ZW3Lx4bFpSROAX0+/az skT3MZI5URX9ucF2VfXKTSEWsUb2VeQGp1Uvk8jaQElXzpuNnF9I/S3JDDbDfueLb0pO dZ84LbqtSqiJ30fWCe7wN4s11zl3e3oLja8r2B/7e2x7JPD1I8tcgdr/jrX+Rk5cYNA4 4jQg7xZK6/JNt2LqvJANGHPOrAqYv6+WRL5ZoBq3iQPDgp+3B9vWAIfdDS/lArLKhDae zVYD49AOm0zD9WDu9qGQUdMc9Vp3lpsOmMp1w/0/M+7R30FsHkzHy4Cb/NMfNnTOhYFE qpdg== 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=t8g2NigUHYP8ExVOle9lzfEDrD9urqWPbeXGUQKl61M=; b=IoqJWLxTY9jcdacvnBhkP771FqhgQbom67pRDKN1R+ZdUyr46CSOq71jC/LC+JvfQL WV90mMmF0lFZ/hluR1OjRL5GeMJo5vEXbskvm+uc19SiOXddD9f6HgNsS2urzAt9lyKc 8dsnh4BAA0AYKJYqtC1RVaCKUi02us+Z7jrgcSF2g+Z+i0S+ZIQVFRQqtYVMK2FJ6ci8 iNjg8cPfRaqb1T1Qm3QjEW6irWGkNGNex4fuqjRxekCQLtRzbOdGEriGFQCndyfsg4ZY XQWbdJ1D1uWiI0FblvMOa0rPKP17eCLcERVYlXxKdN+xQ7H3ufRyELe/EHMW99pkMMuD DlXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y+l5fLoB; 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 e9-20020ac84b49000000b00344577f4699si6418968qts.177.2022.09.25.04.15.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Sep 2022 04:15:05 -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=Y+l5fLoB; 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]:39936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocPbE-0002k0-U0 for patch@linaro.org; Sun, 25 Sep 2022 07:15:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocPF2-0003AO-Td for qemu-devel@nongnu.org; Sun, 25 Sep 2022 06:52:10 -0400 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:36764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocPF1-0000Ny-CO for qemu-devel@nongnu.org; Sun, 25 Sep 2022 06:52:08 -0400 Received: by mail-qt1-x834.google.com with SMTP id h21so2609544qta.3 for ; Sun, 25 Sep 2022 03:52:07 -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=t8g2NigUHYP8ExVOle9lzfEDrD9urqWPbeXGUQKl61M=; b=Y+l5fLoBF6h81ctszsWATURjCwduet+AbcBBgsIXC4Oe7US0U807M3clrP5/nV6jW9 4aAAwbgVDN6t/ypS9KMzhIOMALbLdYPpzMVnFitquS+8Q9pkOhCmQzx28QaF2lPC6Kmb cmrcclj/6eILqFmWxzbqWz3IrPCNOq2fHHSAFJ+PGFiWA0zw4MWA1t+UVef0JucgOPXL pef++ndxzIlN8Qx66k7aG/sSjDPMfrdkjyYkAOflDNLl2MwsuNF5fVSDeMBJbcNtmtJz N6eRemPG/7wJCKqeZI31VJSlk2mq+sIqQv1igktD0mUlAoq+pQ5ne3OjaXKT07aJaBky dmpA== 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=t8g2NigUHYP8ExVOle9lzfEDrD9urqWPbeXGUQKl61M=; b=6kDqubVtVYpEZOweA0n3zm/KC0lefMkhid7MpA4+X5gwouOlDBOh6UWDfXRsxeyZkf mZhAw1Z9xTpUoes0SArk+9XZcbiXZ8GLbaWtJzyjxBLC0Xj9tUmdhskxaoy6f0uMmrk/ dIpjGHeztpgr+bCJK9iaxDU/bEkPloCGWHPtIgutWs+MapwbaIXqlWSUTKMPbpAueFml 3ptr0fjXUocctXYvDYPRReNvf1cq0Goy5LBBgeGc+ElAaCu6ZF/7eyJOiUfVuLBmh7ID nWc9blIeBfTNA1rpYpPPxmpRAk1bHYWHvXTerNmHUBmq+mQ1MFyXbddL5kRNwivk/Lwi 031A== X-Gm-Message-State: ACrzQf10KZ27AEI32xO6dXdmS2cLZy88wnHF+Wq5mUaiDgbwyIn83/oo syiAicsOAz6UDVjUDNnDxOx/mlq5ILd+Mg== X-Received: by 2002:a05:622a:164a:b0:35c:b87f:4839 with SMTP id y10-20020a05622a164a00b0035cb87f4839mr13896076qtj.219.1664103126215; Sun, 25 Sep 2022 03:52:06 -0700 (PDT) Received: from stoup.. ([2605:ef80:80a9:5c0e:1ec2:d482:4986:8538]) by smtp.gmail.com with ESMTPSA id u15-20020a05620a0c4f00b006cf19068261sm10061132qki.116.2022.09.25.03.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 03:52:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 11/17] accel/tcg: Use bool for page_find_alloc Date: Sun, 25 Sep 2022 10:51:18 +0000 Message-Id: <20220925105124.82033-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220925105124.82033-1-richard.henderson@linaro.org> References: <20220925105124.82033-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x834.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 9046ea80f7..69f39d669d 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. */