From nobody Sat Apr 5 05:31:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1738158381; cv=none; d=zohomail.com; s=zohoarc; b=XhUiYNke3HIPvGVJ5UMdWnayCQ4nvYuR3dy8fyQBYudjGTiaKEGxYsRtDIUtV6sedDiQsrSDzyky7T6cjC7lPT0z7sq0swjRLgbT6xQD0rfmLBpmoh63L9zSdj8SzzacLZc6sK0BJHho7U/FZ53vahF16CMn6poYj5P2xvlSG98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738158381; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QkvyWq9gMdhHkrlDqEitBjOsFmj5r+wCqGb0Udd7APQ=; b=GOnRXNBiL5WN3hVfGmJZEIl2gtAzbOMjfQHZW1BdZuRxXTcGHIt3gb/fXSv6OCZ1rF/+eCGKmX9CrJOhTFte0+aPbFqq7iPZCAg/8/fsrPuBij2PyECFReiCM8nHe8kT76iPPVz/PpdujVp/hzkHvqSDbSrA6MkBjIE5KS1Utzk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1738158381461650.703517934206; Wed, 29 Jan 2025 05:46:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1td8NP-0007fT-96; Wed, 29 Jan 2025 08:45:07 -0500 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 1td8NC-0007Zb-41 for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:44:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1td8NA-00088x-Ld for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:44:53 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-Zax800zAPbq89YtUxSvS9w-1; Wed, 29 Jan 2025 08:44:49 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CAF2918009F5; Wed, 29 Jan 2025 13:44:46 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F3EBB1800961; Wed, 29 Jan 2025 13:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738158292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QkvyWq9gMdhHkrlDqEitBjOsFmj5r+wCqGb0Udd7APQ=; b=QQD6kvfv4V5bPEGUHDWF1HObyzlEVlFdqUKLFSGKYPAJYHKgRnx59FTAUynDApNywxooG6 nyzKXPKWQazX4tYSv7nivqZ43SAa1Qh4pBpXcT8xKKDB2yppeNPz+0diNm29fDoqpWrJrf 9RWmf0jt23nLFSgaSMb1f4tY2hhjJu0= X-MC-Unique: Zax800zAPbq89YtUxSvS9w-1 X-Mimecast-MFC-AGG-ID: Zax800zAPbq89YtUxSvS9w From: Igor Mammedov To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com, imp@bsdimp.com, kevans@freebsd.org, gaosong@loongson.cn, laurent@vivier.eu Subject: [PATCH 1/6] bsd-user: drop not longer used target_reset_cpu() Date: Wed, 29 Jan 2025 14:44:31 +0100 Message-ID: <20250129134436.1240740-2-imammedo@redhat.com> In-Reply-To: <20250129134436.1240740-1-imammedo@redhat.com> References: <20250129134436.1240740-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1738158383555019000 target_reset_cpu() static inlines have no user, remove them. Signed-off-by: Igor Mammedov --- bsd-user/aarch64/target_arch_cpu.h | 5 ----- bsd-user/arm/target_arch_cpu.h | 4 ---- bsd-user/i386/target_arch_cpu.h | 5 ----- bsd-user/riscv/target_arch_cpu.h | 4 ---- bsd-user/x86_64/target_arch_cpu.h | 5 ----- 5 files changed, 23 deletions(-) diff --git a/bsd-user/aarch64/target_arch_cpu.h b/bsd-user/aarch64/target_a= rch_cpu.h index 87fbf6d677..46a448e93f 100644 --- a/bsd-user/aarch64/target_arch_cpu.h +++ b/bsd-user/aarch64/target_arch_cpu.h @@ -181,9 +181,4 @@ static inline void target_cpu_clone_regs(CPUARMState *e= nv, target_ulong newsp) pstate_write(env, 0); } =20 -static inline void target_cpu_reset(CPUArchState *env) -{ -} - - #endif /* TARGET_ARCH_CPU_H */ diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index bc2eaa0bf4..b9583b0f92 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -206,8 +206,4 @@ static inline void target_cpu_clone_regs(CPUARMState *e= nv, target_ulong newsp) env->regs[0] =3D 0; } =20 -static inline void target_cpu_reset(CPUArchState *env) -{ -} - #endif /* TARGET_ARCH_CPU_H */ diff --git a/bsd-user/i386/target_arch_cpu.h b/bsd-user/i386/target_arch_cp= u.h index 5d4c931dec..371e702799 100644 --- a/bsd-user/i386/target_arch_cpu.h +++ b/bsd-user/i386/target_arch_cpu.h @@ -194,9 +194,4 @@ static inline void target_cpu_clone_regs(CPUX86State *e= nv, target_ulong newsp) env->regs[R_EAX] =3D 0; } =20 -static inline void target_cpu_reset(CPUArchState *env) -{ - cpu_reset(env_cpu(env)); -} - #endif /* TARGET_ARCH_CPU_H */ diff --git a/bsd-user/riscv/target_arch_cpu.h b/bsd-user/riscv/target_arch_= cpu.h index ef92f00480..d3cc5adbf4 100644 --- a/bsd-user/riscv/target_arch_cpu.h +++ b/bsd-user/riscv/target_arch_cpu.h @@ -141,8 +141,4 @@ static inline void target_cpu_clone_regs(CPURISCVState = *env, target_ulong newsp) env->gpr[xT0] =3D 0; } =20 -static inline void target_cpu_reset(CPUArchState *env) -{ -} - #endif /* TARGET_ARCH_CPU_H */ diff --git a/bsd-user/x86_64/target_arch_cpu.h b/bsd-user/x86_64/target_arc= h_cpu.h index f82042e30a..8ec5c65fab 100644 --- a/bsd-user/x86_64/target_arch_cpu.h +++ b/bsd-user/x86_64/target_arch_cpu.h @@ -169,9 +169,4 @@ static inline void target_cpu_clone_regs(CPUX86State *e= nv, target_ulong newsp) env->regs[R_EAX] =3D 0; } =20 -static inline void target_cpu_reset(CPUArchState *env) -{ - cpu_reset(env_cpu(env)); -} - #endif /* TARGET_ARCH_CPU_H */ --=20 2.43.0 From nobody Sat Apr 5 05:31:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1738158403; cv=none; d=zohomail.com; s=zohoarc; b=Q2+g0EKXi5epJqZUz6ivljjkD69A9KGeTykg1EsVO23LVb5zvl/WO2pmkwYwwUx6nW9IqiZpCqMm4FPdlyQVQhIF7c/u0OMYRQ9+zAia2IN6/aZWleztH4tXP2KrscyNF83m1uhPffn0yhW7dHjfWCd3stBHLBmI//1+fUbZrdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738158403; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=phuczgUjF3NvuXIBPeHchwAabJFc8U0enl900AjpFz0=; b=bJx6+p556D76FzD4HYI9LfIgSkShOYGsQwDN/pDNyZ7ZO7xxreuuWPgkMO2/r0FJiSo3w/mpeaVgyeFusaVc4+SW4CkR7xswPR0tk4QglW1XQ+6tbpEjOPHGo9uDFEWA0671FlNe3Y/gZeoUb4mlOF+nj8oWOTE7f92LUICpVqU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1738158403454260.6092726077469; Wed, 29 Jan 2025 05:46:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1td8NO-0007do-4D; Wed, 29 Jan 2025 08:45:06 -0500 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 1td8NH-0007Zr-Tk for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1td8NG-00089o-0q for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:44:59 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-IGR0x9hOM6OySfZWL5GEyg-1; Wed, 29 Jan 2025 08:44:52 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 531E9195608D; Wed, 29 Jan 2025 13:44:50 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7E89B1800951; Wed, 29 Jan 2025 13:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738158295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=phuczgUjF3NvuXIBPeHchwAabJFc8U0enl900AjpFz0=; b=OLQO19o6vOct+VGLCmhw6RhoOwBhYQWYKGdsoLcP1MwXAxVCufyzlFmIK4x9HqA9KQpC3c QlfQLtsyXCejXboktMO3Ajek7p7Ki4dFHFqiK62Iq57A8xG6mFV0z4Jf5+jnK7JLqS5hq9 b3AJC2bHYmwX7R6knKE3LlXJ4APrMPE= X-MC-Unique: IGR0x9hOM6OySfZWL5GEyg-1 X-Mimecast-MFC-AGG-ID: IGR0x9hOM6OySfZWL5GEyg From: Igor Mammedov To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com, imp@bsdimp.com, kevans@freebsd.org, gaosong@loongson.cn, laurent@vivier.eu Subject: [PATCH 2/6] loongarch: reset vcpu after it's created Date: Wed, 29 Jan 2025 14:44:32 +0100 Message-ID: <20250129134436.1240740-3-imammedo@redhat.com> In-Reply-To: <20250129134436.1240740-1-imammedo@redhat.com> References: <20250129134436.1240740-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1738158405455019000 Reseting vcpu before its thread is created, caused various issues in the pa= st for other targets. It doesn't cause issues for loongarch at the moment but to be consistent with the rest of targets, move reset during realize time after qemu_init_vcpu(). Signed-off-by: Igor Mammedov --- target/loongarch/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index e91f4a5239..15018d43ae 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -634,8 +634,8 @@ static void loongarch_cpu_realizefn(DeviceState *dev, E= rror **errp) =20 loongarch_cpu_register_gdb_regs_for_features(cs); =20 - cpu_reset(cs); qemu_init_vcpu(cs); + cpu_reset(cs); =20 lacc->parent_realize(dev, errp); } --=20 2.43.0 From nobody Sat Apr 5 05:31:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1738158329; cv=none; d=zohomail.com; s=zohoarc; b=WG4Lt00jJ5SNixnqilKYCM716vGWGQEcdauqjSI+SiT8/cYovGw63SBmKi8Tqi4yx793eHyMtMXYwENknCwuaC0RnKU+QZQN9lTIYSGeYm2mxgDWUAbPBn9uZkKi/MUmZLVR+pRPmymhQ4ueGHaSoCqvF0xJNg/VVP6DmkSZxhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738158329; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VO91E1FlAM+qaGkzqg2uqgrKeXOgETMx8CjvOfgixsc=; b=f0gx8YV9CAtG0Z5XfXlxtQ+FdYkucGGm4Nh7zRzQL54QZzjhhi22zS/6jxotcKfe4emjQWF9K03iiTY8Dbi2mkuHnKUMTypVuwrD7PDDNXZA4mkk2DXPaVJEM0Iq5iS71IqRkon1py/CuZAAdzsqFQeErWTdSWdjR5eIqRw8Mm8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173815832949718.395167043754327; Wed, 29 Jan 2025 05:45:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1td8NQ-0007g3-In; Wed, 29 Jan 2025 08:45:08 -0500 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 1td8NN-0007cY-6H for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1td8NJ-0008Aj-Lf for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:04 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-374-Y8bpypsLPCK7t24Ue7PIag-1; Wed, 29 Jan 2025 08:44:55 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 474E51800361; Wed, 29 Jan 2025 13:44:53 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5ADC1800352; Wed, 29 Jan 2025 13:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738158300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VO91E1FlAM+qaGkzqg2uqgrKeXOgETMx8CjvOfgixsc=; b=L1G4YsyxI5SLEGmZ1bu7EtUZVXQfd5Z/Uzk1lP3/ad6LDNwmNgbfAyCmU7MhlSppxGGjG9 TLsKfSbziF1Y1hwUBSaaJP9kSiHjXExo5EIBFRgSvWkCPrI4+nP24IYcO8sJp30pD1vOCG d1Vbgg+MuI3g4rhJICx82PzWMHpu588= X-MC-Unique: Y8bpypsLPCK7t24Ue7PIag-1 X-Mimecast-MFC-AGG-ID: Y8bpypsLPCK7t24Ue7PIag From: Igor Mammedov To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com, imp@bsdimp.com, kevans@freebsd.org, gaosong@loongson.cn, laurent@vivier.eu Subject: [PATCH 3/6] m68k: reset vcpu after it's created Date: Wed, 29 Jan 2025 14:44:33 +0100 Message-ID: <20250129134436.1240740-4-imammedo@redhat.com> In-Reply-To: <20250129134436.1240740-1-imammedo@redhat.com> References: <20250129134436.1240740-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1738158331936019000 Reseting vcpu before its thread is created, caused various issues in the pa= st for other targets. It doesn't cause issues for m68k at the moment but to be consistent with the rest of targets, move reset during realize time after qemu_init_vcpu(). Signed-off-by: Igor Mammedov --- target/m68k/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 41dfdf5804..3fd2663fb0 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -334,8 +334,8 @@ static void m68k_cpu_realizefn(DeviceState *dev, Error = **errp) =20 m68k_cpu_init_gdb(cpu); =20 - cpu_reset(cs); qemu_init_vcpu(cs); + cpu_reset(cs); =20 mcc->parent_realize(dev, errp); } --=20 2.43.0 From nobody Sat Apr 5 05:31:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1738158344; cv=none; d=zohomail.com; s=zohoarc; b=Z23bp64CTiljrG0DZ6doasxnZhYbDbKM4hNJc6pNJgqt8FCGif9/kPC7CP78BeIEPFGmMLL6qJ2RinWB9VwBjMOyOznpFr/7Ge+2KCyjNNYAmslcNR2vFoZqlSnV0fS8bG155JDhrk1X2g9t+1J1qFPLnM7veYWMaSZLAHTyd6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738158344; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mBQt2BZ9Pble/MczGAKPnWj9zi6Lm9BXY9A2HjlrxTM=; b=ZtcbMKi5RrKQXOtvhkrPEQ/lKHSkWHiab4mfW9LrAYeqXyBUmj0BBEGLcKXCD9CzJXSPe0BHmvUIYBNi0wWVTzQLramBo/vjK4NVrGcIp5W8N36jMYQqESobuVvyI0PfHb4rQHkJ23TKKLSEBziuipg99HWM7ji3Xee8HoL/0BM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1738158344381242.97024398593612; Wed, 29 Jan 2025 05:45:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1td8NR-0007h6-W1; Wed, 29 Jan 2025 08:45:10 -0500 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 1td8NN-0007cb-9M for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1td8NJ-0008Am-Ny for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:05 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-CruW9kk2OmaWWgH41rV15g-1; Wed, 29 Jan 2025 08:44:57 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 17EEF1800361; Wed, 29 Jan 2025 13:44:56 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AD1A11800352; Wed, 29 Jan 2025 13:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738158300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mBQt2BZ9Pble/MczGAKPnWj9zi6Lm9BXY9A2HjlrxTM=; b=DZ2aE6M0AnKCFsUT6tUPjsCtvIiI80b5J4fXfKw5n5Uvo2TKuWqJ4Ynv45gyKKOXTX9b68 FX8ACVkJ6YtnyxZP/93oPRa+jiyQ/DPGoKNcfUvKCOlXzm9CbVSCMBS/ZjXGTaPZ1I9mKu 25yAaKTHCTyckvjr+cNb8Jiy/nU/gXk= X-MC-Unique: CruW9kk2OmaWWgH41rV15g-1 X-Mimecast-MFC-AGG-ID: CruW9kk2OmaWWgH41rV15g From: Igor Mammedov To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com, imp@bsdimp.com, kevans@freebsd.org, gaosong@loongson.cn, laurent@vivier.eu Subject: [PATCH 4/6] tcg:tlb: use tcg_debug_assert() in assert_cpu_is_self() Date: Wed, 29 Jan 2025 14:44:34 +0100 Message-ID: <20250129134436.1240740-5-imammedo@redhat.com> In-Reply-To: <20250129134436.1240740-1-imammedo@redhat.com> References: <20250129134436.1240740-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1738158346117019000 that will enable assert_cpu_is_self when QEMU is configured with --enable-debug without need for manual patching DEBUG_TLB_GATE define. Need to manually path DEBUG_TLB_GATE define to enable assert, let regression caused by [1] creep in unnoticed. 1) 30933c4fb4f3d ("tcg/cputlb: remove other-cpu capability from TLB flushin= g") Signed-off-by: Igor Mammedov Suggested-by: Alex Benn=C3=A9e --- accel/tcg/cputlb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b4ccf0cdcb..71207d6dbf 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -61,8 +61,8 @@ # define DEBUG_TLB_LOG_GATE 0 # endif #else -# define DEBUG_TLB_GATE 0 -# define DEBUG_TLB_LOG_GATE 0 +# define DEBUG_TLB_GATE 1 +# define DEBUG_TLB_LOG_GATE 1 #endif =20 #define tlb_debug(fmt, ...) do { \ @@ -74,11 +74,8 @@ } \ } while (0) =20 -#define assert_cpu_is_self(cpu) do { \ - if (DEBUG_TLB_GATE) { \ - g_assert(!(cpu)->created || qemu_cpu_is_self(cpu)); \ - } \ - } while (0) +#define assert_cpu_is_self(cpu) \ + tcg_debug_assert(!(cpu)->created || qemu_cpu_is_self(cpu)) =20 /* run_on_cpu_data.target_ptr should always be big enough for a * vaddr even on 32 bit builds --=20 2.43.0 From nobody Sat Apr 5 05:31:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1738158394; cv=none; d=zohomail.com; s=zohoarc; b=jwVvO7nJLiwrW7SHa39G12VfaEJQaWfxrx48r7gvCX0G/TM/tgiBXM2/KHxnn9rX0lwgvl9mImH9m3SW+XAkDtj8L2v3yYZoVtJM5wRKTL0lwBvZbdQD8HA/gv8RiTlj/GGKsHW3GdOLevBBj7LA7fqmoPxpXoxdHKK+PmY10d4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738158394; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WondAvZ/n5a1SFkDwYqS9KCSNSrSWDpI4BteXa+G/U8=; b=HGg/7L0zpv/BVVgJ2GbwjjzMnA5jYvxP9WxHP9ENOW9Pt+lR4uiZl8/jYdv3IQ/EbJDUrDqE4wfsh7gby9jr7tEnpgNApdKYk0Onzhw/BGvrF88HlXUMz+1vaFZNQKTu3qmRoNPMC5FpQzvOybCN5dX9kDSoOrp5a+q2bcOX+Ng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173815839464496.9109955021471; Wed, 29 Jan 2025 05:46:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1td8NS-0007hC-6A; Wed, 29 Jan 2025 08:45:10 -0500 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 1td8NP-0007fV-A0 for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1td8NN-0008MU-HE for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:07 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-597-VRFeNc4tNQu7EsQTyMPkew-1; Wed, 29 Jan 2025 08:45:01 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 303CE1800374; Wed, 29 Jan 2025 13:44:59 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7E0FC1800955; Wed, 29 Jan 2025 13:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738158304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WondAvZ/n5a1SFkDwYqS9KCSNSrSWDpI4BteXa+G/U8=; b=RoOOPB+VrdAh++HsosvMFCuWYulYlt3SIm9+IV0fQTnqAFgJLVQByrJReBXzlMzhgk77I8 4PhOoGgzPtmncMH1Oc9NhHIrvunpLqoRvy6Har6P2raxdbo6Ki8C5MAG5FsZhdWAsR4NWB LZYhsEm0feAynYlVOqlUF2uBNhqPbhI= X-MC-Unique: VRFeNc4tNQu7EsQTyMPkew-1 X-Mimecast-MFC-AGG-ID: VRFeNc4tNQu7EsQTyMPkew From: Igor Mammedov To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com, imp@bsdimp.com, kevans@freebsd.org, gaosong@loongson.cn, laurent@vivier.eu, npiggin@gmail.com Subject: [PATCH 5/6] Revert "tcg/cputlb: remove other-cpu capability from TLB flushing" Date: Wed, 29 Jan 2025 14:44:35 +0100 Message-ID: <20250129134436.1240740-6-imammedo@redhat.com> In-Reply-To: <20250129134436.1240740-1-imammedo@redhat.com> References: <20250129134436.1240740-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1738158415995019000 1) This reverts commit 30933c4fb4f3df95ae44c4c3c86a5df049852c01. ("tcg/cputlb: remove other-cpu capability from TLB flushing") The commit caused a regression which went unnoticed due to affected being disabled by default (DEBUG_TLB_GATE 0) Previous patch moved switched to using tcg_debug_assert() so that at least on debug builds assert_cpu_is_self() path would be exercised. And that lead to exposing regression introduced by [1] with abort during te= sts. to reproduce: $ configure --target-list=3Dx86_64-softmmu --enable-debug $ make && ./qemu-system-x86_64 accel/tcg/cputlb.c:419: tlb_flush_by_mmuidx: Assertion `!(cpu)->created || qemu_cpu_is_self(cpu)' failed. which is triggered by usage outside of cpu thread: x86_cpu_new -> ... -> x86_cpu_realizefn -> cpu_reset -> ... -> tcg_cpu_reset_hold Drop offending commit for now, until a propper fix that doesn't break 'make check' is available. PS: fixup g_memdup() checkpatch error s/g_memdup/g_memdup2/ Signed-off-by: Igor Mammedov --- I'll leave it upto TCG folz to fix it up propperly. CC: npiggin@gmail.com CC: richard.henderson@linaro.org --- accel/tcg/cputlb.c | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 71207d6dbf..db1713b3ca 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -416,9 +416,12 @@ void tlb_flush_by_mmuidx(CPUState *cpu, uint16_t idxma= p) { tlb_debug("mmu_idx: 0x%" PRIx16 "\n", idxmap); =20 - assert_cpu_is_self(cpu); - - tlb_flush_by_mmuidx_async_work(cpu, RUN_ON_CPU_HOST_INT(idxmap)); + if (cpu->created && !qemu_cpu_is_self(cpu)) { + async_run_on_cpu(cpu, tlb_flush_by_mmuidx_async_work, + RUN_ON_CPU_HOST_INT(idxmap)); + } else { + tlb_flush_by_mmuidx_async_work(cpu, RUN_ON_CPU_HOST_INT(idxmap)); + } } =20 void tlb_flush(CPUState *cpu) @@ -607,12 +610,28 @@ void tlb_flush_page_by_mmuidx(CPUState *cpu, vaddr ad= dr, uint16_t idxmap) { tlb_debug("addr: %016" VADDR_PRIx " mmu_idx:%" PRIx16 "\n", addr, idxm= ap); =20 - assert_cpu_is_self(cpu); - /* This should already be page aligned */ addr &=3D TARGET_PAGE_MASK; =20 - tlb_flush_page_by_mmuidx_async_0(cpu, addr, idxmap); + if (qemu_cpu_is_self(cpu)) { + tlb_flush_page_by_mmuidx_async_0(cpu, addr, idxmap); + } else if (idxmap < TARGET_PAGE_SIZE) { + /* + * Most targets have only a few mmu_idx. In the case where + * we can stuff idxmap into the low TARGET_PAGE_BITS, avoid + * allocating memory for this operation. + */ + async_run_on_cpu(cpu, tlb_flush_page_by_mmuidx_async_1, + RUN_ON_CPU_TARGET_PTR(addr | idxmap)); + } else { + TLBFlushPageByMMUIdxData *d =3D g_new(TLBFlushPageByMMUIdxData, 1); + + /* Otherwise allocate a structure, freed by the worker. */ + d->addr =3D addr; + d->idxmap =3D idxmap; + async_run_on_cpu(cpu, tlb_flush_page_by_mmuidx_async_2, + RUN_ON_CPU_HOST_PTR(d)); + } } =20 void tlb_flush_page(CPUState *cpu, vaddr addr) @@ -775,8 +794,6 @@ void tlb_flush_range_by_mmuidx(CPUState *cpu, vaddr add= r, { TLBFlushRangeData d; =20 - assert_cpu_is_self(cpu); - /* * If all bits are significant, and len is small, * this devolves to tlb_flush_page. @@ -797,7 +814,14 @@ void tlb_flush_range_by_mmuidx(CPUState *cpu, vaddr ad= dr, d.idxmap =3D idxmap; d.bits =3D bits; =20 - tlb_flush_range_by_mmuidx_async_0(cpu, d); + if (qemu_cpu_is_self(cpu)) { + tlb_flush_range_by_mmuidx_async_0(cpu, d); + } else { + /* Otherwise allocate a structure, freed by the worker. */ + TLBFlushRangeData *p =3D g_memdup2(&d, sizeof(d)); + async_run_on_cpu(cpu, tlb_flush_range_by_mmuidx_async_1, + RUN_ON_CPU_HOST_PTR(p)); + } } =20 void tlb_flush_page_bits_by_mmuidx(CPUState *cpu, vaddr addr, --=20 2.43.0 From nobody Sat Apr 5 05:31:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1738158395; cv=none; d=zohomail.com; s=zohoarc; b=YTBTiS7yeNvyM3pP7KXzPkrDnBgZda1URpPZsCDSK3TC/M5LgYSzbuZ2zBX/piJFmlED+V0g1EZG5gBE8oEXmRjO1mMHYDDmJRmmeSWofeQvJzaVOfsO2G905kfThHCczdXFwT4mTJJnM4iQCN+EOm305OO/jnBIZfvSW9NseUw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738158395; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=50Bv2/qDBPtZJ13SGpMTxWLEPlXbmYPo0SPJLjJs8L4=; b=Zl9rauykUUvWoDztAwFQrriozp/VKxvi/OiIfBCogJ347tCXlNvCbnbb+UV7et7k+zVbggiRiF2Wd6tjRJR8cHHMZ3BC+0Ti/AmhjdCADpzfSdiqGIyssoYZy8bDw+dvtJOXCrboSLiPVPEDWwcdXWngYJvzFb7HGQBPjLgCcXE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1738158395050823.0758547249317; Wed, 29 Jan 2025 05:46:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1td8NV-0007jt-5M; Wed, 29 Jan 2025 08:45:13 -0500 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 1td8NS-0007iG-GP for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1td8NQ-0008Nn-Tj for qemu-devel@nongnu.org; Wed, 29 Jan 2025 08:45:10 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-dkrflmNMNTCih589BaxNYw-1; Wed, 29 Jan 2025 08:45:03 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D4A38180035E; Wed, 29 Jan 2025 13:45:01 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 97CFD1800951; Wed, 29 Jan 2025 13:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738158307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=50Bv2/qDBPtZJ13SGpMTxWLEPlXbmYPo0SPJLjJs8L4=; b=DkfKmelNdPQKQihF/ciJkAiRvmcAEaJVj2vDlDcmwxmFLkuyeXC4Ttmo2hrTrVyPeFL+4F esak963QS6HWQfHuWgpyrGUpAwMR02x6TYTBpehZv6sGVb9zBcsdwcj7xAMfVoYQY+GLHj QEqASnc8D3eJRLAMiyo7cmh91NSeP5A= X-MC-Unique: dkrflmNMNTCih589BaxNYw-1 X-Mimecast-MFC-AGG-ID: dkrflmNMNTCih589BaxNYw From: Igor Mammedov To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com, imp@bsdimp.com, kevans@freebsd.org, gaosong@loongson.cn, laurent@vivier.eu Subject: [PATCH 6/6] tcg: drop cpu->created check Date: Wed, 29 Jan 2025 14:44:36 +0100 Message-ID: <20250129134436.1240740-7-imammedo@redhat.com> In-Reply-To: <20250129134436.1240740-1-imammedo@redhat.com> References: <20250129134436.1240740-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1738158397610019000 previous commits fixed 2 remaining cases where vcpu might have had 'cpu->created =3D=3D false' during 1st vcpu reset (at realize time) that leads to call chain tcg_cpu_reset_hold() =3D> tlb_flush_by_mmuidx() remove not need anymore check, with cpu->created always being true. Signed-off-by: Igor Mammedov --- accel/tcg/cputlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index db1713b3ca..f4f3965518 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -75,7 +75,7 @@ } while (0) =20 #define assert_cpu_is_self(cpu) \ - tcg_debug_assert(!(cpu)->created || qemu_cpu_is_self(cpu)) + tcg_debug_assert(qemu_cpu_is_self(cpu)) =20 /* run_on_cpu_data.target_ptr should always be big enough for a * vaddr even on 32 bit builds @@ -416,7 +416,7 @@ void tlb_flush_by_mmuidx(CPUState *cpu, uint16_t idxmap) { tlb_debug("mmu_idx: 0x%" PRIx16 "\n", idxmap); =20 - if (cpu->created && !qemu_cpu_is_self(cpu)) { + if (!qemu_cpu_is_self(cpu)) { async_run_on_cpu(cpu, tlb_flush_by_mmuidx_async_work, RUN_ON_CPU_HOST_INT(idxmap)); } else { --=20 2.43.0