From patchwork Mon Apr 29 21:30:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 793037 Delivered-To: patch@linaro.org Received: by 2002:adf:ec83:0:b0:34d:5089:5a9e with SMTP id z3csp318196wrn; Mon, 29 Apr 2024 14:33:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX4GXaPcPJp2BIu0uOnz1MVH7c3wokLU5awkUMGagBoh97YAF8VSg/Z2RSLaeIyKwaqhXc+JeeVHm+XFPxmqzx5 X-Google-Smtp-Source: AGHT+IGPfGSAoYD8sKRQOP+kkHGXFCE/g/LF7mKZmU5BZwM9HPItHCYgErM25tX2+sYE5nAGkGqi X-Received: by 2002:a5b:181:0:b0:de6:143b:c8fd with SMTP id r1-20020a5b0181000000b00de6143bc8fdmr197373ybl.14.1714426411030; Mon, 29 Apr 2024 14:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714426411; cv=none; d=google.com; s=arc-20160816; b=UAzqqD0QAED4JclKmf6hWzE3K9XNZW9N/pWV/RDdxthlDoI3rKKfJ3wmOGVt+VbQPy nU+hTnxwXFcjwqC4nIklOQvICMrD8pJt6kCXm44uLK3rkvYqkq5yyxegOfk3qyeTuQe1 CeADvpBrcphULLpXPveDTlN0xnytELXXm0m1OctWYLbtGv8YW9FjKaFWYzK9rUd/0AbD qtaSRZPbfYL9g/WquqYUg4kSxSiAsFuaKjUrKvoQ/S3BxTJ+ujzgMoHL6ek6lX1IUQ72 ND5Al1qNp0CQyQii7MSp3NhwXoJ6SiBeMF+nhB3zzo3t70e3x3yl4Rat5e88N4r/wMx/ IIZg== 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=XKYG6Le200XvNAWzyHkVzuEjCu+nWrYe1aCCZD9ag2M=; fh=btFRM471eUW6g9v+ioVZ2fFo4RpR3l5b3WEceik6dSk=; b=phrRvS8bgEhp5L6u2V2yPounDeXyFr9kvEZNX9Ng8PTFXWSzTAsab5lQQGok2KYbPp 9ENwenVFb4Yguzy+ZZHj8RNPSwFRaX1oy0K1JoIQY7vQeHFoHhRmgNJJHdKNrVM5R0iZ 7mAxh+FF5+xjsDgASqvUtzojMfT65y8TWESdoU9yC0iJ0EsONwUSfJgjXsB2ksD6/kpf H2+bO7dXunwpVsOKKFUxwU/vL2JmeSs8DS4hU0AyJTjUaRQv4XJi97RDkh7EE9O342TY zdU96pJfHrmiPp2ay0vts4x2xtOL8wzXCOitO6CqKSeYrDdC9VLYZ7MN2s6snfOVEC1R bXVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gikHS9gf; 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 hg17-20020a05622a611100b00432df4df3d1si26646506qtb.498.2024.04.29.14.33.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Apr 2024 14:33:31 -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=gikHS9gf; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1YbX-00080M-T0; Mon, 29 Apr 2024 17:32:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1YbG-0007fs-5w for qemu-devel@nongnu.org; Mon, 29 Apr 2024 17:31:53 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1YbD-0003MP-LK for qemu-devel@nongnu.org; Mon, 29 Apr 2024 17:31:49 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-41c7ac6f635so7038865e9.3 for ; Mon, 29 Apr 2024 14:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714426306; x=1715031106; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XKYG6Le200XvNAWzyHkVzuEjCu+nWrYe1aCCZD9ag2M=; b=gikHS9gfjU9Jp/zfL1yuEAA8iYzSwhfKqqhXzKES4zoZHEILkx+SANp02Vz5iGgdmm q/ZmxzQeh2TtS5Ne0jX81XaJXhWbezZIQMtSLSVhX9kBMyrTggMYh0F6MwzELtAWhXo+ ELM2MoSk+BzCH0/yWjYTvTuYRp+fkvo1x1TEzHixqg/xDZMgYwJkrS8IKI/JD7z0fojL 4kLFvMIasjhAE7dSF2J0Lnu3w/oW0srzAlnN1qkfgT4EfBftkNUnZycAlgF4LbILyq8C d0sTttNp+648mrH3ElBVlX6TaKLZYDbGhmhoUEX/6htqaviTzxA4QiWSqDw9PQI/rtJY qwEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714426306; x=1715031106; 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:message-id:reply-to; bh=XKYG6Le200XvNAWzyHkVzuEjCu+nWrYe1aCCZD9ag2M=; b=WPPHENVLfJ0eh0tL3bZ2uRdZPWwIqscqKIGO7ffXCHr1/0TRzXs1+lGEAZxkTmkBaD p8BdY/3P1pSLO9ZnEwOd1ql/iIzG5fez3fdvxmJ6gSuKYB9qNvkivGMoQZ1FWBDtpZFC 75JVs1kDodDeraELqaOchVsNeu9DdbjSbjgSX74HnHfkWONEyoPfps4hnzJ/gSPj4dnE eCsQNS+/ZL06ZxzVrG9FPW6+C5McSjvWbd7MBsY47/QAMVQPomvuCOu1RPFc9AT80ZVY b2wFglJjr6opUoVBnq4t7Rnt/QW2GXRa+liyXTTvuyHYzI0KJbFqtEplL25ZG+8e8zAz 6nNA== X-Gm-Message-State: AOJu0YyYQrUfU9LMjWBPS+DKpJ0b0mr3WGsib7d78wD43WksnS1hpr6J 8ZR62frqwguc4KKnfq+g4XHkNR9NQOflE9s/0vOqDkjPVc9yskMPcjj6RL1sSrCXkK+swgggYd3 mKzc= X-Received: by 2002:a05:600c:474d:b0:41b:f106:bb89 with SMTP id w13-20020a05600c474d00b0041bf106bb89mr6756151wmo.18.1714426305814; Mon, 29 Apr 2024 14:31:45 -0700 (PDT) Received: from m1x-phil.lan (bny92-h02-176-184-44-142.dsl.sta.abo.bbox.fr. [176.184.44.142]) by smtp.gmail.com with ESMTPSA id p6-20020a05600c468600b0041563096e15sm47015588wmo.5.2024.04.29.14.31.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Apr 2024 14:31:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PATCH v2 10/13] accel/tcg: Remove NULL check in tcg_flush_jmp_cache() Date: Mon, 29 Apr 2024 23:30:47 +0200 Message-ID: <20240429213050.55177-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240429213050.55177-1-philmd@linaro.org> References: <20240429213050.55177-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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-bounces+patch=linaro.org@nongnu.org I /think/ this check added in commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization before registration") is now unnecessary, but I don't have the WASM reproducer mentioned in: https://lore.kernel.org/qemu-devel/20221027141856.w5umjgklawgu7pqv@heavy/ to confirm. Ilya, do you mind testing? If so, we could squash this with the previous patch. Cc: Ilya Leoshkevich Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/translate-all.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index ca1e193633..9b02f21b23 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -652,14 +652,8 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) */ void tcg_flush_jmp_cache(CPUState *cpu) { - CPUJumpCache *jc; + CPUJumpCache *jc = &cpu->accel->tb_jmp_cache; - /* During early initialization, the cache may not yet be allocated. */ - if (unlikely(cpu->accel == NULL)) { - return; - } - - jc = &cpu->accel->tb_jmp_cache; for (int i = 0; i < TB_JMP_CACHE_SIZE; i++) { qatomic_set(&jc->array[i].tb, NULL); }