From patchwork Tue Oct 3 12:30:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728734 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2115638wrt; Tue, 3 Oct 2023 05:31:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmvSbQx/mLxj5ETITymbKjZWlaP34mt4bhGUWLl2GZSPNg1s4UjAobhmrnM1RjF7UevAo4 X-Received: by 2002:a05:620a:201d:b0:774:1e10:681e with SMTP id c29-20020a05620a201d00b007741e10681emr13621501qka.72.1696336272600; Tue, 03 Oct 2023 05:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696336272; cv=none; d=google.com; s=arc-20160816; b=hmyx8h7MevoTaytUnB74UGybyUQlvDyOtcXGRWw3OEQO+0rLSh/Qn3UM778SW/5qf9 ibUdEFIJ9zY9m3hwI2XznkiRvoI51ICNtzywOZYtYdTH2jwQxlGM5z0zJBBJNbxihxSM V4ezJtKVcrXnM9YWJOePb3sxNNGy8NJgfS+D9cCsObxg9UyYIPnnyt2bNRsIqnd3PMSr Gv/Jloj9KGURD3nQJdJmJ0U4iX7NfLOzGzU86uPnkaZgDR+g6aXQiMUPEWqe5hnpYL4R QXw/hcs79E+yaGOQUuG1MwJXSon42uznnl4NMWj/p5gI5ShOXpVChIFj4si2YbCUOomR FpvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bqFGd5F05ZVpX+rAUXHuXXrGJSE30XMuMRRy/YP47Yw=; fh=CVJQstyUWDliy7yeWt2k56tVqQKxFVNP1RtQ0M0BBPc=; b=Epdqg3Z7t1HNkORRCQjyHZagl4NrdjT63CsVIXe+tch4H6YhK+jJOTKSMyIiY85RvG XyJ8PFDD9lEE7lNeTK93CNgQVZSSt/PymzQ+5fGcREb1Qnv+/nUhOaiem0E8MVO3wBev jFodEHEQ2L4hn17OkIQg9Aqk63/gBNlxUQixwPdqKkRD4M4vJvKd01GpoaPz6MRFcsYA pZVDsv/YC0RZeYoATslHMITLeErOd+y51Uo5Ne7Y57tCOaLy1gMjZatcZSxAIxjsoQ7u 0qVVtMLtqvUjQTluSCDoJL9ANUFDI6OjmpGsg21dWigokEIc9/oOqT5pZqip2pPaWp5L NWhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CQjapap7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m11-20020a05620a24cb00b007758f54999bsi456740qkn.626.2023.10.03.05.31.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 05:31:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CQjapap7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We use the '*fn' suffix for handlers, this is a public method. Drop the suffix. Signed-off-by: Philippe Mathieu-Daudé Reviewed-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); /** - * 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); /** * 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) } } -bool accel_cpu_realizefn(CPUState *cpu, Error **errp) +bool accel_cpu_realize(CPUState *cpu, Error **errp) { CPUClass *cc = CPU_GET_CLASS(cpu); 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 = CPU_GET_CLASS(cpu); - if (!accel_cpu_realizefn(cpu, errp)) { + if (!accel_cpu_realize(cpu, errp)) { return; } 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 */ From patchwork Tue Oct 3 12:30:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728733 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2115630wrt; Tue, 3 Oct 2023 05:31:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEP7S3N97m4pQIqTeCVN8tKVFiF59LNM0gNIzQGVi5ur4yy1htqyHJoaF3RLowfRj0ZLm76 X-Received: by 2002:a05:6214:3d13:b0:65b:2660:f577 with SMTP id ol19-20020a0562143d1300b0065b2660f577mr13751698qvb.3.1696336271966; Tue, 03 Oct 2023 05:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696336271; cv=none; d=google.com; s=arc-20160816; b=BNWxP7zMi+6L/bsT74qGbi5j0ICo2C3TTgXW0UgsdhAg2y57F7v+XUBXUSAhuDu0Hv +S9JZUJIZ9c0uxboGz2xWXJmHR7cnZWNi100zxJ3eX3DPL5GniS4AJGfQUgmBAY4vgTm Zu8XsmfB+mgZOr5ecPAmI0ENNiMxJChDNr4NuBNrcceo+397GDdYsGlinfOHFWGUfGHF 1ZOS1zZoDyC6idenXoYOo6ie51ZBJHjVyMhWmdThze8OIhrk9wTat1fAPj5G9ZGAXpIt kvQSY89kQ6NCCpwbstVi+8fiTtpe1au+TMHdVM3N5ljBnBZwTV2rRw2YqA86PYM76k2N MB/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kJP8U3eqs5eoWVLjFoE8nfmBFTz8cZ5KMaYYsencWoY=; fh=CVJQstyUWDliy7yeWt2k56tVqQKxFVNP1RtQ0M0BBPc=; b=p2a9Y1A6q/bS+d/rZzwDf+VeMPyF1F/9u5JVwyyYo8hUxzgTyd9xIkpzH3Qkh83TkY yvrCK79ebMxIHRRHMZNaEH/rnKskhNUe2V5N0dccQR9yk69CnCJ0mKbLprtPb+N19V2J /5dSbbFjn2z1BzajIReccf9UKk7iUqyOyzWbh36iUkRhwhXuyNfi6ub4/8DpLO2jxDjw 3PBabctlqmo/MbnB0hwun5/G8lJA+FTfqj2V++WbAGtOFa1MZvsS2BDApGhaZohSTKZm ERZ6bbbV2XPLxY4X4XCFaCLQykVhAVzU6epp6bVchmUN7ulsMMFwJVIncpaFgDNmu4w6 kldg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWV4Ss0P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fi1-20020a0562141a4100b0064c678f1d24si451462qvb.116.2023.10.03.05.31.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 05:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWV4Ss0P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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 { 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; #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 = CPU_GET_CLASS(cpu); - 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, void *data) { AccelCPUClass *acc = ACCEL_CPU_CLASS(oc); - acc->cpu_realizefn = host_cpu_realizefn; + acc->cpu_target_realize = host_cpu_realizefn; acc->cpu_instance_init = hvf_cpu_instance_init; } 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, void *data) { AccelCPUClass *acc = ACCEL_CPU_CLASS(oc); - acc->cpu_realizefn = kvm_cpu_realizefn; + acc->cpu_target_realize = kvm_cpu_realizefn; acc->cpu_instance_init = kvm_cpu_instance_init; } static const TypeInfo kvm_cpu_accel_type_info = { 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, void *data) AccelCPUClass *acc = ACCEL_CPU_CLASS(oc); #ifndef CONFIG_USER_ONLY - acc->cpu_realizefn = tcg_cpu_realizefn; + acc->cpu_target_realize = tcg_cpu_realizefn; #endif /* CONFIG_USER_ONLY */ acc->cpu_class_init = tcg_cpu_class_init; From patchwork Tue Oct 3 12:30:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728735 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2115653wrt; Tue, 3 Oct 2023 05:31:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESzuUgammUH9Lev6eBLkfY14KFRie4vUEE4IUyQB4Nuko5EgyNyhOXqnI/z5UPZLVU+zkb X-Received: by 2002:a0c:f54e:0:b0:647:406b:4b06 with SMTP id p14-20020a0cf54e000000b00647406b4b06mr11814060qvm.57.1696336273983; Tue, 03 Oct 2023 05:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696336273; cv=none; d=google.com; s=arc-20160816; b=HKwJ8PaiKIjIMv8u+He9MBFXfwTCr4V2pnqV1G6cAx75rFdx+MakyL9C8nR0NhqQSK A72xwlKm88NZgFkycyOXKqxCu+d8iIPjA0x57oJbV5b989ZYFWQLGN8ABpAc84uGdIVC AQWW8FpdAUZKxP6MO/01F+p0tW4xHsXmRTMUqeZbh5rvWeoVx4/obnk0OSU6n6uzG8hr eGXYwTWzsfVcv04IH4ujr/i9iPZ9vjAlFG5E2CTFMnUqIDTl34ObdU3OJ8jgL81pH9C4 ObLe2FoOFwXAePreUQkk9IXS0xlxpyN624D1rHL+JI6w54T3r7xZ/lbPe3pfSg/hXnch b0JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+r9kD/biBFamNwbYJdkWZ0i3n7hbuMnWH0aEsGJ6SFw=; fh=CVJQstyUWDliy7yeWt2k56tVqQKxFVNP1RtQ0M0BBPc=; b=HbpwTKq9fLuDwydgz/KICb23lynUhv6jzv0kbjtSI1374WokitLlxfo0ES/ZYkQ0vW nVJkDzPTjzsFkr5PaFBpMWJHDH/mT9atr51bgIclqlM9ssrt9cams065Y7Ewsd0mvAWb /rYxzYKkMoRn+EnAOUKWK6QVWnNwUQWjBAy3gyxHBZuQjkj2Pcd7eNvivk21lbER0CEu G3drQhToatNFoF/pLNAPXFBOQgOsrVyRS1N2PMveW2/JiG5nUfJv/P1suXYROh/kDU0g v40lA/DIqmt2t6NR2+HfalaAZuaxpJcv3uQ+RWDmUAI2h/m488kxhFD+OBNJ9VXjF/ZP Yxkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U6W/nhEJ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l19-20020a0ce513000000b0064f91de2ed8si446610qvm.551.2023.10.03.05.31.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 05:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U6W/nhEJ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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); /** - * 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); /** * 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) } } -bool accel_cpu_realize(CPUState *cpu, Error **errp) +bool accel_cpu_common_realize(CPUState *cpu, Error **errp) { CPUClass *cc = CPU_GET_CLASS(cpu); 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 = CPU_GET_CLASS(cpu); - if (!accel_cpu_realize(cpu, errp)) { + if (!accel_cpu_common_realize(cpu, errp)) { return; } 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 */ From patchwork Tue Oct 3 12:30:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728738 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2116039wrt; Tue, 3 Oct 2023 05:32:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnF80nBW61kvF4RwuB5P9DkfgUM6rJRchLQo+7OK8VFHPVvLT5na50fzlaxlIwDxMUvfK3 X-Received: by 2002:a05:6214:4b08:b0:658:310c:f6ca with SMTP id pj8-20020a0562144b0800b00658310cf6camr14644313qvb.42.1696336324184; Tue, 03 Oct 2023 05:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696336324; cv=none; d=google.com; s=arc-20160816; b=kMZC0tvlCHu6N2ArsaddcbD5NmfHdHnEslOAXMQchhr1+O0QSDGMUU0WM3JIc+X7b/ M2MQURSwj62ZUGO78vgKnEfp5CQQIMtnef5SWbBgqRBorUVVUNkG6a6LqHFPuve9TfYh XMSUlnD+vIuopVv4RD4yK/8k9fgTnnpWK6pi7dXk+sp9e8BfHpRNyVgFbEHJcJyYGKbk fL0cUPZ7qA+nhXcKoJ/Fe7BAZm05+o1BEGikiCFOgyNeqO47JNGY3Ojdf48QEYBhVZfL z4WqrIW4It1fTpnTw0wLsSic8Nh9Uo04obWonk9YhNolO3vzCP/OfnqhNWF8mwRtkmeQ 911w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Gkc/bRL42O1meaWPMr7Z06ZuzQxfC9K3bpAdX8HhInA=; fh=CVJQstyUWDliy7yeWt2k56tVqQKxFVNP1RtQ0M0BBPc=; b=mCfJ4qP09T+MH2KS/ikHVBK0j6ETHn4l3suibH8LpKyT+oG4RmhmN+61pjrqGX+PHF M/Io7qOmLYsue+uDB6BA59sX9J3RfJHcAvxtNUT0dNm+S5HzUn62u+GZ2ci6E91DsiSH htMh3wlsZ9rnbt4eIbR2MjJ1HwLitC+scZqxdGu66yI7xxw9ssJc1TGa6ceZB++I1slj fUcqmIPcpAHrPZFSq5vvH6AZgNJXt2K336TmZBfH/YMX0Fb6nA51WBAw5yyhr8s9o0/u DAROF4YHX08c/oRNN1NMbhtzcmptw0rFH7TaHMHLYJxE2lcJ+stx1kinTS9BQ8RWsVdg uvHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WFazSj61; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m3-20020a05620a24c300b0076d9f1d4791si459396qkn.528.2023.10.03.05.32.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 05:32:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WFazSj61; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Prepare the stub for parity with accel_cpu_common_realize(). Signed-off-by: Philippe Mathieu-Daudé --- 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); +/** + * 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 **errp) return true; } +void accel_cpu_common_unrealize(CPUState *cpu) +{ +} + int accel_supported_gdbstub_sstep_flags(void) { AccelState *accel = 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); } From patchwork Tue Oct 3 12:30:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728740 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2116070wrt; Tue, 3 Oct 2023 05:32:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJffcwOjoqCNeIJ67S4hrDDT8BpuCJU67AjSVK/u7WbrDi7eUKYzwdFWfPLv+a3/pD+nR7 X-Received: by 2002:a05:620a:29d1:b0:775:bfe3:a91d with SMTP id s17-20020a05620a29d100b00775bfe3a91dmr1909256qkp.22.1696336327162; Tue, 03 Oct 2023 05:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696336327; cv=none; d=google.com; s=arc-20160816; b=xLqulaWgaEsI31PiUy0vxpZt9s368LAtAe39RDKR6ahaZAGiaOE4yu9U1aNGtWb7Mh tC29/2y8Dcd5lHC/iHVRnXK1/7EKNbynv4UIcESiqJRAOTpkeppqK2zCxYHYg6t8XQnX m38CQ034o6lwxp/ADICa4IOY3YUesgBpSW8Dc2gXfdQDro6dkWXE6RGSCXi0z+Q9tyoZ pa+fEXnZymkDRnh6fedeMblPayk4sl9Eu94KTEQwm41MFCXOGZyg/Jlv/34f7Y9oA/GZ vWq7D+xXA38F1PfDQ8R0kqfK3RTGPvMFnBrdoJVNUBtxp5liIJU+CUhRmdZKj/nj2fdR WV9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ng85okrWO1D5JYqF8LxeoCeovtEEGpWasH+P/ldXs4E=; fh=CVJQstyUWDliy7yeWt2k56tVqQKxFVNP1RtQ0M0BBPc=; b=fZIweOfTBj1HFY4B4coqjAt0YUJFJ33rI5+HzKT1Pbr8lJAWA5VnLSUFveOEFytERw g2IaSbol6FY7Z1uxSOr7j5nPeB6mwxFb1P76i7hdQdBJyAEvzMLHnt2iW22FNvCuUuJJ LE72DMi6aoeR2OiYof54ZVgqSAmI15wKtbkl9ZbNpiGQBFa7M+AfuoeKmwHIWjin3XBF fa5WgYPSJwfOYH17QOF6ORBRdwBIMN3fYISZ9BCt/UUFmTCSo83FDClrND2JKzrBUL1e QUxee2H+5VyV6KWYKepeFKXwdgtbeWAl8nE/2Mjqy3ZCwlFKYYQQZpn1kMWUFWQOXcjT fcmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pjMIQHUi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ay30-20020a05620a179e00b0076f21765d39si449688qkb.274.2023.10.03.05.32.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 05:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pjMIQHUi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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); /* 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 = CPU_GET_CLASS(cpu); + AccelState *accel = current_accel(); + AccelClass *acc = ACCEL_GET_CLASS(accel); - 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; } void accel_cpu_common_unrealize(CPUState *cpu) { + AccelState *accel = current_accel(); + AccelClass *acc = ACCEL_GET_CLASS(accel); + + /* generic unrealization */ + if (acc->cpu_common_unrealize) { + acc->cpu_common_unrealize(cpu); + } } int accel_supported_gdbstub_sstep_flags(void) From patchwork Tue Oct 3 12:30:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728737 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2115935wrt; Tue, 3 Oct 2023 05:31:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKuLLh2Ka0XyfvDS6NEc1RXdZo5f8Ow+3+Y0Fr1c2rUBrS2uYnBXbSjNWxKO3+6PFCt0Te X-Received: by 2002:a05:622a:190c:b0:3f6:aff0:6dec with SMTP id w12-20020a05622a190c00b003f6aff06decmr15887024qtc.32.1696336310828; Tue, 03 Oct 2023 05:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696336310; cv=none; d=google.com; s=arc-20160816; b=ZersS4SuQusMBaRSCAp9hiMYDgoaTItzGYH0j7MbAVPyuMmmSH+VClSM21ySeI+Usr k47ryF/Xsfb8PXJca4gjMaAXNx55YsNmfE/28muhfvXLnVxQCr5U5UsSBVtX7ptDcgJP 7/UCL3Vd0wMYbl2RaiDMKn694ZRJb0VFWOYW9GubxKlbCkZCZRLBxjZoaGsA0o/dBgbr Ozyc9E+18bPxCEamZBX7t6zk9uDP6uY1NrtCY7+gR5h9jVJz9d7E2Cl8HM03uWYJcWNz +DnoyhilHCRx2z3fXQDUZDaEXRZUuyHC4P7xhoQz9y9IOZ+rwv62ZpLOOL5zMfiDPxJo C9OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0sreXSXDLh+LVLoU4Gk2cAKXN1sJ3KmjKke0mZhMO3w=; fh=CVJQstyUWDliy7yeWt2k56tVqQKxFVNP1RtQ0M0BBPc=; b=qofxND4gKIeY60/iwSptNF7QWBqyz5bu7ecd9t7lJo3FBqjijW1xzReKReiJXwKTfR SOOmUL6j1fexSoj7vosYLY8x+ENHSbdY//iSO9pu1k5ToEnN18sLGQ60ohm2aPW0Agh/ IusQB1k5N7wxXbg6/2iHifT/70XQtUxosnQa0VAZWWRYRWBRXWF9/GB6gvLvK4CkUHpU a0emvIa44JU1yRZYSoaufP8n1bDnKlTKJcumuEFxtQwO3NfeAyT+Nabv7hvupjnITvgD lI7gj/ZQYuP+/mhCjcH15GcIroqvyos15oInuQNzYSFn48sbx6vQ871iaIyXUNBBkVnl 3hJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BciUNqpK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m13-20020a05622a054d00b00419833f38a2si468663qtx.704.2023.10.03.05.31.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 05:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BciUNqpK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-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); /* 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); /** 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; } -void tcg_exec_realizefn(CPUState *cpu, Error **errp) +bool tcg_exec_realizefn(CPUState *cpu, Error **errp) { static bool tcg_target_initialized; CPUClass *cc = 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; } /* undo the initializations in reverse order */ From patchwork Tue Oct 3 12:30:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728739 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2116063wrt; Tue, 3 Oct 2023 05:32:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFc9L0QBt5U9cSQXjnqG8UeqXVeJad0/YwGdrGfUgEPdcOQZMqepBvX1WbD4r0eGb4KMEBS X-Received: by 2002:a05:6214:4606:b0:65d:178:15a0 with SMTP id oq6-20020a056214460600b0065d017815a0mr16236034qvb.36.1696336326548; Tue, 03 Oct 2023 05:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696336326; cv=none; d=google.com; s=arc-20160816; b=C3SBaf3h1I3h6n2lkADb21nzRe8vGvmNGNpIIL8Js5jFbQNR/pEgnDHPCbf71dUsXP rGYOcmiszcBHTVKPUWIQwYNfeO+gbqI0ekoecY6PbirP1aZd83UoR/RpH78LSZfbixrr ozV7ZFOvAAa0vphinCd96YqcW3GqPbOTcE3nn9THqGXOnm02riNMmTdhIEuaH0ESjQng aNwVRP/5T7MEaWt0BimNyw0izRZvMg6qrPJNHtN6wJy+314lBAkI6LJu/g/je+SniVSt 1jZVKKiJ09FA8g1VCb1e0fNgSSxD0zAOwmaS34h+quFjKWCTpJZKJtgiDWe9yRnxZXGk gavg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YCJq244pl4+8992N+SUfSZJnXy6q+2iGjPbprJxjpgU=; fh=CVJQstyUWDliy7yeWt2k56tVqQKxFVNP1RtQ0M0BBPc=; b=iQE16qkmOvGkf3xm7YWDspyHqUn2/tbPkiGVVmBwKPtb9z5Gl0JOrfAfBTOJ8fVRIA 9W/iCFeBJQsDRRXV6WhmmXF+aSugIAtGfRiABj9HgXJo3847EXIdySIEhL4NvHlWWI3O iR/0Epf7WcPGZzsJucYadDuqht6bwBY22KUMNdat158RP12VUXJ2Ggo4OGPZCgXAgyNB k3jUjnM7FfRAlLfs1LpK6en/2W63iTc0aO7p2GqxORS0JfPVIhzmCdL6NPKB0dAmjraB EJ3Nu6KX1yEwm4Fi+3Biab1TGL9f5ON2I+LdRDy4D8Qth+WlctO4HGFFqTzttn3p3ruW 49jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kYm7nGry; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w2-20020a0ca802000000b00668da56152csi452343qva.506.2023.10.03.05.32.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 05:32:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kYm7nGry; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Yanan Wang , Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , Richard Henderson , Marcelo Tosatti , Roman Bolshakov , Fabiano Rosas , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-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); +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); /* accel/tcg/cpu-exec.c */ int cpu_exec(CPUState *cpu); -bool tcg_exec_realizefn(CPUState *cpu, Error **errp); -void tcg_exec_unrealizefn(CPUState *cpu); /** * 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 = ACCEL_CLASS(oc); ac->name = "tcg"; ac->init_machine = tcg_init_machine; + ac->cpu_common_realize = tcg_exec_realizefn; + ac->cpu_common_unrealize = tcg_exec_unrealizefn; ac->allowed = &tcg_allowed; ac->gdbstub_supported_sstep_flags = tcg_gdbstub_supported_sstep_flags; 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; } - /* 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); @@ -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); - } } /*