From patchwork Fri Aug 12 18:07:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 596821 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp1785239maz; Fri, 12 Aug 2022 11:22:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR76nPE3YcJ3WrvkTKwja5vFTvptdOqjc3/gV+UdjsAc1dNTNuWVu7JybCj25JtB1OMFFqkC X-Received: by 2002:a37:aa88:0:b0:6ba:c582:2157 with SMTP id t130-20020a37aa88000000b006bac5822157mr3736928qke.228.1660328544857; Fri, 12 Aug 2022 11:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660328544; cv=none; d=google.com; s=arc-20160816; b=VAqFTE0znH2QdhLH1Dyib7fpfZDxY6qMSzj26k26bx/R1wJ/ftl8kEWvSpaMbeIRn8 Sm815f4GEaGHBU1tgscxkzyFUWBmoYtohfG0FlxIIopfdycQREbETPppMLcf6SJe/glO LJkrIErJm/3AtJ8USdUr7FU4t54j3GHQ2BVUDoEutkFwttvn1Hwm38I+zWmf0CMUM72j 4/icyF2fZV67nR1HoGM88xhJOMp2V76NidVeHbRXF6RbxCctpFp7OYtMPujd0+EamAB3 45AzAF0stEVwmzUIkJuxNvJhEzJJLuxIr8qWQwDb1UlOHXkUFMMZ2+BVkzC3WdG8dG22 s5iQ== 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=nLs4F11vVpSwspm2veJzwmhbU1l4fxWHD0iuY3vRcw8=; b=v7ecYpCWypW0qB+p1iSbzctJHkmUBv1xuDsi4miVIQv7KsI38z1zJvWMZSYLgsZoev 2VPZiuzzsxjlImsFQAcx8UXdabzRWRdyUMvqJO8+2/4I7V+c8Hly/c8OSL6xnax+SXLJ hzPeuzYqoqSx6/7HLyWECFr0mtesgiCrLc0SzRCCydL9QwoGUmFlfM352v3XzqyFzmn3 5KH7XhTtmM5MNEigwYPhg54udQmHQw9MImLxM35RCMpQKXa5OkFI+FV+mouurzRIwCRT OIALnSgeOxIZTPtp339EZYN9xJNBSfNHCPAJ5sNEKbJkgDeKK7vLOu8urdxDqmFTXVgU mN2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=crjmyD7w; 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 f5-20020a05620a280500b006b962a86c51si1794282qkp.80.2022.08.12.11.22.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Aug 2022 11:22: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=pass header.i=@linaro.org header.s=google header.b=crjmyD7w; 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]:34394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMZIe-0007V2-Av for patch@linaro.org; Fri, 12 Aug 2022 14:22:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMZ52-0003TY-Mc for qemu-devel@nongnu.org; Fri, 12 Aug 2022 14:08:20 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:40658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMZ51-0006X9-2P for qemu-devel@nongnu.org; Fri, 12 Aug 2022 14:08:20 -0400 Received: by mail-pj1-x102a.google.com with SMTP id s5-20020a17090a13c500b001f4da9ffe5fso9005425pjf.5 for ; Fri, 12 Aug 2022 11:08:18 -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=nLs4F11vVpSwspm2veJzwmhbU1l4fxWHD0iuY3vRcw8=; b=crjmyD7wmONCXmpYOJVfuSq5y9+2feLfpdTHhquGKlHlSasHTPabuDAgKZTJODTNuS 7sHIT3kXqaqjGfG3WhT5LpH/wLXunOrRIURWckr5KUYoSuy1NFQLMQL/KWl56J+JhUmF YtW3m+1O88mGVU5mkMRYdUemB9ulPfPmfIrlao5bdf8BCPXuBXY5NLQgic5H4YKRvre/ tSydW2Tei+YeZAqtOfIldw2XrVa1QH/zdrXpEvz35O9/E0OfnTo93T5T8ULTNztlefH0 4WIu6VEKtGyRyW+Xrvt7OHiuabgqmS83sU6pny5Xar7pGH+QMjxaDZP5CQNhqqm2UyBl +xIA== 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=nLs4F11vVpSwspm2veJzwmhbU1l4fxWHD0iuY3vRcw8=; b=sFLuoWkt2ZffyLsInLBJrCmXBmPzZXCNh9hTjbY1nsPqwS2IaRWGDKjB8OhDngve6w ++8Xc5YKf5u8TnYLkMt5fH5iHNu+otWY9UoBl81yfn9yc+oKYY48psiSpXEQ8weRViR+ r36rLpgTJc2+JXAj6Hqsa3bjIzyAKEYy3GhgtbzLOc3qXMPTd2GkYft/NbqE4cIJc4KQ PFY4mE4Ginz8jViZv3HTEBTT1gmcsdPjIIXkLWdURlUHVaJ7sO4OMQyiFvR83fTGe5Vd BI2l0yKZWDNf46Mbc+Cynn1tua4OQEdEc3D6po9tPM/vDv9guqP4t+SedxSaqePpyOvL C7Iw== X-Gm-Message-State: ACgBeo1LgJ6tokrLIfzzFSYW7D/5x5QOrlA+HE3oX9Ce4m9cLjPcy1Tu jfeFWA4Uu0u8Cb6fDw4ZouGf0xc8xORVOw== X-Received: by 2002:a17:902:f68e:b0:16f:5e7d:fc1 with SMTP id l14-20020a170902f68e00b0016f5e7d0fc1mr5140622plg.23.1660327697124; Fri, 12 Aug 2022 11:08:17 -0700 (PDT) Received: from stoup.. ([2602:ae:154e:e201:a7aa:1d1d:c857:5500]) by smtp.gmail.com with ESMTPSA id h9-20020a056a00000900b0052dee21fecdsm1914761pfk.77.2022.08.12.11.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 11:08:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, iii@linux.ibm.com, alex.bennee@linaro.org Subject: [PATCH for-7.2 07/21] accel/tcg: Use bool for page_find_alloc Date: Fri, 12 Aug 2022 11:07:52 -0700 Message-Id: <20220812180806.2128593-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220812180806.2128593-1-richard.henderson@linaro.org> References: <20220812180806.2128593-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, T_SCC_BODY_TEXT_LINE=-0.01 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. 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 cf99b2b876..65a23f47d6 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -464,7 +464,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; @@ -532,11 +532,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 @@ -650,7 +650,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) @@ -839,7 +839,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; @@ -1289,7 +1289,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); @@ -2224,7 +2224,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. */