From nobody Fri May 17 12:14:38 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696336273; cv=none; d=zohomail.com; s=zohoarc; b=mnQvKalDaIk0fqICHgnKJjeD6jj0Pk3bh2bPhszXSW019vm6sxTwhpufSstlCtWqshxUjcIPJoD0ZPrLqo62yvqXn1oI9IuWju23h+nZpgsntpPhVVCkKFGKS2gI1W6pzypde+Bn/8YEFXpGim9MebKvhPmZKj9aWoNz0DoL48s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696336273; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bqFGd5F05ZVpX+rAUXHuXXrGJSE30XMuMRRy/YP47Yw=; b=AoP519+v/V9tu+ndal/NWeTzyrtoL1dB+BY3belxDeNpabA9CjsluvfSD4ecf04Jo5U8KVmR1F9cnFncC6yYWOeUe9kxd4H+Ipnit3vVJxaFYngI52rRgHtrCKKeURLvt88ATgCFjk+EvcDFAXtotLRQlvvdECTItq4dSm13qfc= 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 1696336273084232.28878916460246; Tue, 3 Oct 2023 05:31:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qneYD-00007p-PS; Tue, 03 Oct 2023 08:30:57 -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 1qneY1-0008QB-4U for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:30:46 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qneXu-0007h2-IP for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:30:41 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-406589e5765so8507395e9.0 for ; Tue, 03 Oct 2023 05:30:37 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id k2-20020a05600c1c8200b004065d72ab19sm9405951wms.0.2023.10.03.05.30.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 05:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696336236; x=1696941036; 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=bqFGd5F05ZVpX+rAUXHuXXrGJSE30XMuMRRy/YP47Yw=; b=CQjapap7b5Xqe/zibWsYoe/Ap4RX4Ra11E5kYthsh8PjPzw3Bc0UqpYrEn2cm4kEL1 epQoCgj9RO48O45N3I060Ik0YuY+eeVQqRCm4paXZDv8cF4nvDyP2Z74BTkXhbY7Z6A7 HndZCIYBrUgFmN3PnSnyRMf1tMMZ3njBaW+cQVf/LJrYsS/P3z+YVxTbtnWKfQr8XXPD vljm8BZ/Jl9y8JLmqb+6sVwu/iqK78v7eHxVRmfP+stFJMtxbfY0iuGXOiyElZj9zVl9 rCJNvKwwYsaPK1SfgClziH6M+g0wbGlRznl2ZDKKaIHWxIFFByJ6NC+GPx1JXbI7B1Id ct3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696336236; x=1696941036; 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=bqFGd5F05ZVpX+rAUXHuXXrGJSE30XMuMRRy/YP47Yw=; b=n2U5o5dIthqUs0+MITGVzLhTImmuzZ6Bknula/3SkK3Jk1c7BE4Tg0TDB79HnDD5Y/ 3FLqDXtGPWgvFxQmhH12PEWdB/Jrvzdd0qUHG8TTpntPIFTkEP85gX9iJkNhEr7XGCGQ jWYOBxpxZWZr5ov+qhEPo0ANQ2thUx0wjFeKFdwZWTBfYtDs7nkOWc2HAvY9scFRUuAG oIkcOkeLguX2KEcjFAzZbo7pM67ulH7tI+mvixmqCChLIFRcbE31x886p0NjL86Q7et+ 9vpOpUETcxRU2B9rffTI84q+X5RtsaHzaxaR9PsNWzIV3BOZp/3kqlxZJXvnuB92WQyw Z6KA== X-Gm-Message-State: AOJu0YyePxW1DJJnWSbPXRmkdt4fjTgNgsx5Z7lFcLVdLT/QCvsrpfYY pfRQsnrnuldCQosr5CfAWWlTldr8o9F+9Rkcz9Uzjw== X-Google-Smtp-Source: AGHT+IHlCemvbL7m1K7IS5TqiHcr5lgRDPenb1BNclDOxWgfEhUSel/BooBOcvOiYSYcDzQ5Hhk7WQ== X-Received: by 2002:a05:600c:210a:b0:3fe:e7b2:c97f with SMTP id u10-20020a05600c210a00b003fee7b2c97fmr12100982wml.36.1696336235719; Tue, 03 Oct 2023 05:30:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Cameron Esfahani Subject: [PATCH v2 1/7] accel: Rename accel_cpu_realizefn() -> accel_cpu_realize() Date: Tue, 3 Oct 2023 14:30:19 +0200 Message-ID: <20231003123026.99229-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003123026.99229-1-philmd@linaro.org> References: <20231003123026.99229-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696336274548100011 We use the '*fn' suffix for handlers, this is a public method. Drop the suffix. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana --- include/qemu/accel.h | 4 ++-- accel/accel-common.c | 2 +- cpu.c | 2 +- target/i386/kvm/kvm-cpu.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index e84db2e3e5..cb64a07b84 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -90,11 +90,11 @@ void accel_setup_post(MachineState *ms); void accel_cpu_instance_init(CPUState *cpu); =20 /** - * accel_cpu_realizefn: + * accel_cpu_realize: * @cpu: The CPU that needs to call accel-specific cpu realization. * @errp: currently unused. */ -bool accel_cpu_realizefn(CPUState *cpu, Error **errp); +bool accel_cpu_realize(CPUState *cpu, Error **errp); =20 /** * accel_supported_gdbstub_sstep_flags: diff --git a/accel/accel-common.c b/accel/accel-common.c index df72cc989a..b953855e8b 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -119,7 +119,7 @@ void accel_cpu_instance_init(CPUState *cpu) } } =20 -bool accel_cpu_realizefn(CPUState *cpu, Error **errp) +bool accel_cpu_realize(CPUState *cpu, Error **errp) { CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 diff --git a/cpu.c b/cpu.c index 0769b0b153..61c9760e62 100644 --- a/cpu.c +++ b/cpu.c @@ -136,7 +136,7 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) /* cache the cpu class for the hotpath */ cpu->cc =3D CPU_GET_CLASS(cpu); =20 - if (!accel_cpu_realizefn(cpu, errp)) { + if (!accel_cpu_realize(cpu, errp)) { return; } =20 diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index 7237378a7d..4474689f81 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -35,7 +35,7 @@ static bool kvm_cpu_realizefn(CPUState *cs, Error **errp) * x86_cpu_realize(): * -> x86_cpu_expand_features() * -> cpu_exec_realizefn(): - * -> accel_cpu_realizefn() + * -> accel_cpu_realize() * kvm_cpu_realizefn() -> host_cpu_realizefn() * -> check/update ucode_rev, phys_bits, mwait */ --=20 2.41.0 From nobody Fri May 17 12:14:38 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696336272; cv=none; d=zohomail.com; s=zohoarc; b=Llpvh+qOHZYFNjYoKSXCahItgZctz1ReTLbPjHFmxcqBiMNLH8i3dCg6/9BRbL+83hPonDc2WfqzIVqIIqBl7Mm6gz/ASd5cBJlp4LrqvGnpSCn98vW5S0qjKs6FsjcrZOEokS6AwJWKZrfhOfRgmBUI+r6J8NO5TAQlw0mxFMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696336272; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kJP8U3eqs5eoWVLjFoE8nfmBFTz8cZ5KMaYYsencWoY=; b=dFUDHMqOOW66fvk6IjfdDMtqv+CxiUI3MJyiGG83vgIzlN2W2jYAi7WupK5DuV4vxogUto7jjRPssWMWC1XZdhLeZ3CfPIuJdvF/yWH10KbrKf2W53W2S0yVtPOIrphIrf4Tlur2YkxrEA9XAa66hCPxXC8kDIz7+Vo5/QyAdXM= 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 169633627227234.81536435803537; Tue, 3 Oct 2023 05:31:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qneYF-0000B6-RX; Tue, 03 Oct 2023 08:30:59 -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 1qneYD-00007q-50 for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:30:57 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qneY5-0007ho-Ao for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:30:56 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3214cdb4b27so873986f8f.1 for ; Tue, 03 Oct 2023 05:30:43 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id c15-20020a05600c0acf00b003fe29f6b61bsm1193158wmr.46.2023.10.03.05.30.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 05:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696336242; x=1696941042; 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=kJP8U3eqs5eoWVLjFoE8nfmBFTz8cZ5KMaYYsencWoY=; b=CWV4Ss0P1hJC+NgTiVEmYtnq26bfbjh7Y+XlLGdmJhDnaC+Zvx5qm1Gg1fR81FM+F7 O92vDbMfP3vHcy33sPsPzj2gFfIxS83UFHxH/WD3Ns7zn1mPL8r7F0uh7rPgm3i5ltCt b3lqrB03/0KZ0PjU0IXuuUWFVWJv+rUJKfIcod9x/qA7TjJzdqfNavJi4G9WV+VkQo9r 1pzX240eGmu9vRwNmFzI0TMGIu2DqLmkoGge/h8ipSOdnbcE8foL8HFdKP8F1XP7Ls5Y A1Z0jWCk3fTESq8nu67yh/qJTojcQ3aZt6wtStl+tpXQewZRfDOVL6DehwKatvitmWEq Yqfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696336242; x=1696941042; 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=kJP8U3eqs5eoWVLjFoE8nfmBFTz8cZ5KMaYYsencWoY=; b=LZND7dFX+AkdcXbsICd1rS29fF2luxA97Qx0y7d4AUUXnLJvtphuvmWhsgP2x1i24u 6iFTHXmUO4Bmz96Pk5aCplG+Nngyr+C699KKc3QO94KZKGg5tXJ5KZvN02p9UWgBj2sP jXt+WukiKiqisTbN/Oo1fgoRi0TeNks01fVf/SofDv2SvG4HUA2TGBBLU1WF6KSbrWrq shQl132WOKN5W76ANjV9CPGDcngPH7qvcjFkh9Yjxe3oieYDmQPz+g5u3faieUFc3Rx7 kaI1B+0vPC6o8BtSIpCNRkJrxhICHMuu7srYXvZNA0484Wkor1rsuOckMRCpagSGw2Zy KX0g== X-Gm-Message-State: AOJu0YxLv3dOw8UIgo7hoj7SQM0O6YHDlSvKW9f/HzbMmT2CXy9slqlw 34I8b+SrHOoBMA4esuvdCNiOxHos/YBEP7dLxC/4Og== X-Google-Smtp-Source: AGHT+IGUR2wNUuIBOoLxXPGLs96PG6WE7nSADBCjWoauQJ7ZMRjhIbxyisKYzFjcYkRhDb1hGd57iQ== X-Received: by 2002:a5d:4a05:0:b0:317:7af4:5294 with SMTP id m5-20020a5d4a05000000b003177af45294mr12996108wrq.44.1696336241902; Tue, 03 Oct 2023 05:30:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Cameron Esfahani Subject: [PATCH v2 2/7] accel: Rename AccelCPUClass::cpu_realizefn() -> cpu_target_realize() Date: Tue, 3 Oct 2023 14:30:20 +0200 Message-ID: <20231003123026.99229-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003123026.99229-1-philmd@linaro.org> References: <20231003123026.99229-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696336273065100001 The AccelCPUClass::cpu_realizefn handler is meant for target specific code, rename it using '_target_' to emphasis it. Suggested-by: Claudio Fontana Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana --- include/hw/core/accel-cpu.h | 2 +- accel/accel-common.c | 4 ++-- target/i386/hvf/hvf-cpu.c | 2 +- target/i386/kvm/kvm-cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/core/accel-cpu.h b/include/hw/core/accel-cpu.h index 5dbfd79955..24dad45ab9 100644 --- a/include/hw/core/accel-cpu.h +++ b/include/hw/core/accel-cpu.h @@ -32,7 +32,7 @@ typedef struct AccelCPUClass { =20 void (*cpu_class_init)(CPUClass *cc); void (*cpu_instance_init)(CPUState *cpu); - bool (*cpu_realizefn)(CPUState *cpu, Error **errp); + bool (*cpu_target_realize)(CPUState *cpu, Error **errp); } AccelCPUClass; =20 #endif /* ACCEL_CPU_H */ diff --git a/accel/accel-common.c b/accel/accel-common.c index b953855e8b..2e30b9d8f0 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -123,8 +123,8 @@ bool accel_cpu_realize(CPUState *cpu, Error **errp) { CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 - if (cc->accel_cpu && cc->accel_cpu->cpu_realizefn) { - return cc->accel_cpu->cpu_realizefn(cpu, errp); + if (cc->accel_cpu && cc->accel_cpu->cpu_target_realize) { + return cc->accel_cpu->cpu_target_realize(cpu, errp); } return true; } diff --git a/target/i386/hvf/hvf-cpu.c b/target/i386/hvf/hvf-cpu.c index 333db59898..bb0da3947a 100644 --- a/target/i386/hvf/hvf-cpu.c +++ b/target/i386/hvf/hvf-cpu.c @@ -77,7 +77,7 @@ static void hvf_cpu_accel_class_init(ObjectClass *oc, voi= d *data) { AccelCPUClass *acc =3D ACCEL_CPU_CLASS(oc); =20 - acc->cpu_realizefn =3D host_cpu_realizefn; + acc->cpu_target_realize =3D host_cpu_realizefn; acc->cpu_instance_init =3D hvf_cpu_instance_init; } =20 diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index 4474689f81..9a5e105e4e 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -190,7 +190,7 @@ static void kvm_cpu_accel_class_init(ObjectClass *oc, v= oid *data) { AccelCPUClass *acc =3D ACCEL_CPU_CLASS(oc); =20 - acc->cpu_realizefn =3D kvm_cpu_realizefn; + acc->cpu_target_realize =3D kvm_cpu_realizefn; acc->cpu_instance_init =3D kvm_cpu_instance_init; } static const TypeInfo kvm_cpu_accel_type_info =3D { diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index b942c306d6..5c3a508ddc 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -163,7 +163,7 @@ static void tcg_cpu_accel_class_init(ObjectClass *oc, v= oid *data) AccelCPUClass *acc =3D ACCEL_CPU_CLASS(oc); =20 #ifndef CONFIG_USER_ONLY - acc->cpu_realizefn =3D tcg_cpu_realizefn; + acc->cpu_target_realize =3D tcg_cpu_realizefn; #endif /* CONFIG_USER_ONLY */ =20 acc->cpu_class_init =3D tcg_cpu_class_init; --=20 2.41.0 From nobody Fri May 17 12:14:38 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696336274; cv=none; d=zohomail.com; s=zohoarc; b=hCxCOYS7zhcJPdFM+uZv8hX6Rdw2KQDk6IzCA9Kz4WrmkeZX8Fk4IR+uAC0QpdcY+UgsFhsyz1b1PXLNArZ2yksnCA/gWooiNzSejoLkgEU1NxgU8Fn8NS6GPa+gnI19XmLwtoWZX5jdHpl8k9rG1fP2LN/2a5CemzAmilMr2Uo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696336274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+r9kD/biBFamNwbYJdkWZ0i3n7hbuMnWH0aEsGJ6SFw=; b=c8YpAXkAyAm1H5dK8dSIcEFgaFsvPYbDmHxfGvPdjqasWVIVdmDffenFkFNveZzhjFoCpdrawOD/8S4X+TmZblhHMapXfinm70PPMmOGh38WMjeH+/QqTNFipOcsIsyID2buK3t0rcl4dwlky9/uuUo7gLNShhVngmqdDJ0QYmA= 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 1696336274353313.6987488955167; Tue, 3 Oct 2023 05:31:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qneYI-0000EQ-Ep; Tue, 03 Oct 2023 08:31:02 -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 1qneYF-0000B8-OW for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:30:59 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qneY8-0007jt-5p for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:30:59 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32487efc319so896377f8f.1 for ; Tue, 03 Oct 2023 05:30:50 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id c16-20020a7bc850000000b0040303a9965asm9309683wml.40.2023.10.03.05.30.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 05:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696336249; x=1696941049; 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=+r9kD/biBFamNwbYJdkWZ0i3n7hbuMnWH0aEsGJ6SFw=; b=U6W/nhEJ8nFZJP6mbvqYq4rXK+KXQKCoZ90l3M82qX8G4jE0dST4PanB6lWoFCSGk5 XrJIoYSAc1QpjFQDxuIhAJk+4rnC6vxiJItm31Pi9/Q0dbIuODWP21RTCkhozDDwmy0R iv2KNMHf6wwVirQbuo5IismITclJsM//+oN3VjCfY/P6aVnGtJ+ULyKjct8pVjVJ7hKN EpRheYpXJevPEfL0CYhex9QhJecKyAawkya9uKD150dh1GtuoIuRB++c1L5OElRPv40K Pw5+1GnI88lpkHs0vz8CbiXh1vzX8qT2Sw+q3GkZT3vmOdhOYxTwAVppozgB3QeHYPpe 6vfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696336249; x=1696941049; 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=+r9kD/biBFamNwbYJdkWZ0i3n7hbuMnWH0aEsGJ6SFw=; b=FWzdmN1U6RsJ5ojRcrf+f5RXKyb1l8ZeI5z8BBsB52K/wy2uNc3qGd+ScxoQDQO4Iz ne0A3F0timwm8eNASYROXl6DKn5/dk8stcQ9nrZCg/ggZlVJCwWD/UgqFXnK6u2sA/2o PiUr2WOcyBu5LKp/cgy+FCFJlYSZVEyzKle8i+rtTc1ft5ehbHesuufEf3h7S/EwzfbR VtM/6DbY2TKdIh2y7VJtB2+TOtIb3WKrL0tXN2YqBv1/lomxnlbKSJBcoY6z1ur03B9T 2a69O5eSzn7DUSwYAhCCYZq5GGBOMjua0dyytjxtX/SWgS1YkAE3CWPr9oGNYcXgYTWw zKaA== X-Gm-Message-State: AOJu0YwRc2LDXOYmn/4U4jiyZ8XQEgtO6iqCQpEYDZMMoi1DgPmOR3b9 j6QTVoTyytUlb7BqRB5Kcx1n7XLdmetfPzBIs+Ic2A== X-Google-Smtp-Source: AGHT+IHhblTpAoVK9JdeAoL6m9m3WTb9pwO1Prdgl3RZZc3YHqkdykddbrQQUTc7erRRAv19P/MBzw== X-Received: by 2002:a05:6000:186c:b0:327:d08a:1fa2 with SMTP id d12-20020a056000186c00b00327d08a1fa2mr4920150wri.36.1696336248049; Tue, 03 Oct 2023 05:30:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Cameron Esfahani Subject: [PATCH v2 3/7] accel: Rename accel_cpu_realize() -> accel_cpu_common_realize() Date: Tue, 3 Oct 2023 14:30:21 +0200 Message-ID: <20231003123026.99229-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003123026.99229-1-philmd@linaro.org> References: <20231003123026.99229-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696336276525100019 accel_cpu_realize() is a generic function working with CPUs from any target. Rename it using '_common_' to emphasis it is not target specific. Suggested-by: Claudio Fontana Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana --- include/qemu/accel.h | 4 ++-- accel/accel-common.c | 2 +- cpu.c | 2 +- target/i386/kvm/kvm-cpu.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index cb64a07b84..898159c001 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -90,11 +90,11 @@ void accel_setup_post(MachineState *ms); void accel_cpu_instance_init(CPUState *cpu); =20 /** - * accel_cpu_realize: + * accel_cpu_common_realize: * @cpu: The CPU that needs to call accel-specific cpu realization. * @errp: currently unused. */ -bool accel_cpu_realize(CPUState *cpu, Error **errp); +bool accel_cpu_common_realize(CPUState *cpu, Error **errp); =20 /** * accel_supported_gdbstub_sstep_flags: diff --git a/accel/accel-common.c b/accel/accel-common.c index 2e30b9d8f0..53cf08a89a 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -119,7 +119,7 @@ void accel_cpu_instance_init(CPUState *cpu) } } =20 -bool accel_cpu_realize(CPUState *cpu, Error **errp) +bool accel_cpu_common_realize(CPUState *cpu, Error **errp) { CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 diff --git a/cpu.c b/cpu.c index 61c9760e62..1e2649a706 100644 --- a/cpu.c +++ b/cpu.c @@ -136,7 +136,7 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) /* cache the cpu class for the hotpath */ cpu->cc =3D CPU_GET_CLASS(cpu); =20 - if (!accel_cpu_realize(cpu, errp)) { + if (!accel_cpu_common_realize(cpu, errp)) { return; } =20 diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index 9a5e105e4e..56c72f3c45 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -35,7 +35,7 @@ static bool kvm_cpu_realizefn(CPUState *cs, Error **errp) * x86_cpu_realize(): * -> x86_cpu_expand_features() * -> cpu_exec_realizefn(): - * -> accel_cpu_realize() + * -> accel_cpu_common_realize() * kvm_cpu_realizefn() -> host_cpu_realizefn() * -> check/update ucode_rev, phys_bits, mwait */ --=20 2.41.0 From nobody Fri May 17 12:14:38 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696336324; cv=none; d=zohomail.com; s=zohoarc; b=WcKtCHciBS7j/qoLXZUlKnNhLjlDtHu4CM+a6D6ZmJOnvCwyLYdaICJ0Jt9aLz2TYbAKR93jychVGfpZP6SBN5UfY9YVliwqvfpAYuCFAgdFUDzyVljIlNF2d3Z1tnZQAu/oB4WH2KOY+NRMsGnrW6rDPIQGlIAR7bpQClv8D+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696336324; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Gkc/bRL42O1meaWPMr7Z06ZuzQxfC9K3bpAdX8HhInA=; b=c78zGdKeOaA2XS41R8PkETg0QUkWZ/eXMSb2RyvzetqQNBLrXMmAW4g0Qnhpi6f5mKn4MNMcWdAxA2Ih70BEcS77lorzere00XGS6rBObsQXmCJd240fvGjqhZjiUsS5F9tPcjsDwJm+w3huFSwAluJQ2l1QK6xtP0NhZVqJ29Y= 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 1696336324548467.9960264501981; Tue, 3 Oct 2023 05:32:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qneYI-0000EY-Qa; Tue, 03 Oct 2023 08:31:02 -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 1qneYG-0000D3-Dd for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:00 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qneYD-0007kX-L4 for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:00 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40566f8a093so8171105e9.3 for ; Tue, 03 Oct 2023 05:30:57 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id a12-20020a5d570c000000b00327bf4f2f16sm1480932wrv.30.2023.10.03.05.30.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 05:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696336255; x=1696941055; 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=Gkc/bRL42O1meaWPMr7Z06ZuzQxfC9K3bpAdX8HhInA=; b=WFazSj61Qn4xvSTLwNPFMRya+BzaM5zv8RZUy6bQAHCveIRFUzfVVlxfsyrRqPlm73 iDNIVlfrGhG0ILM17K5ZUlWldjMAigTBr9/c2LfSZHJc4o/R5rKLqhjtcICLTwtZw4/X kf/GJxCGAEA1PMEP9ekaAX1y/wflWDXy1EYKe3OnkvUQzW4Hh1rZ48kmSBNM2VRQKZSD uXf9+qR7ZSXJBShHHJkQrONccBVoXEyVQc5pzWchu4R81EDEUv0CXweu+wdjigz5sBrv FcLO/xJlsnYzj9ii7ixaInwlPQC1VaZ8aLqAr8sbJL9RYtue1WdnEaHGxQ8n74fxzM7D /jYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696336255; x=1696941055; 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=Gkc/bRL42O1meaWPMr7Z06ZuzQxfC9K3bpAdX8HhInA=; b=gAmStbQbht2HgHQpSEvlzig8UrTxgmQzeBePDmsnFjQmIFrzksiB/AwxV0AfkUH+Tw oS1A3ZQws2CviThLkeINd7p74lTJ7z+kJgInYjlI5txmbrIFWgxZYdYZ/qxL8hOjiKR5 YOpmj88I0yH78S0kpIf2gRsHNenshq0H6wCWhHSQs/UVdDuOIlfQIsIZgTjOGikCig9F lT/FeEXnyd+zUZpm+1XpMop0W8gb0G/MNi5KnYgWEvSXbByuSRBGpSVeVoXU7aKbYg7n +MXSwaUcx0pxJSw2WbKadsrOitntkQ22zvexlR59ITnmFS9dri5vYas6LNseQUPZttdZ QWKQ== X-Gm-Message-State: AOJu0YwgHBAplzxmawZqoSD2un8L7cykSZKvZWRB9tSGi2m3nxQVV8Se y45SkkLmq8m4g5LF9hVgnIahlso2KU1qsaid/qfZyA== X-Google-Smtp-Source: AGHT+IFfS3e/r6v/mLNthJlFSJF+tDApG8FXlkYKsMscRfx5bpnxKY35taTyrdcfQ0W4kLclXxkyLQ== X-Received: by 2002:a05:600c:22c8:b0:405:3955:5872 with SMTP id 8-20020a05600c22c800b0040539555872mr11340217wmg.18.1696336254935; Tue, 03 Oct 2023 05:30:54 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Cameron Esfahani Subject: [PATCH v2 4/7] accel: Introduce accel_cpu_common_unrealize() stub Date: Tue, 3 Oct 2023 14:30:22 +0200 Message-ID: <20231003123026.99229-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003123026.99229-1-philmd@linaro.org> References: <20231003123026.99229-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696336325687100001 Prepare the stub for parity with accel_cpu_common_realize(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana --- include/qemu/accel.h | 6 ++++++ accel/accel-common.c | 4 ++++ cpu.c | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 898159c001..446153b145 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -96,6 +96,12 @@ void accel_cpu_instance_init(CPUState *cpu); */ bool accel_cpu_common_realize(CPUState *cpu, Error **errp); =20 +/** + * accel_cpu_common_unrealize: + * @cpu: The CPU that needs to call accel-specific cpu unrealization. + */ +void accel_cpu_common_unrealize(CPUState *cpu); + /** * accel_supported_gdbstub_sstep_flags: * diff --git a/accel/accel-common.c b/accel/accel-common.c index 53cf08a89a..e9548eac29 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -129,6 +129,10 @@ bool accel_cpu_common_realize(CPUState *cpu, Error **e= rrp) return true; } =20 +void accel_cpu_common_unrealize(CPUState *cpu) +{ +} + int accel_supported_gdbstub_sstep_flags(void) { AccelState *accel =3D current_accel(); diff --git a/cpu.c b/cpu.c index 1e2649a706..2a1eff948b 100644 --- a/cpu.c +++ b/cpu.c @@ -187,8 +187,10 @@ void cpu_exec_unrealizefn(CPUState *cpu) cpu_list_remove(cpu); /* * Now that the vCPU has been removed from the RCU list, we can call - * tcg_exec_unrealizefn, which may free fields using call_rcu. + * tcg_exec_unrealizefn and + * accel_cpu_common_unrealize, which may free fields using call_rcu. */ + accel_cpu_common_unrealize(cpu); if (tcg_enabled()) { tcg_exec_unrealizefn(cpu); } --=20 2.41.0 From nobody Fri May 17 12:14:38 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696336327; cv=none; d=zohomail.com; s=zohoarc; b=XAwNODLDAkvUuaLKPl98fBDJhG8PVMJhMwFcepHRFH66vAfLADU1J0nBH3+osUvuzLdP6vXo9nGjtqHe8M4XqLmGm8k5L9COirb67a+4m1Gg6o6RgOkJgDZWmPEovNWmuIBh1Yk/Lx8uj+BfAA9hmFG85uJHAMZD/tvbfemLJ98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696336327; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ng85okrWO1D5JYqF8LxeoCeovtEEGpWasH+P/ldXs4E=; b=HFspr779v2SbZqNXTGxOek/mA9W86q8jGlAec6zzaLl/Lf9TdChUFZnG7mdhNMnhze46zrK3I1gtET9KvQKO/6ZDj3X+u68HPaDmNQQvXS5PZ9+dXF3gLCHfmuPizhcfxWG3uc4yz8lHcKj9b8XAAxGlvK+UDn756nE1QsX9QWo= 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 1696336327569555.3491658465792; Tue, 3 Oct 2023 05:32:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qneYz-0001XY-2R; Tue, 03 Oct 2023 08:31:45 -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 1qneYU-0000h0-3E for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:21 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qneYP-0007lH-Vw for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:13 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3231dff4343so514021f8f.0 for ; Tue, 03 Oct 2023 05:31:02 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id w6-20020a5d6806000000b003196b1bb528sm1483694wru.64.2023.10.03.05.30.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 05:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696336261; x=1696941061; 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=ng85okrWO1D5JYqF8LxeoCeovtEEGpWasH+P/ldXs4E=; b=pjMIQHUi6MWmJfqbfaU11suCBlsFABo58l+uaKqrU1/nLN1jcYlccD9PXEJ1xBbqBN 1oQyl6SqatLMeSbhgRPClrOlWqTRKJz40fm0FKkETf+o4m3SDsJJxCtAs2n94fNj5Drp lr6tedmoRgSGbBVNh64rQaQbDg7YUMN0VMYC9QUwo1H5SlT0kd7iRwwNdb4M1FRyCe/0 JnmpifPR63NEIoXASi5MncqeYL6Ji2/2Iy/y0Or0Rf7O6WioDuN5qyLM6F44fgKkcbQC i8SBwI/GGUVKz29JznOpcPRyZ85hHVx9wlk5gHru5kUC+1HgViPKXI1IBOUYhKHRxCos ZIKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696336261; x=1696941061; 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=ng85okrWO1D5JYqF8LxeoCeovtEEGpWasH+P/ldXs4E=; b=S+Gbtb+YhLkNjLXFTv/FEIFq1vBjQCPOWD7bAtSlRKaFxTlFEe7Mjdk7IRiePDU232 w44ksfCNeQUkGVzrQROyZt1rJM0plSpdsHlehXZafHhwmm36/YUsy2MLaJjKHlzyzMxc UAl/JQnVxjK3k+iwhOXvCUbiMxuP0hWe1aQ5Q+o5tH9Oymn6lUs5FGSVRDrpXMOcRALJ c7mQ7cU5KnmCzqi0IgJUqS0aqGdJMNt+xxeiZiLoq+kAeMIQI2AJOgCJ6e/TP3THQvVT kCUk+PVHZdLA7XagpKkPd7hHhoFx+ixftJMoCRuOZ+StTyJ2VuSW3HzZe5lx8ZfTvUyB EfDQ== X-Gm-Message-State: AOJu0YxL+5JloEnYEZHZx5WAGjwZ4SO6ExnK93i7nKKoXTxS6N0rPva5 RW/sg3M7XaxU6+6mzxLafZ1O6cAfsJpf3wwqXzFmFg== X-Google-Smtp-Source: AGHT+IFSCFREFPhFrsIUBRMw43PEOKH8JJmdGJKi759Gs6/x70jH8Kzl+IQNSQVo5P0jTRrSQFmORg== X-Received: by 2002:adf:e806:0:b0:31f:fa48:2056 with SMTP id o6-20020adfe806000000b0031ffa482056mr1881057wrm.27.1696336261304; Tue, 03 Oct 2023 05:31:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Cameron Esfahani Subject: [PATCH v2 5/7] accel: Declare AccelClass::cpu_common_[un]realize() handlers Date: Tue, 3 Oct 2023 14:30:23 +0200 Message-ID: <20231003123026.99229-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003123026.99229-1-philmd@linaro.org> References: <20231003123026.99229-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696336328423100007 Currently accel_cpu_realize() only performs target-specific realization. Introduce the cpu_common_[un]realize fields in the base AccelClass to be able to perform target-agnostic [un]realization of vCPUs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana --- include/qemu/accel.h | 2 ++ accel/accel-common.c | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 446153b145..972a849a2b 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -43,6 +43,8 @@ typedef struct AccelClass { bool (*has_memory)(MachineState *ms, AddressSpace *as, hwaddr start_addr, hwaddr size); #endif + bool (*cpu_common_realize)(CPUState *cpu, Error **errp); + void (*cpu_common_unrealize)(CPUState *cpu); =20 /* gdbstub related hooks */ int (*gdbstub_supported_sstep_flags)(void); diff --git a/accel/accel-common.c b/accel/accel-common.c index e9548eac29..11d74b4ad7 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -122,15 +122,32 @@ void accel_cpu_instance_init(CPUState *cpu) bool accel_cpu_common_realize(CPUState *cpu, Error **errp) { CPUClass *cc =3D CPU_GET_CLASS(cpu); + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); =20 - if (cc->accel_cpu && cc->accel_cpu->cpu_target_realize) { - return cc->accel_cpu->cpu_target_realize(cpu, errp); + /* target specific realization */ + if (cc->accel_cpu && cc->accel_cpu->cpu_target_realize + && !cc->accel_cpu->cpu_target_realize(cpu, errp)) { + return false; } + + /* generic realization */ + if (acc->cpu_common_realize && !acc->cpu_common_realize(cpu, errp)) { + return false; + } + return true; } =20 void accel_cpu_common_unrealize(CPUState *cpu) { + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); + + /* generic unrealization */ + if (acc->cpu_common_unrealize) { + acc->cpu_common_unrealize(cpu); + } } =20 int accel_supported_gdbstub_sstep_flags(void) --=20 2.41.0 From nobody Fri May 17 12:14:38 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696336311; cv=none; d=zohomail.com; s=zohoarc; b=jgfQ3ZUz0y6qvANmzIQkgBlD3uN0hwq4n5z6D/Iol75MltPeKXIfdAiGeu4ZML8/byyHpYwB6e4xFzi5/a6VbXXp9sgN9i5kVjzLVjqG18Ch5JzcxalymddjMFYgIRWhgDHF57WRAE4xd4Nvvas1sj8pgh1vIw2WYN3sQ+IRhak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696336311; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0sreXSXDLh+LVLoU4Gk2cAKXN1sJ3KmjKke0mZhMO3w=; b=KDzTgaAovqSjllYehPAcILgDmLOLJ72mZVviYqajw4K/r5ZNDPsg7IX/PQgWYwMfFGzcWfjJgo9lDAqP4Vz4V2slKnJGbU3xTLKBmaDKDLfvf7QuZ9IjSTdAwLzrFDHBtgn7Xi2W+dU7Gi9DqS3HKKZbge/o5/qdtwJB1sErtK4= 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 1696336310997515.23507727175; Tue, 3 Oct 2023 05:31:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qneYp-0000w5-Du; Tue, 03 Oct 2023 08:31:38 -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 1qneYU-0000h1-8i for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:21 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qneYR-0007lj-TL for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:14 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40535597f01so8130735e9.3 for ; Tue, 03 Oct 2023 05:31:10 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id f20-20020a7bcd14000000b003fc16ee2864sm1183607wmj.48.2023.10.03.05.31.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 05:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696336268; x=1696941068; 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=0sreXSXDLh+LVLoU4Gk2cAKXN1sJ3KmjKke0mZhMO3w=; b=BciUNqpKg1fINjzTizXAT+b99177xF6x6znlmyjXBHM6bfPlk64uqRXLK8tVzrbv6l umySx/S//X+PbQSkJUrn/ViFXUWpNH4aeKOqs7d4l2Iq4xZKjY4ZMqYcolowWKtXosVB wqeQHT0Sz5vi0qBIfqFO3XTNLequ5F6KSdt7xIpLG8CnndhRTurf4tVZkzMtxmYwcR4U lOIuct1VETkZukon8I4+Aup7yW41gTg5nbmgS/XfMVTynBhWiMHbRzc+c9J62bJc9dAs LfTMcMq4l5q7jmDo3RXtpWWtsUZrG62TfQ5ecZ+IStUZtR2TYr7nx5uzUJmXHZDVjY2y sVLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696336268; x=1696941068; 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=0sreXSXDLh+LVLoU4Gk2cAKXN1sJ3KmjKke0mZhMO3w=; b=voUQ5B7TVEYphmxMzFnljTavF91AxO7RZy1BltPVKZt2aAdDG4Jkd4zht13F5z42Ft 1YODOSZEhLf43T7j2rukdX4GGhNv3D4NueQfmMX5Q8CzXTCH4elBq2/wJM5lvar3U6et +ZrvF99CMrawyJNrbe8npuKvWkrUNzo0gS7dmPzClNBxv0zR0s2nRDobS2dzc1F52nWR Md8DwasyXTTOShFYdDftWsqTEzup0vxtBwCJZh81r9uRdokEyqXaIjTQ+uE7x4bwsYEY Pkz6CWsFux4VRu+4rCgoJvR+w2vIy0PyYqFGNG0gzSA1iics9HOnARFv3Mx9Hs2tkjH5 Rwuw== X-Gm-Message-State: AOJu0YyOkOPmKqUBFUB7XKK9bxUEQULjS2vpjLLtWBil5+QLbTBINrfb wA5sNMBQ+Sq4WbJifvDEyIQdwd/ObVvoRdaWpTM+RA== X-Google-Smtp-Source: AGHT+IGgHu14QLaTZHtaqcvyhvqRXWFUFqZQ+U9E3BYtwlGQ+0F6OAn0a/YOhlJcZqr8dsHhPOyqvg== X-Received: by 2002:a7b:c858:0:b0:405:40c6:2ba4 with SMTP id c24-20020a7bc858000000b0040540c62ba4mr12060645wml.5.1696336268240; Tue, 03 Oct 2023 05:31:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Cameron Esfahani Subject: [PATCH v2 6/7] accel/tcg: Have tcg_exec_realizefn() return a boolean Date: Tue, 3 Oct 2023 14:30:24 +0200 Message-ID: <20231003123026.99229-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003123026.99229-1-philmd@linaro.org> References: <20231003123026.99229-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696336313313100003 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have tcg_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana --- include/exec/cpu-all.h | 2 +- accel/tcg/cpu-exec.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index c2c62160c6..1e5c530ee1 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -422,7 +422,7 @@ void dump_exec_info(GString *buf); =20 /* accel/tcg/cpu-exec.c */ int cpu_exec(CPUState *cpu); -void tcg_exec_realizefn(CPUState *cpu, Error **errp); +bool tcg_exec_realizefn(CPUState *cpu, Error **errp); void tcg_exec_unrealizefn(CPUState *cpu); =20 /** diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index c724e8b6f1..60f1986b85 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1088,7 +1088,7 @@ int cpu_exec(CPUState *cpu) return ret; } =20 -void tcg_exec_realizefn(CPUState *cpu, Error **errp) +bool tcg_exec_realizefn(CPUState *cpu, Error **errp) { static bool tcg_target_initialized; CPUClass *cc =3D CPU_GET_CLASS(cpu); @@ -1104,6 +1104,8 @@ void tcg_exec_realizefn(CPUState *cpu, Error **errp) tcg_iommu_init_notifier_list(cpu); #endif /* !CONFIG_USER_ONLY */ /* qemu_plugin_vcpu_init_hook delayed until cpu_index assigned. */ + + return true; } =20 /* undo the initializations in reverse order */ --=20 2.41.0 From nobody Fri May 17 12:14:38 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696336326; cv=none; d=zohomail.com; s=zohoarc; b=ZvGw6DWi0W/09NnVJYlk1gneWsd7ANf8E2D9Co6RV/WSJ7WkJ7j2FySOD7zR6J/HWgCv9Bg4G/gZHnq1202Cs6UUa01OsJfa+wjKD75iUYmW1J2UofzlZmTOTnPcGKlbMT1/M99vwdmLoujfBZeXjSjAqXA+xrW3a4ZIP44PAno= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696336326; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YCJq244pl4+8992N+SUfSZJnXy6q+2iGjPbprJxjpgU=; b=kwTCt6MzEstRzX171npjG/A3ofa7ivYhit34DPRD4jSu0Q+pIV4Nuk/cRcIsFsm4s0HXQMQspyocrgNIPCMqgzdHBbYlo+D/2UOmTA+iIvwyyGcfuR60yqCYDXo4DDVQKC4gaBRWgxi72jP0CzTX8TJTRY4PeC2Fb8I2CXv4K3k= 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 1696336326942752.1011452765745; Tue, 3 Oct 2023 05:32:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qneYx-0001IV-6V; Tue, 03 Oct 2023 08:31:43 -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 1qneYd-0000tH-Q5 for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:26 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qneYW-0007mg-Ua for qemu-devel@nongnu.org; Tue, 03 Oct 2023 08:31:23 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32157c8e4c7so913898f8f.1 for ; Tue, 03 Oct 2023 05:31:15 -0700 (PDT) Received: from m1x-phil.lan (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id j14-20020a5d464e000000b0031f8a59dbeasm1478930wrs.62.2023.10.03.05.31.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Oct 2023 05:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696336274; x=1696941074; 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=YCJq244pl4+8992N+SUfSZJnXy6q+2iGjPbprJxjpgU=; b=kYm7nGryxgvS+7f6kjDbCqKJ9aC6sz4BmDYIPgotRv0Fu3X3wymqeuUnQiXEgqpEJl 0ARJi3vOd4Xl0FjFc019DhYZfa3IjbpIBG12kTiWhC62DSBiR/owDwwjPV6jmkwqxgoD PoPUv3n8AMX5QzW+fsncSR0qgFwJDWDadD5DisXN15PVY0xohKtX1g/vt0rGU1sKWiel Y2y6sahoVg0X0VWlHSgopzBpXBnV0xZmIKgKPfUJNf2hWhEgkczcXI0Ssh+qlKnUzXbU AZ2s5pypAH8b2ozm8KMsgk5tSiJcHaieXXJXnL6PTCa5azuHs411xsIgh8SKIda37Wwf PSZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696336274; x=1696941074; 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=YCJq244pl4+8992N+SUfSZJnXy6q+2iGjPbprJxjpgU=; b=NxNzyspLQ96XfEw041UcIyOoZYjbsoZ+m3ipaoVTd6uWukcMHgd6o9R2aHY3ZblRrH uXqkJ90khfrEaCTtrhkTjVZwUlG7f+pFCAGXt1qbCSbV5yNHf0BbwouoEZmR+446VGyF lZCC5FH89BgbZ4fcRSTdT3RL/MLQHnNEL+57v47WuLLE0QoHDCx/UK0Q78KGqBOIkJ64 K6fwCRfn62Cjkia8jAOTFl2Wm30mDZoWhH56h4wm4TlGsHavIsIwihwlm6YxaQA55x6A Ap8wL/jmhB5OAkZZ1qqIB03RrxGY8/EQArP/XS831nhV6uRqQaaseV1uXnIkgG1C5Htz QNhA== X-Gm-Message-State: AOJu0YzEzHC3G5wOE3x0AuK0OYHqRF3lZ2NcrBP+55atGGvFp6Eho+yC pP9EZje4dK5sFlMEtUMpFhpwhCFZZb5AgPTnmRnZ8g== X-Google-Smtp-Source: AGHT+IFOv9460imGFEIgqRm0UvkQ7r6CSfyL7aih3gY5LLipvr1UBoZ7dIbBHQMj6JPYXiQgRbHH4Q== X-Received: by 2002:adf:e852:0:b0:323:2038:944 with SMTP id d18-20020adfe852000000b0032320380944mr13304917wrn.58.1696336274319; Tue, 03 Oct 2023 05:31:14 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Cameron Esfahani Subject: [PATCH v2 7/7] accel/tcg: Restrict tcg_exec_[un]realizefn() to TCG Date: Tue, 3 Oct 2023 14:30:25 +0200 Message-ID: <20231003123026.99229-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003123026.99229-1-philmd@linaro.org> References: <20231003123026.99229-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696336328875100010 We don't need to expose these TCG-specific methods to the whole code base. Register them as AccelClass handlers, they will be called by the generic accel_cpu_[un]realize() methods. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana --- accel/tcg/internal.h | 3 +++ include/exec/cpu-all.h | 2 -- accel/tcg/tcg-all.c | 2 ++ cpu.c | 9 --------- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index e8cbbde581..57ab397df1 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -80,6 +80,9 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, = uintptr_t pc); void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, uintptr_t host_pc); =20 +bool tcg_exec_realizefn(CPUState *cpu, Error **errp); +void tcg_exec_unrealizefn(CPUState *cpu); + /* Return the current PC from CPU, which may be cached in TB. */ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) { diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 1e5c530ee1..230525ebf7 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -422,8 +422,6 @@ void dump_exec_info(GString *buf); =20 /* accel/tcg/cpu-exec.c */ int cpu_exec(CPUState *cpu); -bool tcg_exec_realizefn(CPUState *cpu, Error **errp); -void tcg_exec_unrealizefn(CPUState *cpu); =20 /** * cpu_set_cpustate_pointers(cpu) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 03dfd67e9e..8ab873a5ab 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -227,6 +227,8 @@ static void tcg_accel_class_init(ObjectClass *oc, void = *data) AccelClass *ac =3D ACCEL_CLASS(oc); ac->name =3D "tcg"; ac->init_machine =3D tcg_init_machine; + ac->cpu_common_realize =3D tcg_exec_realizefn; + ac->cpu_common_unrealize =3D tcg_exec_unrealizefn; ac->allowed =3D &tcg_allowed; ac->gdbstub_supported_sstep_flags =3D tcg_gdbstub_supported_sstep_flag= s; =20 diff --git a/cpu.c b/cpu.c index 2a1eff948b..658d179582 100644 --- a/cpu.c +++ b/cpu.c @@ -140,11 +140,6 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) return; } =20 - /* NB: errp parameter is unused currently */ - if (tcg_enabled()) { - tcg_exec_realizefn(cpu, errp); - } - /* Wait until cpu initialization complete before exposing cpu. */ cpu_list_add(cpu); =20 @@ -187,13 +182,9 @@ void cpu_exec_unrealizefn(CPUState *cpu) cpu_list_remove(cpu); /* * Now that the vCPU has been removed from the RCU list, we can call - * tcg_exec_unrealizefn and * accel_cpu_common_unrealize, which may free fields using call_rcu. */ accel_cpu_common_unrealize(cpu); - if (tcg_enabled()) { - tcg_exec_unrealizefn(cpu); - } } =20 /* --=20 2.41.0