From nobody Tue Feb 10 07:40:07 2026 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=1579796376; cv=none; d=zohomail.com; s=zohoarc; b=ECp2g1IxixW4DOnnArGhuiXnuKVwbvu1gioJB1xWPaRh+MuNnkOVjZRdiTOSbURQfuUYVQ94P/qY1DhfS7bXwl6idaUlpnbbpUEZuSh9FBoKAluZUD7PWg/jfHfugAFtTtfDHjIgRgtZwBCDWJ81s6gIDNnK56REG3Eqb5PEoZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579796376; 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=sIQ5W5UHd6LBNn/RrQOAOd5yBbO+3FGu4Aq0XOiBiHM=; b=akzbsQPCKVjyQ0lOSkFz9aIev1md5vWZTE2scd9X9HjSvQNUxKh2ny2vzvfbD2T/g9KrQbAOJ9DTshsra1c7XgvfUbDDpoQMfILemiV86zntBCimnhiutASeOZ8DANUSQdJrZiM3EWMj/B1UZhdCAXZbeJ7VvyY5N2HakJBPPG0= 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 1579796376583433.7138087616612; Thu, 23 Jan 2020 08:19:36 -0800 (PST) Received: from localhost ([::1]:60230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufCh-0000cw-A5 for importer@patchew.org; Thu, 23 Jan 2020 11:19:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51606) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrY-0005EH-Kv for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrX-0003m4-3N for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:36 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:37078) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrW-0003gy-S1 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: by mail-wm1-x335.google.com with SMTP id f129so2613332wmf.2 for ; Thu, 23 Jan 2020 05:49:33 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sIQ5W5UHd6LBNn/RrQOAOd5yBbO+3FGu4Aq0XOiBiHM=; b=l9/Dg+eQZ75w9soBwCO6fh2v6EqLEzATIGICcRJRPZXmiipOkVkC8Yla8S1A1D+8pK rFbWamRgwQipXWdbO7PiiSRk/dLwNSqlgD2lG/wA07utjKOzFYg8qwN5szSonEe40y7D OARYAcrM+vH6grYXfxXD7CZLSLU0OkWgMeKGuRons0wyMTieqDWxdUQH7PwGdxzQVnQl +U0InAQek3KoCaoLI4cXeNMXs4md5kumYNaabZ49wI7bRduQVmLWcNHA1nYF11wxKHij LqBJLS49H2EAnedQ6kw8ZuwCw4v+u0g1e9fdhzASJ7cCZsBwCsN4flNV5D+C7Vf2LKxE qpDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sIQ5W5UHd6LBNn/RrQOAOd5yBbO+3FGu4Aq0XOiBiHM=; b=KodbTBzrfiAm0QGIqWRsW1sPT+Oge2U16PJq5yQs7H9+Krmkz203Ed8UFJ1DmEoAS1 RPnEs4id68sbCg1SgLR6rhrfcrxWTyeXDwpJLmgG7wR54rCUYcHxTisA/H5FWiHJ/NX7 C9ZiDYTNUN8c7cog7UaqCeiQzFs7c0LbQCNWzzvqyPEuRWAlf7c2zNKYRS3LewtspOHC XMT8aYD0t9Gp7zjiRoJHmYQmHYLYBjFQLgQCtGx2LjT2AuVExD7JarjnrMaHZuU/fKzu Nii0jU5MrQDkVzqFZwc1o9JkhJ0XTeChx6oYZKORDtSe1COR8VMjygye4JujaR4ILeQW cYBA== X-Gm-Message-State: APjAAAWwx5+bZv40GjSnKw3gTeg+Xodv37PZ311RWWN5PiXpdggOBwMJ 65zq5nyi9yZDLpD/uNf5gtVcl6sZ X-Google-Smtp-Source: APXvYqw47qhhzW7kQNkUAeBOLynk2iTEnGb8NKNwJy/XBatNlpd22p8R/UMyBCeluw8DVqVqD4Aj6w== X-Received: by 2002:a7b:c204:: with SMTP id x4mr4414604wmi.20.1579787372743; Thu, 23 Jan 2020 05:49:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 29/59] accel: Replace current_machine->accelerator by current_accel() wrapper Date: Thu, 23 Jan 2020 14:48:32 +0100 Message-Id: <1579787342-27146-30-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 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 Message-Id: <20200121110349.25842-10-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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 | 4 ++-- vl.c | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 1ada2f4..c111312 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 1dc384c..1802ce0 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 d7b9bb6..8547987 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 876184b..e3c580e 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 1b67090..6ef291d 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -149,7 +149,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 b5799e6..06fd0cc 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; @@ -2907,7 +2907,7 @@ void kvmppc_svm_off(Error **errp) return; } =20 - rc =3D kvm_vm_ioctl(KVM_STATE(current_machine->accelerator), KVM_PPC_S= VM_OFF); + rc =3D kvm_vm_ioctl(KVM_STATE(current_accel()), KVM_PPC_SVM_OFF); if (rc && rc !=3D -ENOTTY) { error_setg_errno(errp, -rc, "KVM_PPC_SVM_OFF ioctl failed"); } diff --git a/vl.c b/vl.c index 9f5f477..368dda1 100644 --- a/vl.c +++ b/vl.c @@ -2824,7 +2824,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 1.8.3.1