From patchwork Wed Mar 3 18:22:05 2021 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: 12115001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ABE4C4332E for ; Thu, 4 Mar 2021 00:30:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 800BC64E67 for ; Thu, 4 Mar 2021 00:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344388AbhCDAal (ORCPT ); Wed, 3 Mar 2021 19:30:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56610 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377260AbhCCS2h (ORCPT ); Wed, 3 Mar 2021 13:28:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614796023; 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=E7PcqCyYOBd9ukCCdc+/8AHwW8lqYO0WDzFUSUaXumAED/qzPkESh0egDjr0WPky+zpjPt JanLpL/756PmrFe9kQA+l3ZkRfgyMc/r9iwjTAozbukAKCYKBjNITc4cyB7cdzCe8mpWY4 M866HmA32LmGXsJSGMwPM0ybWGq+TgA= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-490-2UnEy_V2PYSB1aeq4QHNZw-1; Wed, 03 Mar 2021 13:22:58 -0500 X-MC-Unique: 2UnEy_V2PYSB1aeq4QHNZw-1 Received: by mail-wr1-f69.google.com with SMTP id l10so13160032wry.16 for ; Wed, 03 Mar 2021 10:22:58 -0800 (PST) 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=hvOdiUmbIflHF2BQzod6K/ISMJJBxntm5PTB75dM0yt3LM3TmKRhapddbtVT7XhmC1 IstHyKqroQeYlFn+JambDepA46CDENrXit0aRcgMqwUW8OpYoMqBuR/xU9pp83/K9dxc zFrI+gXDXGofp9F7YuRFznoUe6io+HOMM63DNSefhMC8z3Fo+wtlu4REFrkpIFkREcNa aS6myyBzuV+j5be3rbeg+jyEtk8oT+xO0KqCPz3UhMrI6dStPxhYQZSaS2lc47COioPT QBJOgqQPT/v5O6qyClsmjk+QYCuP9Zz2y4stWliFkkIX07IBERdimtEjA2cemhjl7qVF f1VQ== X-Gm-Message-State: AOAM531N10jiraGXog+h6p2ShILZ8GGXDPiS37F8YM922th+80ZvT9+D 4CpFzlZwI2aKPdG0a/t0qFZiDz7iMGAGcOd8HQbPLiBI0X/B8GDj57LQfV30rjWc+/7evSOpdxH eeLpP9UFStjpm X-Received: by 2002:a5d:4445:: with SMTP id x5mr36864wrr.30.1614795777196; Wed, 03 Mar 2021 10:22:57 -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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud?= =?utf-8?q?=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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Introduce the opaque 'AccelvCPUState' structure which will be declared by each accelerator. Forward-declare it in "cpu.h". Signed-off-by: Philippe Mathieu-Daudé --- 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 +/* 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; /* Accelerator-specific fields. */ + struct AccelvCPUState *accel_vcpu; int kvm_fd; struct KVMState *kvm_state; struct kvm_run *kvm_run;