From patchwork Thu Jan 9 15:21:19 2020 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: 11325973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A2E1109A for ; Thu, 9 Jan 2020 15:23:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E6262072A for ; Thu, 9 Jan 2020 15:23:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C5fS2d+U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E6262072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZez-0000Qi-Tf for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:23:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37554) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZdN-0006Sr-J6 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZdK-0002GJ-GU for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:05 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30260 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZdK-0002Bq-7u for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GkPqCUD4XkIHW5a1LsjZ+v2acwoaiMCCGZAUZ9gBdJI=; b=C5fS2d+Ursebd+zTF6wshVph08byTt4IlSOU4W8Wl7AZoiTlCg85j/q0+9/Csd8JCHdfah Dq51wW7MALXY3lcuUMPV/upjialsC/SOFu9qG852W7vESdfOJ+RAKmSZzwqA4UNCuGQPQg 6/H+ryYbFa0rsXDJN3HKd3ESCWBjRbI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-Gscak5j0MSqJfyybuFHsGw-1; Thu, 09 Jan 2020 10:21:59 -0500 X-MC-Unique: Gscak5j0MSqJfyybuFHsGw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CAC11804910; Thu, 9 Jan 2020 15:21:57 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44F1180608; Thu, 9 Jan 2020 15:21:45 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 01/15] target/arm/kvm: Use CPUState::kvm_state in kvm_arm_pmu_supported() Date: Thu, 9 Jan 2020 16:21:19 +0100 Message-Id: <20200109152133.23649-2-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" KVMState is already accessible via CPUState::kvm_state, use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- target/arm/kvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index b87b59a02a..8d82889150 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -181,9 +181,7 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) bool kvm_arm_pmu_supported(CPUState *cpu) { - KVMState *s = KVM_STATE(current_machine->accelerator); - - return kvm_check_extension(s, KVM_CAP_ARM_PMU_V3); + return kvm_check_extension(cpu->kvm_state, KVM_CAP_ARM_PMU_V3); } int kvm_arm_get_max_vm_ipa_size(MachineState *ms) From patchwork Thu Jan 9 15:21:20 2020 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: 11325985 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 743A61398 for ; Thu, 9 Jan 2020 15:26:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AB5020721 for ; Thu, 9 Jan 2020 15:26:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WBOPCch2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AB5020721 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZhj-0004rD-RZ for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:26:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38225) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZdV-0006jK-L1 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZdU-00031s-9p for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:13 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:39281 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZdT-0002yq-V7 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PFxwKx/EwWB9jWEmX25bQbJoh6dZfyi7mRbJMrwlqJg=; b=WBOPCch2JoIcJItAoOU2dkVuOFZsuzt6MG6PQgBvFFfdMBMekkfbD5o4lEOq36vT8vx4h6 R9/bva+JaARLQmYHbmb+fTwl+ESarO1hs6O1tzyj/ZRCtyGXfFQZl9fPR+GDH5Z5thFkYS 90hZL0qONh7l4nzaTi/HIDXFzLAF4j0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-ZZvT6K0CM--HmXa-1GHyTQ-1; Thu, 09 Jan 2020 10:22:08 -0500 X-MC-Unique: ZZvT6K0CM--HmXa-1GHyTQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 677F3184B1F1; Thu, 9 Jan 2020 15:22:06 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 586DE1CB; Thu, 9 Jan 2020 15:21:58 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 02/15] hw/ppc/spapr_rtas: Use local MachineState variable Date: Thu, 9 Jan 2020 16:21:20 +0100 Message-Id: <20200109152133.23649-3-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Since we have the MachineState already available locally, ues it instead of the global current_machine. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Greg Kurz Acked-by: David Gibson --- hw/ppc/spapr_rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 8d8d8cdfcb..e88bb1930e 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -281,7 +281,7 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, "DesProcs=%d," "MaxPlatProcs=%d", max_cpus, - current_machine->ram_size / MiB, + ms->ram_size / MiB, ms->smp.cpus, max_cpus); if (pcc->n_host_threads > 0) { From patchwork Thu Jan 9 15:21:21 2020 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: 11325983 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D5DF109A for ; Thu, 9 Jan 2020 15:25:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D868820673 for ; Thu, 9 Jan 2020 15:25:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KetzXMi1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D868820673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZgC-0002Q8-FY for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:25:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38981) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZdc-0006uO-Qu for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZda-0003YJ-GN for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:20 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:55842 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZda-0003Pp-9P for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pTyK0RkH4Fh+lVVih8pnoyvDLJN5sQWece676cWX4f0=; b=KetzXMi1gB2W7mo9aJuU1ISs1SkYmz2vRUDZI1DEBoOiDkSZznjHw+JUAgWEQ7wXCWtaPP X5+8sGmnFWOcBjm0O07nS2VUxWvzVPP8Kt37F5KNT8mvLzHYY0/mEgu8S+Gu/WKeAURTij rKATP/yGf9lLXL3PnFlukS3s5+rgWU8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-D1AieJqTN1iFHthYdYV9Lg-1; Thu, 09 Jan 2020 10:22:14 -0500 X-MC-Unique: D1AieJqTN1iFHthYdYV9Lg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21BF4107AD4F; Thu, 9 Jan 2020 15:22:13 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 056111CB; Thu, 9 Jan 2020 15:22:06 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 03/15] hw/ppc/spapr_rtas: Access MachineState via SpaprMachineState argument Date: Thu, 9 Jan 2020 16:21:21 +0100 Message-Id: <20200109152133.23649-4-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" We received a SpaprMachineState argument. Since SpaprMachineState inherits of MachineState, use it instead of calling qdev_get_machine. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Greg Kurz Acked-by: David Gibson --- hw/ppc/spapr_rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index e88bb1930e..6f06e9d7fe 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -267,7 +267,7 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, uint32_t nret, target_ulong rets) { PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); - MachineState *ms = MACHINE(qdev_get_machine()); + MachineState *ms = MACHINE(spapr); unsigned int max_cpus = ms->smp.max_cpus; target_ulong parameter = rtas_ld(args, 0); target_ulong buffer = rtas_ld(args, 1); From patchwork Thu Jan 9 15:21:22 2020 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: 11325989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD9D814B4 for ; Thu, 9 Jan 2020 15:26:56 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A198020721 for ; Thu, 9 Jan 2020 15:26:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NsuRFMXw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A198020721 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZi3-0005TS-GN for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:26:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39579) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZdi-00073v-DI for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZdh-00044K-6P for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:26 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27010 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZdh-00042A-14 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rw8jmxMoDMD+mDmAS1YaT70WlRmZEqpVqIIhKc3uSz0=; b=NsuRFMXw10c27DpYwdMjuaE75U4GUzN8t4rl2J/5J/TVusKNblW9i1/iH2uRF3jOpSM56d 3cJysVQFCK2CtWzhdnhN1KAOfTazUYxyAF6U0YSSZMhoddf5NmfIyuQMb3I2eA1QEby7DX hY2C+30sT8hLEH5Kb8dSXMb4kogupaI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-7u9vL7X1MXy5Q1TcHaePyA-1; Thu, 09 Jan 2020 10:22:21 -0500 X-MC-Unique: 7u9vL7X1MXy5Q1TcHaePyA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE915477; Thu, 9 Jan 2020 15:22:19 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5EAA1CB; Thu, 9 Jan 2020 15:22:13 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 04/15] hw/ppc/spapr_rtas: Restrict variables scope to single switch case Date: Thu, 9 Jan 2020 16:21:22 +0100 Message-Id: <20200109152133.23649-5-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" We only access these variables in RTAS_SYSPARM_SPLPAR_CHARACTERISTICS case, restrict their scope to avoid unnecessary initialization. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_rtas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 6f06e9d7fe..7237e5ebf2 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -267,8 +267,6 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, uint32_t nret, target_ulong rets) { PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); - MachineState *ms = MACHINE(spapr); - unsigned int max_cpus = ms->smp.max_cpus; target_ulong parameter = rtas_ld(args, 0); target_ulong buffer = rtas_ld(args, 1); target_ulong length = rtas_ld(args, 2); @@ -276,6 +274,8 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, switch (parameter) { case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: { + MachineState *ms = MACHINE(spapr); + unsigned int max_cpus = ms->smp.max_cpus; char *param_val = g_strdup_printf("MaxEntCap=%d," "DesMem=%" PRIu64 "," "DesProcs=%d," From patchwork Thu Jan 9 15:21:23 2020 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: 11325991 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48CDD92A for ; Thu, 9 Jan 2020 15:28:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FCE020673 for ; Thu, 9 Jan 2020 15:28:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JWQnO/GE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FCE020673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZjY-00072j-Lm for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:28:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40228) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZdu-0007IW-5K for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZds-0004YC-ML for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:37 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20087 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZds-0004WB-HR for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r3ZQ1yjWg+zwPb7yaMBrPwZ0OBjAylTCAOCJYYSVOiU=; b=JWQnO/GEwQeki6hg2zkpXnaujQ0dXboDGQo1kMb/4JglOY5F43Zo5qVco1Q3Nar6dX23Ea kpV0TAsD4yj7NWVh2CDJOTJ9JnEy8nEu3Ge9uTot5FR77wQ6Ge0Sk6Vb66juzX59T0wb53 CdH/G8TEavvBzw5qIso3XD+mzYWso64= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-fDmWKW9vOzO3WF0mJrsHcQ-1; Thu, 09 Jan 2020 10:22:32 -0500 X-MC-Unique: fDmWKW9vOzO3WF0mJrsHcQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C49B9FE71; Thu, 9 Jan 2020 15:22:31 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7805D1CB; Thu, 9 Jan 2020 15:22:20 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 05/15] device-hotplug: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:23 +0100 Message-Id: <20200109152133.23649-6-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace MACHINE_GET_CLASS(current_machine) by MACHINE_GET_CLASS(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- device-hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-hotplug.c b/device-hotplug.c index f01d53774b..44d687f254 100644 --- a/device-hotplug.c +++ b/device-hotplug.c @@ -45,7 +45,7 @@ static DriveInfo *add_init_drive(const char *optstr) if (!opts) return NULL; - mc = MACHINE_GET_CLASS(current_machine); + mc = MACHINE_GET_CLASS(qdev_get_machine()); dinfo = drive_new(opts, mc->block_default_type, &err); if (err) { error_report_err(err); From patchwork Thu Jan 9 15:21:24 2020 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: 11325997 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60116139A for ; Thu, 9 Jan 2020 15:31:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33F542064C for ; Thu, 9 Jan 2020 15:31:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LUYQVGDx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33F542064C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZmh-0002wR-03 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:31:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40807) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZe1-0007TH-70 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZdz-00051L-2G for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:44 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:33502 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZdy-0004yw-Tk for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QE12T9YoIYg3KiaFxYrMJ0Yi0XSnGIdy/p9v0TlJLU8=; b=LUYQVGDxFAnmlIiseUs6xK8lp4hk3/WqcCptjQ8uZdsFqBUHBMv0q7gVKUcHxOPGBaTZtS QOoI4AtgQ0Seaue4wVckJdeHLvw2CCKVFAqIGmmSYVeRpXCfglYnglugGXItuSSk/svsmr OwPYYd1Oz1ojLiOmTYgjBo5wXXrSd1I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-3uSQJtr2O2yD9tYK2nha0g-1; Thu, 09 Jan 2020 10:22:38 -0500 X-MC-Unique: 3uSQJtr2O2yD9tYK2nha0g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E55D84E291; Thu, 9 Jan 2020 15:22:37 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D285C1CB; Thu, 9 Jan 2020 15:22:31 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 06/15] migration/savevm: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:24 +0100 Message-Id: <20200109152133.23649-7-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace MACHINE_GET_CLASS(current_machine) by MACHINE_GET_CLASS(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Acked-by: Dr. David Alan Gilbert Reviewed-by: Alistair Francis Reviewed-by: Juan Quintela --- migration/savevm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 59efc1981d..0e8b6a4715 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -292,7 +292,8 @@ static uint32_t get_validatable_capabilities_count(void) static int configuration_pre_save(void *opaque) { SaveState *state = opaque; - const char *current_name = MACHINE_GET_CLASS(current_machine)->name; + MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); + const char *current_name = mc->name; MigrationState *s = migrate_get_current(); int i, j; @@ -362,7 +363,8 @@ static bool configuration_validate_capabilities(SaveState *state) static int configuration_post_load(void *opaque, int version_id) { SaveState *state = opaque; - const char *current_name = MACHINE_GET_CLASS(current_machine)->name; + MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); + const char *current_name = mc->name; if (strncmp(state->name, current_name, state->len) != 0) { error_report("Machine type received is '%.*s' and local is '%s'", @@ -615,9 +617,7 @@ static void dump_vmstate_vmsd(FILE *out_file, static void dump_machine_type(FILE *out_file) { - MachineClass *mc; - - mc = MACHINE_GET_CLASS(current_machine); + MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); fprintf(out_file, " \"vmschkmachine\": {\n"); fprintf(out_file, " \"Name\": \"%s\"\n", mc->name); From patchwork Thu Jan 9 15:21:25 2020 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: 11325999 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1ED4A139A for ; Thu, 9 Jan 2020 15:31:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E96782064C for ; Thu, 9 Jan 2020 15:31:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Jgonsh8E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E96782064C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZmj-000303-2D for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:31:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZe5-0007aU-7P for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZe4-0005QB-7a for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:49 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:54141 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZe4-0005JK-1K for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:22:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zSEVdD4q81/iEc/2OJsdkw6WfL0iI9AF0OwFhiGUJrs=; b=Jgonsh8Eiaj/GugQWIlYdK2EofFmuu6HaI7UnsNYQ8Z7nu+orSRCX4TGQz3qrk9BjfnXMH xpm0TBwvS/PGf+RCz8QvekjsysiQFiUulrpa4aItM2Tp6fr5+MiN8adDxUH2JMbiS1SMuR xoxE3oBccAFh/Bc6gohnuiSnTZXu+PQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-294-YHDvjnUkN62ZEraTmN9r2g-1; Thu, 09 Jan 2020 10:22:45 -0500 X-MC-Unique: YHDvjnUkN62ZEraTmN9r2g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D8698C4B4E; Thu, 9 Jan 2020 15:22:43 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD97980602; Thu, 9 Jan 2020 15:22:37 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 07/15] hw/core/machine-qmp-cmds: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:25 +0100 Message-Id: <20200109152133.23649-8-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace MACHINE_GET_CLASS(current_machine) by MACHINE_GET_CLASS(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/core/machine-qmp-cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index eed5aeb2f7..5a04d00e4f 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -280,9 +280,9 @@ void qmp_cpu_add(int64_t id, Error **errp) { MachineClass *mc; - mc = MACHINE_GET_CLASS(current_machine); + mc = MACHINE_GET_CLASS(qdev_get_machine()); if (mc->hot_add_cpu) { - mc->hot_add_cpu(current_machine, id, errp); + mc->hot_add_cpu(MACHINE(qdev_get_machine()), id, errp); } else { error_setg(errp, "Not supported"); } From patchwork Thu Jan 9 15:21:26 2020 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: 11325981 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F88192A for ; Thu, 9 Jan 2020 15:24:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65DB420673 for ; Thu, 9 Jan 2020 15:24:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gx+M2YOv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65DB420673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZg8-0002LH-1M for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:24:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42320) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZeI-0007st-O1 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZeG-0006DZ-Kt for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:02 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:60021 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZeG-00066k-Ab for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H5HnxoPdzrltmBx4GJfO10Gs5/HVEMyNIWg08Qb03H8=; b=gx+M2YOvq6X7Yjgu47VSjPOymnQH5VJep4a38gamElsj0qiJaYw7T1SkgdjmbuXoawinPo v1hifi6XikgOZm66kwFEWdfP2fI5UlOOpDuX46wmD2AWHmH0gqz1TO2XA+zrlXwxYfU2eW kZb7o9s6mu8Oz8kY4nU+hb8vkop6X/w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-Hjxm58MoNNa7j3wVE--rPQ-1; Thu, 09 Jan 2020 10:22:54 -0500 X-MC-Unique: Hjxm58MoNNa7j3wVE--rPQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 894668C4B52; Thu, 9 Jan 2020 15:22:52 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D8E61CB; Thu, 9 Jan 2020 15:22:43 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 08/15] target/arm/monitor: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:26 +0100 Message-Id: <20200109152133.23649-9-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace 'current_machine' by MACHINE(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- target/arm/monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/monitor.c b/target/arm/monitor.c index fa054f8a36..bcbf69802d 100644 --- a/target/arm/monitor.c +++ b/target/arm/monitor.c @@ -136,7 +136,8 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, } if (kvm_enabled()) { - const char *cpu_type = current_machine->cpu_type; + MachineState *ms = MACHINE(qdev_get_machine()); + const char *cpu_type = ms->cpu_type; int len = strlen(cpu_type) - strlen(ARM_CPU_TYPE_SUFFIX); bool supported = false; From patchwork Thu Jan 9 15:21:27 2020 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: 11326003 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4209F92A for ; Thu, 9 Jan 2020 15:35:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15D0B2064C for ; Thu, 9 Jan 2020 15:35:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C+6R538t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15D0B2064C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZqU-0007xl-Re for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:35:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42613) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZeM-0007wl-Rs for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZeJ-0006Ra-Mp for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:05 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57333 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZeJ-0006PA-Ft for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hzr8Edx5jAryfh/huxiAkUz4zCXuFwzT7om8QEdCtyk=; b=C+6R538tDUSlBZEE7nrT6P9s3jlyEutfO1g38dDT/PTqgTKT+y6wWQG51jRT2ucriHHgww 3KZBVI3WjSYswOTiulbnn5gvKBihqRVDmgls9ZNti2MJHV0MYTcsjoIv94HiwKaFgUs+JM Wd8jqtzLX3OjySffPMp8T1VjP5jckcw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-275-_7PA0sDLPwqBnL2Z-1DRkA-1; Thu, 09 Jan 2020 10:22:59 -0500 X-MC-Unique: _7PA0sDLPwqBnL2Z-1DRkA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 18ED985EE6A; Thu, 9 Jan 2020 15:22:58 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FD0280608; Thu, 9 Jan 2020 15:22:52 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 09/15] device_tree: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:27 +0100 Message-Id: <20200109152133.23649-10-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace 'current_machine' by MACHINE(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- device_tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/device_tree.c b/device_tree.c index f8b46b3c73..665ea2f586 100644 --- a/device_tree.c +++ b/device_tree.c @@ -466,7 +466,9 @@ uint32_t qemu_fdt_alloc_phandle(void *fdt) * which phandle id to start allocating phandles. */ if (!phandle) { - phandle = machine_phandle_start(current_machine); + MachineState *ms = MACHINE(qdev_get_machine()); + + phandle = machine_phandle_start(ms); } if (!phandle) { From patchwork Thu Jan 9 15:21:28 2020 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: 11325995 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A7D5139A for ; Thu, 9 Jan 2020 15:31:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09A352064C for ; Thu, 9 Jan 2020 15:31:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XUPBzeEr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09A352064C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZmE-0002Pk-Mq for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:31:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42881) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZeO-00080B-F9 for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZeN-0006ky-9g for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:08 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:43918 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZeN-0006hl-3j for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZEMOGD26t+fMYjJ4LobtAf8vZNWvIS3QswsuquGMzqE=; b=XUPBzeErMU4voED02hCBgbSNJbEX5rPbNJdT3z+AgyeVO84x5TvQciFuNx61X2TxPArZcf No6DIR1wlg5Jnn+yXA0snHobfINsnKxvZ6EqHPlpFOf3JGakg7sOgSOKaswc8N8tkAnmXE NlreojCh8ndelr5G0iFedjeM9ZNriyM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-440-wgHZV1PxPwGTHcuUwuI7bA-1; Thu, 09 Jan 2020 10:23:05 -0500 X-MC-Unique: wgHZV1PxPwGTHcuUwuI7bA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6C531005513; Thu, 9 Jan 2020 15:23:03 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CF5F1CB; Thu, 9 Jan 2020 15:22:58 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 10/15] memory: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:28 +0100 Message-Id: <20200109152133.23649-11-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace 'current_machine' by MACHINE(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memory.c b/memory.c index d7b9bb6951..57e38b1f50 100644 --- a/memory.c +++ b/memory.c @@ -3004,6 +3004,7 @@ static void mtree_print_flatview(gpointer key, gpointer value, int n = view->nr; int i; AddressSpace *as; + MachineState *ms; qemu_printf("FlatView #%d\n", fvi->counter); ++fvi->counter; @@ -3026,6 +3027,7 @@ static void mtree_print_flatview(gpointer key, gpointer value, return; } + ms = MACHINE(qdev_get_machine()); while (n--) { mr = range->mr; if (range->offset_in_region) { @@ -3057,7 +3059,7 @@ static void mtree_print_flatview(gpointer key, gpointer value, if (fvi->ac) { for (i = 0; i < fv_address_spaces->len; ++i) { as = g_array_index(fv_address_spaces, AddressSpace*, i); - if (fvi->ac->has_memory(current_machine, as, + if (fvi->ac->has_memory(ms, as, int128_get64(range->addr.start), MR_SIZE(range->addr.size) + 1)) { qemu_printf(" %s", fvi->ac->name); From patchwork Thu Jan 9 15:21:29 2020 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: 11326009 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9085E92A for ; Thu, 9 Jan 2020 15:37:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 21C9220721 for ; Thu, 9 Jan 2020 15:37:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RQKdjH2v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21C9220721 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZsX-0002qi-0s for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:37:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43854) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZea-0008Ff-1U for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZeX-0007Zm-St for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:18 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24904 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZeX-0007WD-FP for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BOe6/URSftxgo5ESkRc2DJBElz4tXj5Z8utyHCtsD8A=; b=RQKdjH2vFMBWkXFR1vH8Px3wLfPEeyCAYVOlECXZhwA0wI4TBxNB4aUHU7JqAlnKz+/fu/ /6fVSoQBRFPcava8nOAfZocHjZcpqmQa2yHP5ITONMAhx5GkPTytlLnmlTk8C6Fmg858kW 00uOnRGOZucuHRXL7rDd+S/4jZbkJN4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-170-QJIASVVyPyuGiKmHhZaWnw-1; Thu, 09 Jan 2020 10:23:15 -0500 X-MC-Unique: QJIASVVyPyuGiKmHhZaWnw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0B137DB20; Thu, 9 Jan 2020 15:23:14 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C5AC80618; Thu, 9 Jan 2020 15:23:04 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 11/15] exec: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:29 +0100 Message-Id: <20200109152133.23649-12-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace 'current_machine' by MACHINE(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- exec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index d4b769d0d4..98f5b049ca 100644 --- a/exec.c +++ b/exec.c @@ -1984,11 +1984,11 @@ static unsigned long last_ram_page(void) static void qemu_ram_setup_dump(void *addr, ram_addr_t size) { - int ret; + MachineState *ms = MACHINE(qdev_get_machine()); /* Use MADV_DONTDUMP, if user doesn't want the guest memory in the core */ - if (!machine_dump_guest_core(current_machine)) { - ret = qemu_madvise(addr, size, QEMU_MADV_DONTDUMP); + if (!machine_dump_guest_core(ms)) { + int ret = qemu_madvise(addr, size, QEMU_MADV_DONTDUMP); if (ret) { perror("qemu_madvise"); fprintf(stderr, "madvise doesn't support MADV_DONTDUMP, " @@ -2108,7 +2108,9 @@ size_t qemu_ram_pagesize_largest(void) static int memory_try_enable_merging(void *addr, size_t len) { - if (!machine_mem_merge(current_machine)) { + MachineState *ms = MACHINE(qdev_get_machine()); + + if (!machine_mem_merge(ms)) { /* disabled by the user */ return 0; } From patchwork Thu Jan 9 15:21:30 2020 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: 11325993 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E40792A for ; Thu, 9 Jan 2020 15:28:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7531120673 for ; Thu, 9 Jan 2020 15:28:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CLfFxVAL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7531120673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZjm-0007Hm-91 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:28:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44478) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZef-0008QN-FY for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZee-00087J-AP for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:25 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:55910 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZee-00085C-5b for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EA7clJKJ1RuwQZV3nJY9EmgysBuWFpNyPg81lJP16ic=; b=CLfFxVALDOunx+OFI+P+RX5LQd3qBu88lOVf/PRqUIwe63q+kPlMGG+/Ucr3F+irQjz3Tr cr2Z8+vpDZqLIU/8BC5mPRc4+AVvG3sv7Wma5d99yRvxswH5uRfr8VDHmRKjsdBnZSB8bm g8X9znrG5TT5ESbbqpID/kWOReuYk9k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-317-Bssf6NODNKGQ5QTbYx0F5Q-1; Thu, 09 Jan 2020 10:23:22 -0500 X-MC-Unique: Bssf6NODNKGQ5QTbYx0F5Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93700107ACC4; Thu, 9 Jan 2020 15:23:20 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B76B61CB; Thu, 9 Jan 2020 15:23:14 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 12/15] accel: Introduce the current_accel() method Date: Thu, 9 Jan 2020 16:21:30 +0100 Message-Id: <20200109152133.23649-13-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" We want to remove the global current_machine. The accel/ code access few times current_machine->accelerator. Introduce the current_accel() method first, it will then be easier to replace 'current_machine' by MACHINE(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- include/sysemu/accel.h | 2 ++ accel/accel.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index d4c1429711..47e5788530 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -70,4 +70,6 @@ int accel_init_machine(AccelState *accel, MachineState *ms); /* Called just before os_setup_post (ie just before drop OS privs) */ void accel_setup_post(MachineState *ms); +AccelState *current_accel(void); + #endif diff --git a/accel/accel.c b/accel/accel.c index 1c5c3a6abb..cb555e3b06 100644 --- a/accel/accel.c +++ b/accel/accel.c @@ -63,6 +63,11 @@ int accel_init_machine(AccelState *accel, MachineState *ms) return ret; } +AccelState *current_accel(void) +{ + return current_machine->accelerator; +} + void accel_setup_post(MachineState *ms) { AccelState *accel = ms->accelerator; From patchwork Thu Jan 9 15:21:31 2020 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: 11326011 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACAAF92A for ; Thu, 9 Jan 2020 15:39:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83A982067D for ; Thu, 9 Jan 2020 15:39:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UHk7tShc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83A982067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZtx-0004yf-NY for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:39:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45066) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZem-00009K-SH for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZel-0000A6-AU for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:32 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:28083 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZel-00006t-5c for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qEB5J+exbJGBcgBu1CXxgeJ3mLfk648Rs1grVXpU7U4=; b=UHk7tShcqRPOGcpAYfO3CVDACPnFahwf6vrwt40NbPthSNXJfGsfr4DD/+pO0uD1Unx02f GPWxC1838fplpFpfDnpr3NZ47FxA7h/DqTnoGmVFgk2u5yBq2kEgv9Xlz/b2fEpdoS15nV 1s8azLvgrVMgHUt0DCXcwrd5yrpwbH8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-GrJTMZRwNw-0xA4bX3RZSQ-1; Thu, 09 Jan 2020 10:23:29 -0500 X-MC-Unique: GrJTMZRwNw-0xA4bX3RZSQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79BB0800D48; Thu, 9 Jan 2020 15:23:27 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 496647FB5C; Thu, 9 Jan 2020 15:23:21 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 13/15] accel: Replace current_machine->accelerator by current_accel() method Date: Thu, 9 Jan 2020 16:21:31 +0100 Message-Id: <20200109152133.23649-14-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace 'current_machine->accelerator' by current_accel(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- accel/kvm/kvm-all.c | 4 ++-- accel/tcg/tcg-all.c | 2 +- memory.c | 2 +- target/arm/kvm64.c | 4 ++-- target/i386/kvm.c | 2 +- target/ppc/kvm.c | 2 +- vl.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index b2f1a5bcb5..be1980f250 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -164,7 +164,7 @@ static NotifierList kvm_irqchip_change_notifiers = int kvm_get_max_memslots(void) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return s->nr_slots; } @@ -1847,7 +1847,7 @@ static int kvm_max_vcpu_id(KVMState *s) bool kvm_vcpu_id_is_valid(int vcpu_id) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return vcpu_id >= 0 && vcpu_id < kvm_max_vcpu_id(s); } diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 1dc384c8d2..1802ce02f6 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -124,7 +124,7 @@ static void tcg_accel_instance_init(Object *obj) static int tcg_init(MachineState *ms) { - TCGState *s = TCG_STATE(current_machine->accelerator); + TCGState *s = TCG_STATE(current_accel()); tcg_exec_init(s->tb_size * 1024 * 1024); cpu_interrupt_handler = tcg_handle_interrupt; diff --git a/memory.c b/memory.c index 57e38b1f50..60e8993499 100644 --- a/memory.c +++ b/memory.c @@ -3106,7 +3106,7 @@ void mtree_info(bool flatview, bool dispatch_tree, bool owner) }; GArray *fv_address_spaces; GHashTable *views = g_hash_table_new(g_direct_hash, g_direct_equal); - AccelClass *ac = ACCEL_GET_CLASS(current_machine->accelerator); + AccelClass *ac = ACCEL_GET_CLASS(current_accel()); if (ac->has_memory) { fvi.ac = ac; diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 876184b8fe..f677877a1e 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -613,14 +613,14 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) bool kvm_arm_aarch32_supported(CPUState *cpu) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return kvm_check_extension(s, KVM_CAP_ARM_EL1_32BIT); } bool kvm_arm_sve_supported(CPUState *cpu) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return kvm_check_extension(s, KVM_CAP_ARM_SVE); } diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 0b511906e3..2ed15814dc 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -147,7 +147,7 @@ bool kvm_allows_irq0_override(void) static bool kvm_x2apic_api_set_flags(uint64_t flags) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return !kvm_vm_enable_cap(s, KVM_CAP_X2APIC_API, 0, flags); } diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index d1c334f0e3..2d011308e0 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -258,7 +258,7 @@ static void kvm_get_smmu_info(struct kvm_ppc_smmu_info *info, Error **errp) struct ppc_radix_page_info *kvm_get_radix_page_info(void) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); struct ppc_radix_page_info *radix_page_info; struct kvm_ppc_rmmu_info rmmu_info; int i; diff --git a/vl.c b/vl.c index 86474a55c9..3ff3548183 100644 --- a/vl.c +++ b/vl.c @@ -2804,7 +2804,7 @@ static void configure_accelerators(const char *progname) } if (init_failed) { - AccelClass *ac = ACCEL_GET_CLASS(current_machine->accelerator); + AccelClass *ac = ACCEL_GET_CLASS(current_accel()); error_report("falling back to %s", ac->name); } From patchwork Thu Jan 9 15:21:32 2020 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: 11326013 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A92CA92A for ; Thu, 9 Jan 2020 15:41:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F6DE2067D for ; Thu, 9 Jan 2020 15:41:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gwNh8iYR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F6DE2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZvj-0008Dx-1S for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:41:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45975) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZex-0000RZ-2N for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZev-00015j-TK for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:42 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:40182 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZev-00013X-OU for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vNApPi1X+zRXACouBoiVidpyff+gUxoQCsbtOGpF3sA=; b=gwNh8iYRfNmQxJftqIx4be9cPMJ18IZdMRGUfzLrNqUetGnnQacLbeUkYujHB190pBiNdn 7KRvlmKS93z3tnrCcPVWOuv7k4Ko55RyA8GzTGU9I42pwNycuCzV2jBP6yTPspsvKZUFc8 8+LkbdbW31m3veb8URKxynzMa6Rp8/0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-okIuNwqmOrWMJxTPVr8mUw-1; Thu, 09 Jan 2020 10:23:37 -0500 X-MC-Unique: okIuNwqmOrWMJxTPVr8mUw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 41CB0DB20; Thu, 9 Jan 2020 15:23:36 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BA467FB5C; Thu, 9 Jan 2020 15:23:27 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 14/15] accel/accel: Replace current_machine by qdev_get_machine() Date: Thu, 9 Jan 2020 16:21:32 +0100 Message-Id: <20200109152133.23649-15-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we want to remove the global current_machine, replace 'current_machine' by MACHINE(qdev_get_machine()). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- accel/accel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accel/accel.c b/accel/accel.c index cb555e3b06..777d6ba119 100644 --- a/accel/accel.c +++ b/accel/accel.c @@ -65,7 +65,9 @@ int accel_init_machine(AccelState *accel, MachineState *ms) AccelState *current_accel(void) { - return current_machine->accelerator; + MachineState *ms = MACHINE(qdev_get_machine()); + + return ms->accelerator; } void accel_setup_post(MachineState *ms) From patchwork Thu Jan 9 15:21:33 2020 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: 11326001 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDF56139A for ; Thu, 9 Jan 2020 15:35:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1C732064C for ; Thu, 9 Jan 2020 15:35:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OGXGnjkB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1C732064C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZqP-0007na-Fm for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jan 2020 10:35:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46551) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZf3-0000d0-7x for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZf2-0001bS-0y for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:49 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:59898 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipZf1-0001Z8-Nc for qemu-devel@nongnu.org; Thu, 09 Jan 2020 10:23:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4kUKKeAf2s8djmV5zny/Aq4FrGtcS96wgzcVBqpzxsI=; b=OGXGnjkBKitaM5lljrqyC2Hjyylr1n3AYJK3tDDITS7w/m9CmMvMXkrLFja/bTXsUwIXQS 2+tKlSzbNkjUdNhC60B8fSaUjL4zpCSxJphyWzsPznMAGo+cDysq1rLEkBvYI2PEKxicg6 pDna9v4Q3kRF4lGuYL89dcLCiE+ZNjk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-105--h2u7_6uOF6RjR-my6orjA-1; Thu, 09 Jan 2020 10:23:45 -0500 X-MC-Unique: -h2u7_6uOF6RjR-my6orjA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E57231800D4E; Thu, 9 Jan 2020 15:23:43 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE46980608; Thu, 9 Jan 2020 15:23:36 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 15/15] vl: Make current_machine a local variable Date: Thu, 9 Jan 2020 16:21:33 +0100 Message-Id: <20200109152133.23649-16-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Juan Quintela , qemu-ppc@nongnu.org, Marcelo Tosatti , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Alistair Francis , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Since we now only use current_machine in vl.c, stop exporting it as a global variable in "hw/board.h", and make it static to vl.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- include/hw/boards.h | 2 -- vl.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 61f8bb8e5a..b0c0d4376d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -59,8 +59,6 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, #define MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE) -extern MachineState *current_machine; - void machine_run_board_init(MachineState *machine); bool machine_usb(MachineState *machine); int machine_phandle_start(MachineState *machine); diff --git a/vl.c b/vl.c index 3ff3548183..7a69af4bef 100644 --- a/vl.c +++ b/vl.c @@ -214,6 +214,8 @@ static int default_sdcard = 1; static int default_vga = 1; static int default_net = 1; +static MachineState *current_machine; + static struct { const char *driver; int *flag; @@ -1164,8 +1166,6 @@ static int usb_parse(const char *cmdline) /***********************************************************/ /* machine registration */ -MachineState *current_machine; - static MachineClass *find_machine(const char *name, GSList *machines) { GSList *el;