From nobody Tue Feb 10 17:31:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614795779; cv=none; d=zohomail.com; s=zohoarc; b=O3+z2bAFQnHWQ6dk4kfXQ4QkQg2FJG6POjnWvk3q09kQKx0GdI+SYcRYQNINdWBq9qZSYe0oNylGNuBzY93nMdtwZmJ4CDKn9JSz376tshN+t8O7lj6pJPm9s1YMOF9DByGu/qT3gwIKLXiDW8k+1FkkFJ5l8zN75bbDe3683Zk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614795779; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=PLSHq+T6Ji51VQxldUQn+fMOB/V6gychel2awYEX8OQ=; b=ZGPy6QCWyIqvtBdQ55/+YSnAiv1Tz19zduz8JG52mgCQouKp4AozOzr6fHuuhCpdetYzGEXJHLparuMKRNLu91bWoEfF27/0rbz7wSxf35E4P65xhVO2btwK+KdXnkPhE+97afc9/+353OQcSUiy4os6rRn6/3SmGlDTY0467mI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 161479577938339.49804800712161; Wed, 3 Mar 2021 10:22:59 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-Wqwi3WriP7mCN7jRDz4D_A-1; Wed, 03 Mar 2021 13:22:56 -0500 Received: by mail-wr1-f70.google.com with SMTP id l10so13159995wry.16 for ; Wed, 03 Mar 2021 10:22:56 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id g9sm34117131wrp.14.2021.03.03.10.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 10:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614795778; 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=PLSHq+T6Ji51VQxldUQn+fMOB/V6gychel2awYEX8OQ=; b=I8rKIGNblhLav8MOA2/ifzd1V6/vKBSj3MPz97TXkS4999Z5sKbnbDhCBp0b0PQdYIo0uy w0bYIxKjXbnBPdN9ILrJAskFmavNvq94/fq9GfYoT8WwrsL/OfVo2puf3pnuP0WGl/rsN0 4aBmrbFwBWqn1EsCZr35pXIP9HJXD2Y= X-MC-Unique: Wqwi3WriP7mCN7jRDz4D_A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PLSHq+T6Ji51VQxldUQn+fMOB/V6gychel2awYEX8OQ=; b=gwUgoamb/Movg2IS8MQDRpgkFarwVHGGIcSCn7CRdMVFyFdFR5bJIz9POafqsCaGQ8 li9wY169Kdfb7wdhgVJPWRGWzo9Zb06oUKdU0sj03IoDsoJRW4FRQRVZMe3AOVe/ott9 EqYsllbGCl3n7XGuc1rPhaKNylEHhd95JyitgT6pt/Xftp/qaOYdBVq7WbAyTN7pZCfU wxfVtXCOeIPP9jgkPuua+OjFNciItW+h+DiJNMMKt0/oYGQMl/wj7F/jPFfjaR7Mxk84 Txh+YzJN1VGyj9/sF90b+/uIHr0+XP5AS9VYa4SVA2rXkVGKVZsM28h8ukOIRCl6M2+N ikuQ== X-Gm-Message-State: AOAM531lf0ptcfDxIh/vYiJj2YvMh2BCOIA+/ND2rdbQDGWK11ZzjZks pXNvmKnHjT/3ptkSif5xM7/li9KZUqrLWE9j4f74syylSYmXfKou2na4LUeM6oSntsb+XVxM0AW KGLSrKHh5UjmUgA== X-Received: by 2002:a5d:4445:: with SMTP id x5mr36759wrr.30.1614795775646; Wed, 03 Mar 2021 10:22:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyL7XqgigoYX+jhMS8HmdFrzDcCNORueIOZ/5Ml4d8Vt2v7I+aoNp8Jrifd3yZk0HsaustCqA== X-Received: by 2002:a5d:4445:: with SMTP id x5mr36729wrr.30.1614795775449; Wed, 03 Mar 2021 10:22:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Cornelia Huck , Richard Henderson , Sunil Muthuswamy , Marcelo Tosatti , David Gibson , Marcel Apfelbaum , kvm@vger.kernel.org, Wenchao Wang , Thomas Huth , Cameron Esfahani , Paolo Bonzini , David Hildenbrand , Roman Bolshakov , Peter Maydell , Greg Kurz , qemu-arm@nongnu.org, Halil Pasic , Colin Xu , Claudio Fontana , qemu-ppc@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, haxm-team@intel.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 05/19] cpu: Introduce AccelvCPUState opaque structure Date: Wed, 3 Mar 2021 19:22:05 +0100 Message-Id: <20210303182219.1631042-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210303182219.1631042-1-philmd@redhat.com> References: <20210303182219.1631042-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Introduce the opaque 'AccelvCPUState' structure which will be declared by each accelerator. Forward-declare it in "cpu.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 074199ce73c..d807645af2b 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -274,6 +274,9 @@ struct qemu_work_item; #define CPU_UNSET_NUMA_NODE_ID -1 #define CPU_TRACE_DSTATE_MAX_EVENTS 32 =20 +/* This structure is defined by each accelerator. */ +struct AccelvCPUState; + /** * CPUState: * @cpu_index: CPU index (informative). @@ -312,6 +315,7 @@ struct qemu_work_item; * @next_cpu: Next CPU sharing TB cache. * @opaque: User data. * @mem_io_pc: Host Program Counter at which the memory was accessed. + * @accel_vcpu: Pointer to accelerator-specific AccelvCPUState field. * @kvm_fd: vCPU file descriptor for KVM. * @work_mutex: Lock to prevent multiple access to @work_list. * @work_list: List of pending asynchronous work. @@ -413,6 +417,7 @@ struct CPUState { int32_t exception_index; =20 /* Accelerator-specific fields. */ + struct AccelvCPUState *accel_vcpu; int kvm_fd; struct KVMState *kvm_state; struct kvm_run *kvm_run; --=20 2.26.2