From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579604808; cv=none; d=zohomail.com; s=zohoarc; b=SLcW8RMxrkEKIku5PlAxJ6/t/lytndJXO1Mpknfk2mCINgFjpwA2VjsD5GcdXI/Pmg3tUubyx1RlN0bGd3LnRQqk+XyuKfj6Sy7PCdmLwX/4rkiIy4yImj24XFjub4wAN1tzqp0p9nBRu24ZFncbuj6Xqu/m/JKx9k/ODJilLr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579604808; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M9YLZWFuUPGqf31v4qZl1Pp9bDL94NV9XAqJHkBYaeI=; b=fnnAL8OikRcrDaMm7L1+B/IOxJN/M/sMdD2ZSXiUCy26mlbsy7us/iosrmLCXCi92HOle8lWyKIT0Wxqo/31lLaB/DJNn6dGsiaCQh85xwIBAsksAlkrjGfYCT2DGRBsCz/NZZZcHaVh4/htXjgYzzlBTSVRZqeDNewhUZ9Jn3g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579604808711449.4109249556966; Tue, 21 Jan 2020 03:06:48 -0800 (PST) Received: from localhost ([::1]:51754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrMs-00056J-VM for importer@patchew.org; Tue, 21 Jan 2020 06:06:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40260) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrKZ-0002iP-Op for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrKW-0002H4-80 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:23 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:52777 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 1itrKW-0002GO-3s for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:20 -0500 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-197-LMl9Q4MAPJu1MdrGURLk5g-1; Tue, 21 Jan 2020 06:04:12 -0500 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 0497E107ACC7; Tue, 21 Jan 2020 11:04:11 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1EC2583860; Tue, 21 Jan 2020 11:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604659; 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=M9YLZWFuUPGqf31v4qZl1Pp9bDL94NV9XAqJHkBYaeI=; b=AbyyGOv/hSPjJphB9/XKPAa6XxYP68qoqlNnRjpgKVGs2Fbq0iGi9axaRzdksR7rypfZgg xHdhc+iaXPoAqQPs/4ajTEvh8ffolPyZuhrCu+DPdT2LTFvTVgFtSkYH+Xd9MRQkZcfSpW eVdcFOAKGU0u61f3FWiAznyCyY46uOE= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 01/10] hw/ppc/spapr_rtas: Use local MachineState variable Date: Tue, 21 Jan 2020 12:03:40 +0100 Message-Id: <20200121110349.25842-2-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: LMl9Q4MAPJu1MdrGURLk5g-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Since we have the MachineState already available locally, use it instead of the global current_machine. Reviewed-by: Greg Kurz Acked-by: David Gibson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 *c= pu, "DesProcs=3D%d," "MaxPlatProcs=3D%d", max_cpus, - current_machine->ram_size / MiB, + ms->ram_size / MiB, ms->smp.cpus, max_cpus); if (pcc->n_host_threads > 0) { --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579604812; cv=none; d=zohomail.com; s=zohoarc; b=cxdVrOTTFfi0EPJsg9hglp5b0NRUr7iHNTXUBvbqLclHWSHFs2U6c8PGIxvV+nPhFtPML9VVpVGJBwJZSFGfIl8Fw9uB1Vnani0UTlDjjE5jPdX9W7kdt+bW3/7i+rJ33JCXvOuzAvHKZOHxX3WsPkS9pMMfE/trjrV5aYwpl2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579604812; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ugM9iIFSDeSVcz1r2AmzyjCdAlqSyh7orSAZpE2fwRQ=; b=NNeoRcfod94Czl1DxU6qE/WAqMm5rqlumb7HrXsd5VBlXKP7RZS1dU7LHo2dRKTfGdr3UWc6b6/17/Hn7xmmkhj9WGX+HsZZd+erQOernmglY4Nnvg3Ax6wOrMYzaaWr3jwnaFcErL7JSJZHOQmEh3LwxvtoA4MPF5cSqepY7cg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579604812380206.559229012753; Tue, 21 Jan 2020 03:06:52 -0800 (PST) Received: from localhost ([::1]:51756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrMw-0005DI-TI for importer@patchew.org; Tue, 21 Jan 2020 06:06:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40302) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrKg-0002rm-Ro for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrKd-0002Mn-A4 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:30 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:59873 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 1itrKd-0002ML-4A for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:27 -0500 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-106-03CrOVL0Nxaaees-369O2Q-1; Tue, 21 Jan 2020 06:04:25 -0500 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 E55848010DE; Tue, 21 Jan 2020 11:04:23 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 916F483860; Tue, 21 Jan 2020 11:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604666; 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=ugM9iIFSDeSVcz1r2AmzyjCdAlqSyh7orSAZpE2fwRQ=; b=jWYEql/l1UrYdHo7j+WZrhTbhtMO+3g+Kj1iSSMCVlIGKvttJrXGDPVpXe8Ahmnh12rab1 dPurqVLPODa5k9fBj41yalcFS9MOK2JCwsux3iOHNNIdsgj2nhl6pbiLYGU8RpP4Fli13e qjgcBrO2PVVnkWXACj6Pz74m0bBjyAM= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 02/10] hw/ppc/spapr_rtas: Access MachineState via SpaprMachineState argument Date: Tue, 21 Jan 2020 12:03:41 +0100 Message-Id: <20200121110349.25842-3-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 03CrOVL0Nxaaees-369O2Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We received a SpaprMachineState argument. Since SpaprMachineState inherits of MachineState, use it instead of calling qdev_get_machine. Reviewed-by: Greg Kurz Acked-by: David Gibson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 *c= pu, uint32_t nret, target_ulong rets) { PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cpu); - MachineState *ms =3D MACHINE(qdev_get_machine()); + MachineState *ms =3D MACHINE(spapr); unsigned int max_cpus =3D ms->smp.max_cpus; target_ulong parameter =3D rtas_ld(args, 0); target_ulong buffer =3D rtas_ld(args, 1); --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579604957; cv=none; d=zohomail.com; s=zohoarc; b=ZBmIfcRgANPpBOzgtRt8D7ks1msKht8zd7VjvQYMU/Lp2mwjcXrB/66EgK9FdjTrg63B8d/zIWtFIurIFteFhfFSz0fjkmVa2VVOi6atSKdzzQO7OQg2IbPkPKsW0tldhdg3qCwagVCwhbZBLaDWMzu/FXy3USevoGrPyJyrsCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579604957; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2FdyuOddDgduFYXe6Y137A4VQhs5udzN82HFgwEGmO0=; b=BI+lnN2h97NRaE7QsbDw/xLF8gow5dxGQbVnU39ndHAN/g6kJRCUj+mYL5VugRFq0JF4WwgcEKJn1/SyuqNIGHoNP5myVbrbUlFv+vfR1YDi22ox8swDARN7rj78SosYe/71l+ppRIi80QN7iZ7YOLs5r4Y3FM9yndxCcVWPsoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579604957423821.5791370331485; Tue, 21 Jan 2020 03:09:17 -0800 (PST) Received: from localhost ([::1]:51802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrPH-0000PM-AP for importer@patchew.org; Tue, 21 Jan 2020 06:09:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40349) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrKt-00038c-0w for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrKp-0002T4-6k for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:42 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:38267 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 1itrKp-0002Sa-2s for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:39 -0500 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-uWSQThgZPmChLebSa4X5wg-1; Tue, 21 Jan 2020 06:04:37 -0500 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 BBD1B800D41; Tue, 21 Jan 2020 11:04:34 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92039811F8; Tue, 21 Jan 2020 11:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604678; 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=2FdyuOddDgduFYXe6Y137A4VQhs5udzN82HFgwEGmO0=; b=hDx8lR0tRpO94giY/ESCypACsFA2LQV3MT1p27Upk3eD5OToqrzihFNYAsAYiF0BAHVMCm uYuNnTT4DN3xt2nQcIxezYclTJwnxUaFIeiYDuZqdo9EhpE2rGzlWDOT8A/Mto2yOGYxKL WB9+DgIi/UQH+xYCOoTaXIdrHZYuEnI= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 03/10] hw/ppc/spapr_rtas: Remove local variable Date: Tue, 21 Jan 2020 12:03:42 +0100 Message-Id: <20200121110349.25842-4-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: uWSQThgZPmChLebSa4X5wg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We only access this variable in the RTAS_SYSPARM_SPLPAR_CHARACTERISTICS case. Use it in place and remove the local declaration. Suggested-by: Greg Kurz Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- v2: Do not reduce MachineState variable scope (David Gibson) --- hw/ppc/spapr_rtas.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 6f06e9d7fe..85135e0e1a 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -268,7 +268,6 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *c= pu, { PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cpu); MachineState *ms =3D MACHINE(spapr); - unsigned int max_cpus =3D ms->smp.max_cpus; target_ulong parameter =3D rtas_ld(args, 0); target_ulong buffer =3D rtas_ld(args, 1); target_ulong length =3D rtas_ld(args, 2); @@ -280,10 +279,10 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU = *cpu, "DesMem=3D%" PRIu64 "," "DesProcs=3D%d," "MaxPlatProcs=3D%d", - max_cpus, + ms->smp.max_cpus, ms->ram_size / MiB, ms->smp.cpus, - max_cpus); + ms->smp.max_cpus); if (pcc->n_host_threads > 0) { char *hostthr_val, *old =3D param_val; =20 --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579604848; cv=none; d=zohomail.com; s=zohoarc; b=I1frnN9w1SSWBmfBzuxqhzyUZms0UzsOpLN84I6PNmBgLV+xOH944GxS/tp3y+EEsCxWAbia3rTOj9y52Je9HcDDTxwFHfH75iSWnYSlg2D825ooa+9iuCGTLpZ644E3Oizu0u/dfP/NcqybnOox/sB/ROvZC1OQbK2T6xTLg50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579604848; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YNlVqBRJIlR7/zXL37e3Z5FlDIKU7U2XhzOak3irN/g=; b=WQxoHBuK2LH8vol8UkreVpjTEtAevruxRJkBDwCD0kARw5szfQXhg8ZQtJrkWEq316U0KD61+emrX4soHBUmhbICwQxMLl6EZQXq1AbfHuBp4vzgR2kBuvTX8WAfIW0+qwH3gKbps6+aRaUVdi5jp+8ngIXmee/Wh62mFNeTX/A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157960484882444.61913662894847; Tue, 21 Jan 2020 03:07:28 -0800 (PST) Received: from localhost ([::1]:51758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrNX-0006AB-9y for importer@patchew.org; Tue, 21 Jan 2020 06:07:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40406) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrL0-0003IP-Ea for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrKz-0002YF-6n for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:50 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:31188 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 1itrKz-0002Xk-3M for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:49 -0500 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-329-bfzwLpcAO7mKKSD-CO1Xng-1; Tue, 21 Jan 2020 06:04:47 -0500 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 C9B9118A6EC1; Tue, 21 Jan 2020 11:04:45 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66ADA85726; Tue, 21 Jan 2020 11:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604688; 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=YNlVqBRJIlR7/zXL37e3Z5FlDIKU7U2XhzOak3irN/g=; b=aGU4WD54Km/tTKhOTjvCncg9EuO0pCmV7+yTQ7hqmkNI67ZKjOyN7NDWblkPMW/A6wXpTK fGvrJDkgSLoEndGXZHEyWJEu2+fwyaR6MwrCssegvnwMcLZA96OYebEcnGVpC/mA3h4eIm V50vWHplxzMAsyGdzRC0Lwoe41Fa2bc= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 04/10] target/arm/kvm: Use CPUState::kvm_state in kvm_arm_pmu_supported() Date: Tue, 21 Jan 2020 12:03:43 +0100 Message-Id: <20200121110349.25842-5-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: bfzwLpcAO7mKKSD-CO1Xng-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Alistair Francis , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" KVMState is already accessible via CPUState::kvm_state, use it. Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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) =20 bool kvm_arm_pmu_supported(CPUState *cpu) { - KVMState *s =3D 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); } =20 int kvm_arm_get_max_vm_ipa_size(MachineState *ms) --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579605037; cv=none; d=zohomail.com; s=zohoarc; b=CkzSzqTnGj16Wjv9UGgymgK713dYxo+UDYXzQWOKmoJVmcjPZ52ft7/22QfgZ3Q6vMkVGNb74wtnuRT1cr25TuNGEw33mj+7Qtu2K1Km7p18TpBD8h+yh7KKDJ61VXiZyubCsrdJJ0BzZVuCr4Naas+Ls83MTU/rfHMPc7QwgZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579605037; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ea1a/sRDFxUcqC42bdgwDPTcMkjiHzUbs2lKdEFCTMo=; b=WbwEvxcdz/ORGP00cBBQj798Ih7I99YvgRJueZpokWSlA8nFQSdgWQ3EbuqxRb3NlTrFF+xQjj38vD4ItAnycPlIwFOsl3NNDHI2eIHNPMqgpscFZ8UtEsENpL9PpGHs/NxOlFomXiw784p/SJD9a3bBhcNX/URv4gmMmDEkmo4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579605037347435.05659501569687; Tue, 21 Jan 2020 03:10:37 -0800 (PST) Received: from localhost ([::1]:51824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrQZ-0002LL-NU for importer@patchew.org; Tue, 21 Jan 2020 06:10:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40476) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrLA-0003Wd-4W for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrL6-0002bY-Gm for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:00 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:41104 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 1itrL6-0002bG-Cj for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:04:56 -0500 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-27-0FJY1TuUOrOL2stsHOrGTw-1; Tue, 21 Jan 2020 06:04:54 -0500 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 2F968DBA5; Tue, 21 Jan 2020 11:04:53 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96C1C811F8; Tue, 21 Jan 2020 11:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604696; 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=Ea1a/sRDFxUcqC42bdgwDPTcMkjiHzUbs2lKdEFCTMo=; b=G+LJDLSNRLj7ZROSq7MttakiRrldUXmybCFa9lO7pQBSMIOsCWO+TtYdz/99FpOxStHAus TmnA8k3gOFvyjRR/JcnYWzXO6GiP31CABuWmxeCwVNS8xfTcEh2MbR4ipHWwlW6OtVoTtL QOUpFo1y60VazqfHcTr/nZ0vqs54jlc= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 05/10] target/s390x: Remove duplicated ifdef macro Date: Tue, 21 Jan 2020 12:03:44 +0100 Message-Id: <20200121110349.25842-6-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 0FJY1TuUOrOL2stsHOrGTw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit ae71ed8610 replaced the use of global max_cpus variable with a machine property, but introduced a unnecessary ifdef, as this block is already in the 'not CONFIG_USER_ONLY' branch part: 86 #if defined(CONFIG_USER_ONLY) 87 ... 106 #else /* !CONFIG_USER_ONLY */ 107 ... 292 static void do_ext_interrupt(CPUS390XState *env) 293 { ... 313 #ifndef CONFIG_USER_ONLY 314 MachineState *ms =3D MACHINE(qdev_get_machine()); 315 unsigned int max_cpus =3D ms->smp.max_cpus; 316 #endif To ease code review, remove the duplicated preprocessor macro, and move the declarations at the beginning of the statement. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck --- v2: New patch Cc: Like Xu --- target/s390x/excp_helper.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index e70c20d363..1e9d6f20c1 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -305,15 +305,14 @@ static void do_ext_interrupt(CPUS390XState *env) =20 if ((env->pending_int & INTERRUPT_EMERGENCY_SIGNAL) && (env->cregs[0] & CR0_EMERGENCY_SIGNAL_SC)) { + MachineState *ms =3D MACHINE(qdev_get_machine()); + unsigned int max_cpus =3D ms->smp.max_cpus; + lowcore->ext_int_code =3D cpu_to_be16(EXT_EMERGENCY); cpu_addr =3D find_first_bit(env->emergency_signals, S390_MAX_CPUS); g_assert(cpu_addr < S390_MAX_CPUS); lowcore->cpu_addr =3D cpu_to_be16(cpu_addr); clear_bit(cpu_addr, env->emergency_signals); -#ifndef CONFIG_USER_ONLY - MachineState *ms =3D MACHINE(qdev_get_machine()); - unsigned int max_cpus =3D ms->smp.max_cpus; -#endif if (bitmap_empty(env->emergency_signals, max_cpus)) { env->pending_int &=3D ~INTERRUPT_EMERGENCY_SIGNAL; } --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579605204; cv=none; d=zohomail.com; s=zohoarc; b=fwNS2z5JKw1BssgBTSN0mYLLWpjSN7j748ViKyW89pyZsQUESKEMRxV3za3k2fOZ9o6C9O0hbjKZHsnVHiVWCTlVjMT/CRA7WJwAU6VUrPSd5Se8Z4KoDKcS4KZoBqghofxmhqK5axdFt/RGWHOQ6YtM8vg/L4o7OlgdgVk7oRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579605204; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CleyiTyFzeU7YFGR9t8XlXBZmAxEriIlOMwBzucwkpQ=; b=PZymnPOBr4V3kHUQbMkfYzbeVn+fgzi2/Rx5tQRy/kEjJX7NGRns8ristS64TTds9pKgQlernO5gJ18Ncx/yt1g1l1dTThuIgZg37pI6gLYzelA1rbWv8Kn2n7lFEKYklLC8J5Z42AAbAOlZuOG7G3gjMJjaMMIMCUSIP0GhOcI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579605204698531.3087550256373; Tue, 21 Jan 2020 03:13:24 -0800 (PST) Received: from localhost ([::1]:51882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrTG-00066M-U5 for importer@patchew.org; Tue, 21 Jan 2020 06:13:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40520) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrLJ-0003hh-Jc for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrLE-0002fN-Ut for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:09 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20570 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 1itrLE-0002ev-Rm for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:04 -0500 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-377-EdVqMcpMOy2sK8ntRqZvkQ-1; Tue, 21 Jan 2020 06:05:03 -0500 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 63E5B18A6EC1; Tue, 21 Jan 2020 11:05:01 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A48C811F8; Tue, 21 Jan 2020 11:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604704; 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=CleyiTyFzeU7YFGR9t8XlXBZmAxEriIlOMwBzucwkpQ=; b=PQNiJGg56cBkEdlMbT0/TTxIEFLYVPPfH7LLrc6jwIX/W5wRc1odh2xQyy27Q7fZ7p9dOZ GHW5xZ9h+t7N518HxKitLYHWJCfM107skk/p3Yxj8IGhaH6jPIF5RVwZnUgyOFOWqiAcWP OQVvwSpdHSCylTLIsDySH5KYBrMsst0= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 06/10] qom/object: Display more helpful message when a parent is missing Date: Tue, 21 Jan 2020 12:03:45 +0100 Message-Id: <20200121110349.25842-7-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: EdVqMcpMOy2sK8ntRqZvkQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Cornelia Huck , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" QEMU object model is scarse in documentation. Some calls are recursive, and it might be hard to figure out even trivial issues. We can avoid developers to waste time in a debugging session by displaying a simple error message. This commit is also similar to e02bdf1cecd2 ("Display more helpful message when an object type is missing"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck --- v2: New patch --- qom/object.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 0d971ca897..bc13a55094 100644 --- a/qom/object.c +++ b/qom/object.c @@ -173,7 +173,11 @@ static TypeImpl *type_get_parent(TypeImpl *type) { if (!type->parent_type && type->parent) { type->parent_type =3D type_get_by_name(type->parent); - g_assert(type->parent_type !=3D NULL); + if (!type->parent_type) { + fprintf(stderr, "Object '%s' missing its parent '%s'\n", + type->name, type->parent); + abort(); + } } =20 return type->parent_type; --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579604957; cv=none; d=zohomail.com; s=zohoarc; b=acTDg2yXp0zmHH6hsT3WhRGSr6DuMQm4IUYWo2mlSTIr5Pn65FZMz9O0/ANWYwew2rieTinOIxlfRGEz8bVktzpBJgR9iOEJ2MoeSa9YOPr2oM4RPOGpDnTVgshnnUdlNWaB2ORbNMKBPzhpYk2NLeZE6E41STrZXsV/wB+WG+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579604957; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=szvLNNLQdSyRCXMP/WlwlQ7xqfZ8pJdJ2R1hbRxN9kc=; b=NQGoHdRU/FLUH2h7VPPW1SD7lBDQLd4DqviiVltCi5zyXptzGDjRzzhJHVejeCfSxi4dMISnJ//8jyWGZfhzgkyafHLPKMEj06qjM2Z8cw7smIBJRgUV8DJ8bIDqTyqGEm14B5gRwbAT5ERDpiCWJSWhQHrsG5JYGNt1aOxQd40= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579604957559373.9690946317262; Tue, 21 Jan 2020 03:09:17 -0800 (PST) Received: from localhost ([::1]:51804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrPH-0000S5-Fk for importer@patchew.org; Tue, 21 Jan 2020 06:09:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40588) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrLa-0003xt-Ie for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrLV-0002rx-Td for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:26 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27184 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 1itrLU-0002nR-GM for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:20 -0500 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-364-DZCZJ4sFPIuNo7RuHdQnlQ-1; Tue, 21 Jan 2020 06:05:15 -0500 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 7878B8010D8; Tue, 21 Jan 2020 11:05:13 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C0D285733; Tue, 21 Jan 2020 11:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604716; 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=szvLNNLQdSyRCXMP/WlwlQ7xqfZ8pJdJ2R1hbRxN9kc=; b=G6QQpNHPGkwXNL2SKZ3d0qZgxnCBXUpMA5NJJVCg3NZgXDcsL3zOO2vYVkdLiyZiwvHXoM 3MAI+gbQvSFWc3OqWGk8O68h/wQtJlY4hgqKh4a4q6nC6M+BWCQMfuoyiYVN+aEn+FrV63 AuPvBBvPj/IHOH1nTQa2Hv9PPtkSuHI= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 07/10] qdev: Abort if the root machine container is missing Date: Tue, 21 Jan 2020 12:03:46 +0100 Message-Id: <20200121110349.25842-8-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: DZCZJ4sFPIuNo7RuHdQnlQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Cornelia Huck , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The QEMU device API (qdev) relies on having the '/machine' container always available. If it is missing, QEMU will later crash dereferencing a NULL pointer, we will get a SEGV, open a debugger, look at the backtrace, and figure out we messed with QOM. Or we can use g_assert() which abort, displaying the filename and line number, so we can quickly open our favorite IDE. Prefer the later, to save time to developers. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v2: New patch --- hw/core/qdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 58e87d336d..d30cf6320b 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -1143,6 +1143,7 @@ Object *qdev_get_machine(void) =20 if (dev =3D=3D NULL) { dev =3D container_get(object_get_root(), "/machine"); + g_assert(dev !=3D NULL); } =20 return dev; --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579604978; cv=none; d=zohomail.com; s=zohoarc; b=hzaD/0j6jJ2O28/l+u22fPnZozzRxD4hQG0p0a/0g1Ymri14CORhF/jWZ6yejKioIxj8/ughybF1tfJgsFvxBRMM/zuBPD9X1aAZ+SGvz6x1gF8kIxQOrn38mCYogY1c+GWuJL/zbMhgA//YBPqMFN+mdTvZMbhk6IbmS2SqZII= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579604978; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xXEz7PhStQkERVMKiqaV7Qb0h7hoBdcqu+yYcMWd3AI=; b=BX2tWTyRnMHqT9HszMfngQnh5h7DkIZ9GMuBn/fkp20IxF5HKgCpxZZtmIsqvLxE999zgR89alCJV8u0DnJaEmLIJAibbSD+qpS5KPAquLxxYRgqs4mCZTyAgsU3Vo7/JYYCIxuL5M46QPfT3YoVvFiOIE6n7Dk6RvMPm5mzUhs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579604978408984.4206417234238; Tue, 21 Jan 2020 03:09:38 -0800 (PST) Received: from localhost ([::1]:51812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrPc-00010k-PG for importer@patchew.org; Tue, 21 Jan 2020 06:09:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40635) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrLe-00044N-KM for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrLa-0002vK-0l for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:30 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:55445 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 1itrLZ-0002v1-SL for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:25 -0500 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-94-_7zYfEwQPzuFedrPlu-uRQ-1; Tue, 21 Jan 2020 06:05:23 -0500 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 8D131107ACC4; Tue, 21 Jan 2020 11:05:21 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FF2E811F8; Tue, 21 Jan 2020 11:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604725; 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=xXEz7PhStQkERVMKiqaV7Qb0h7hoBdcqu+yYcMWd3AI=; b=SvYTNB+xFc3bY8irYanOOqqf93prNKz4Cb+71gaEpOk/wqZxYCbnJn6/1yDkfU3+A91fTk ygg83djv5WvuWVtGZeQZkWKtGYNJcjaKNcIxbebn/FEDgUKuvs96XhrPZzJ3oYNqvQGPbJ BS+ckoPLydyabcQL+Yn0VfE+8MlwfFM= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 08/10] accel: Introduce the current_accel() wrapper Date: Tue, 21 Jan 2020 12:03:47 +0100 Message-Id: <20200121110349.25842-9-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: _7zYfEwQPzuFedrPlu-uRQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Alistair Francis , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The accel/ code only access the MachineState::accel field. As we simply want to access the accelerator, not the machine, add a current_accel() wrapper. Suggested-by: Paolo Bonzini Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck --- v2: Reworded description using 'wrapper' --- 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 *m= s); /* Called just before os_setup_post (ie just before drop OS privs) */ void accel_setup_post(MachineState *ms); =20 +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; } =20 +AccelState *current_accel(void) +{ + return current_machine->accelerator; +} + void accel_setup_post(MachineState *ms) { AccelState *accel =3D ms->accelerator; --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579605148; cv=none; d=zohomail.com; s=zohoarc; b=JOYG5/VPvnN5zF0UeaZki2h+ri1VvbaD3BzoHmIzRD+W+6XqfdcnDoUL8lYw/Xs8k8NunBnc1h90OabNila1A1PJR0vjmbSC9v1GvlNktPPgwQ9KRoh6ybWQQzpE3vdvuI15zLcidlFs3Ntzafc/vMHMAUesVcoVfGrwK2h75a0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579605148; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iNuoGr5oPJiuWEZoZePQ9BsL70DcUB2WguHzKK55cpE=; b=ngdnxZoVWnBWJq0/40OxzwUOBIo49XAxlipUr2qywlf/Zb4cdPub88byLSS6xdR4MKzS9sKeDPnfM1b8ZaIcFc4b8mbTZrYTkgf7BmyZjwuNaHrCADHv4L7Xmkpa7/kTz5TTeHSsoNZvazEKVV862zy7/rxMCu/AcxpwSMZeh+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579605148863872.4449232229153; Tue, 21 Jan 2020 03:12:28 -0800 (PST) Received: from localhost ([::1]:51866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrSN-0004dB-1i for importer@patchew.org; Tue, 21 Jan 2020 06:12:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40683) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrLk-0004DF-9Z for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrLf-0002yG-MC for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:36 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:29201 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 1itrLf-0002xm-I3 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:31 -0500 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-JQqfRcGaOUKmLMIdFS6tiQ-1; Tue, 21 Jan 2020 06:05:29 -0500 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 363F6DBA3; Tue, 21 Jan 2020 11:05:28 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13C98811F8; Tue, 21 Jan 2020 11:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604731; 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=iNuoGr5oPJiuWEZoZePQ9BsL70DcUB2WguHzKK55cpE=; b=i0oIASQjfC6SBaFXZjprEgIgMac0ULh3WqCuwtSVQRYkPUq+B19KLe8Qp9LTDizcZTK1dq 0AJLDanTkQ8HxJjD4xB4JG9CgJrfjkDTVFBBGfgp3EU9dXrw+m5bd9TH1SApnfTrVHBkGD tMsCO68DyKzJAVa4+KdaAnYZFOWXr6s= X-MC-Unique: JQqfRcGaOUKmLMIdFS6tiQ-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 09/10] accel: Replace current_machine->accelerator by current_accel() wrapper Date: Tue, 21 Jan 2020 12:03:48 +0100 Message-Id: <20200121110349.25842-10-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable 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 , Alistair Francis , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, "open list:Overall KVM CPUs" , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We actually want to access the accelerator, not the machine, so use the current_accel() wrapper instead. Suggested-by: Paolo Bonzini Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- v2: - Reworded description - Remove unused include in arm/kvm64 --- accel/kvm/kvm-all.c | 4 ++-- accel/tcg/tcg-all.c | 2 +- memory.c | 2 +- target/arm/kvm64.c | 5 ++--- target/i386/kvm.c | 2 +- target/ppc/kvm.c | 2 +- vl.c | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 1ada2f4ecb..c111312dfd 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -164,7 +164,7 @@ static NotifierList kvm_irqchip_change_notifiers =3D =20 int kvm_get_max_memslots(void) { - KVMState *s =3D KVM_STATE(current_machine->accelerator); + KVMState *s =3D KVM_STATE(current_accel()); =20 return s->nr_slots; } @@ -1848,7 +1848,7 @@ static int kvm_max_vcpu_id(KVMState *s) =20 bool kvm_vcpu_id_is_valid(int vcpu_id) { - KVMState *s =3D KVM_STATE(current_machine->accelerator); + KVMState *s =3D KVM_STATE(current_accel()); return vcpu_id >=3D 0 && vcpu_id < kvm_max_vcpu_id(s); } =20 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) =20 static int tcg_init(MachineState *ms) { - TCGState *s =3D TCG_STATE(current_machine->accelerator); + TCGState *s =3D TCG_STATE(current_accel()); =20 tcg_exec_init(s->tb_size * 1024 * 1024); cpu_interrupt_handler =3D tcg_handle_interrupt; diff --git a/memory.c b/memory.c index d7b9bb6951..854798791e 100644 --- a/memory.c +++ b/memory.c @@ -3104,7 +3104,7 @@ void mtree_info(bool flatview, bool dispatch_tree, bo= ol owner) }; GArray *fv_address_spaces; GHashTable *views =3D g_hash_table_new(g_direct_hash, g_direct_equ= al); - AccelClass *ac =3D ACCEL_GET_CLASS(current_machine->accelerator); + AccelClass *ac =3D ACCEL_GET_CLASS(current_accel()); =20 if (ac->has_memory) { fvi.ac =3D ac; diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 876184b8fe..e3c580e749 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -26,7 +26,6 @@ #include "sysemu/kvm.h" #include "sysemu/kvm_int.h" #include "kvm_arm.h" -#include "hw/boards.h" #include "internals.h" =20 static bool have_guest_debug; @@ -613,14 +612,14 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures= *ahcf) =20 bool kvm_arm_aarch32_supported(CPUState *cpu) { - KVMState *s =3D KVM_STATE(current_machine->accelerator); + KVMState *s =3D KVM_STATE(current_accel()); =20 return kvm_check_extension(s, KVM_CAP_ARM_EL1_32BIT); } =20 bool kvm_arm_sve_supported(CPUState *cpu) { - KVMState *s =3D KVM_STATE(current_machine->accelerator); + KVMState *s =3D KVM_STATE(current_accel()); =20 return kvm_check_extension(s, KVM_CAP_ARM_SVE); } diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 7ee3202634..eddb930065 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -147,7 +147,7 @@ bool kvm_allows_irq0_override(void) =20 static bool kvm_x2apic_api_set_flags(uint64_t flags) { - KVMState *s =3D KVM_STATE(current_machine->accelerator); + KVMState *s =3D KVM_STATE(current_accel()); =20 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 b5799e62b4..45ede6b6d9 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) =20 struct ppc_radix_page_info *kvm_get_radix_page_info(void) { - KVMState *s =3D KVM_STATE(current_machine->accelerator); + KVMState *s =3D 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 71d3e7eefb..a8ea36f4f8 100644 --- a/vl.c +++ b/vl.c @@ -2812,7 +2812,7 @@ static void configure_accelerators(const char *progna= me) } =20 if (init_failed) { - AccelClass *ac =3D ACCEL_GET_CLASS(current_machine->accelerator); + AccelClass *ac =3D ACCEL_GET_CLASS(current_accel()); error_report("falling back to %s", ac->name); } =20 --=20 2.21.1 From nobody Tue May 7 02:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579605228; cv=none; d=zohomail.com; s=zohoarc; b=NZIUexlll2dzVLKCNE3cxSCrrRqnxOkFc2b1FuPsenY4mV7qpy0UD3VkNBNU5ApAXjHItLP97aq8lHfNQj0N7n5S5senawj4WNLQFCnwtGRjL6ktp38rCGvD5kETqew5ZNat9P1cWd4MWwAzl6q20z7mzZAEThVUDpkw+qPoqeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579605228; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EFdg22iZe4beJkoIxalQuHSOoIgflOzQgeNR8OSLq/w=; b=lCxeo8L+0UjqBdG5XzSClAh9hqqzboFDjiolB2FiqGA28T2iuyouGKodawNh6xJVfF0bo6hGZD08gELvBzaomaeVB0He1EBjA/6SyLfqGOLfWtvHrXsjPX4e2PuowcbGivwpUfifb5wHLNhJTKdnHaG52aBA+RmV0viJN9NMMzY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157960522849961.6613466577204; Tue, 21 Jan 2020 03:13:48 -0800 (PST) Received: from localhost ([::1]:51890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrTf-0006ht-72 for importer@patchew.org; Tue, 21 Jan 2020 06:13:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40737) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itrLu-0004RG-RF for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itrLq-00032N-8I for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:46 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:60536 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 1itrLq-00031Z-4A for qemu-devel@nongnu.org; Tue, 21 Jan 2020 06:05:42 -0500 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-190-3lyWe00MOQuR_hnOS1mLPg-1; Tue, 21 Jan 2020 06:05:40 -0500 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 98CE718A6EC2; Tue, 21 Jan 2020 11:05:36 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-38.brq.redhat.com [10.40.205.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD54D811F8; Tue, 21 Jan 2020 11:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579604741; 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=EFdg22iZe4beJkoIxalQuHSOoIgflOzQgeNR8OSLq/w=; b=i2+VHspwIsgAS1cKMVWnbVIby6wbepatnljKyKpFXVZmC3MeM+Gz/7ckH9u+WklV/dR2UW YkAYzXjfAvIZfP/mIPoLwE4NQ6PGMiBR4uzHlrtXtuEySkTUIz74bxYwToqgUoD3Ol15nI EzkCPywiRZbvXtP7DOCKE0kUEBQD5nY= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 10/10] accel/tcg: Sanitize include path Date: Tue, 21 Jan 2020 12:03:49 +0100 Message-Id: <20200121110349.25842-11-philmd@redhat.com> In-Reply-To: <20200121110349.25842-1-philmd@redhat.com> References: <20200121110349.25842-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 3lyWe00MOQuR_hnOS1mLPg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 , Cornelia Huck , Eduardo Habkost , Like Xu , David Hildenbrand , Marcelo Tosatti , Markus Armbruster , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit af0440ae852 moved the qemu_tcg_configure() function, but introduced extraneous 'include/' in the includes path. As it is not necessary, remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck --- v2: New patch --- accel/tcg/tcg-all.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 1802ce02f6..acfdcfdf59 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -31,9 +31,9 @@ #include "sysemu/cpus.h" #include "qemu/main-loop.h" #include "tcg/tcg.h" -#include "include/qapi/error.h" -#include "include/qemu/error-report.h" -#include "include/hw/boards.h" +#include "qapi/error.h" +#include "qemu/error-report.h" +#include "hw/boards.h" #include "qapi/qapi-builtin-visit.h" =20 typedef struct TCGState { --=20 2.21.1