From patchwork Tue Oct 4 19:52:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 612310 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp402188pvb; Tue, 4 Oct 2022 13:08:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6VFnJ4X/W07oylNaBroQy8KJF8GRZymR8l6JIxeMG0i8yfV075JFv27AAvso9ReFv5GqXL X-Received: by 2002:a05:620a:8087:b0:6e1:a1e4:93ca with SMTP id ef7-20020a05620a808700b006e1a1e493camr1264681qkb.153.1664914127317; Tue, 04 Oct 2022 13:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664914127; cv=none; d=google.com; s=arc-20160816; b=jdSj9CUx5diVqYb5jrLypADsXAkfPvLuUBeg3rV8EVfd4KsyzTSs7QM2CLUu6XG3JW zGb+2YnJytt8vXKc9JhcJxjGQK/VSXgV0WRIMJOItLOltacvAPdCx5T0r4xfU+mIsgRP n4O2NiFc8OZfDsV2+ApU7lShua8V7u/muFa1NoUZ8llwCSVnPK3sHx2XINzlbba71oMT J7OYVLCQXQYCsrzdhOLpKX15QQrOXvL5UJMZpS6EapXDbbdXMLIFa3AWUGv7F/w8CHOm BjIl0ACFHLpHzIQQ9l2aaupN3BFDrCvxlgr6krVTgeynCbfnyvOPavSzKG7T7jxNQJji VjqA== 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=mg7FNVLYsu4E+EVx+KR2vL4uB9CLDcsoIWIqjbBFCJ9rfOlqPu8E+jVnuQH/21nB8Z twEGbRUKC8LZTqBWZjZscyt/10d4eNQMko0oPbg2lqZzky0uVPwO7w3z7QiMP4NzW0FB npPW3kfUwfnMRVeNLjAx0Ofn5gtM8iE/5q0QwX+OC/bE7x8UuYKMqLTbxuegsEb0iGk6 k1dP4+KmsSnxNfAodpy3Dr7tKbpUNk5pyhpFhux2r+mI2AOBJegCWJ7ihQsjxfucssnT eYeXzjVtrP9VGtbJ5AwoKOcCjX1NYsp9XXYpRi9aFgB1Y3MCNq6oKQKq79+VZLyj0yD9 ajQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o4mhEith; 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 z66-20020a379745000000b006b90bd97e61si5182653qkd.136.2022.10.04.13.08.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Oct 2022 13:08:47 -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=o4mhEith; 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]:59838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofoDe-00005L-NV for patch@linaro.org; Tue, 04 Oct 2022 16:08:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofnyM-0001rB-Hx for qemu-devel@nongnu.org; Tue, 04 Oct 2022 15:52:58 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:35421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofnyJ-0000HH-Ow for qemu-devel@nongnu.org; Tue, 04 Oct 2022 15:52:58 -0400 Received: by mail-pf1-x42e.google.com with SMTP id i6so14043517pfb.2 for ; Tue, 04 Oct 2022 12:52:55 -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=o4mhEith8a9Amqr4WBxp4Mw/ryCl/lgfEXyPE6p2dGPqODJKVz6Zy4Sk0V8HJW24gn pz+0MCEMtIKsFqrYU6wViwm20J31xt58dIkbaw0eHtnPSh1PNZbvyCCz+Ezn460mtCKs Hf02F2p6v5non2QZXlwlkBRguStoQ1if/frt38kFp+H7CVCfkzJGqIkvJAZPPNZVtWD8 WpP/uez3k3VzhAk4DO8y4Oyh772HtAIcbdRNEZpZgyQKeCHLmZxo1g8hsaxA9VD1ZEw9 C1cRZz6cYWxxPZKtbDFdwHkMH36FFc1o+Bzqv8n8LKlRij4Xx3eLiKkg9XDGBfcg5xS/ Re8Q== 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=clw8YwupA1Vy3AQFcZXGxZ00oDpCeADicnxzT2eHUiTTOBlRyDH7oml5rjrYiC4Y3p noBOD2fjHOgpTsXYXPsbzdYQejwAXxH9020TzPWrRUUJDNcwMv5V8HeMP4h1LpxIBc/h /QHMvEsf68Ne9n2hhxvioDbQzLQAhnyjIatdALfbdhWUmwt9zEl0mnU1hfrW8cuIeaMm KtekaAjYbcA9tXQnK3KIclTg4dUpxr/f/UP/ifbEkyjTg3N95Ad+rmMnpTIYeSOKBrUd OpQF7UH3QO1+Y9HNHKEb7yuQHZWjy6hLg54EvSCSPWynY7J+86ZnmYmYA43BprZBc7ce X1fw== X-Gm-Message-State: ACrzQf3g7GjmtDz54Bs6Pp8Fp7mT+PKLAR4V8LYxxisS3byMR+AaM6AU azHHLYVfabHkeVV/Japnr66HQZUxLU68Ng== X-Received: by 2002:a62:ee17:0:b0:55b:b0d:bc9f with SMTP id e23-20020a62ee17000000b0055b0b0dbc9fmr26946604pfi.39.1664913174178; Tue, 04 Oct 2022 12:52:54 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:526e:3326:a84e:e5e3]) by smtp.gmail.com with ESMTPSA id u23-20020a1709026e1700b00172973d3cd9sm9293406plk.55.2022.10.04.12.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 12:52:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 11/20] accel/tcg: Use bool for page_find_alloc Date: Tue, 4 Oct 2022 12:52:32 -0700 Message-Id: <20221004195241.46491-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004195241.46491-1-richard.henderson@linaro.org> References: <20221004195241.46491-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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. */