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: 1446777 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VQKnhB0L; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4DrMr2609Pz9sS8 for ; Thu, 4 Mar 2021 05:25:38 +1100 (AEDT) Received: from localhost ([::1]:58372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHWBk-0000Qv-QW for incoming@patchwork.ozlabs.org; Wed, 03 Mar 2021 13:25:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHW9H-0005Mj-5J for qemu-devel@nongnu.org; Wed, 03 Mar 2021 13:23:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lHW9F-0000Zc-0h for qemu-devel@nongnu.org; Wed, 03 Mar 2021 13:23:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614795780; 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=VQKnhB0Ll0OSNCfBjnovaibuIHYiEXA7TvissbPJXodoKPIzgJwOiVvCc8YJIS7EDQpoRT +9dNYKtTjk13IExXL3t+9ZuDaTVJX40t/PjxOgd3lA+CoC3JuOdVZhpe+jnZn2LKtSxaiE b8FrePGM3K+AbMn8i4uB7354F8O7xcU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-L_y9mhIHOxiezLMMv009Hg-1; Wed, 03 Mar 2021 13:22:56 -0500 X-MC-Unique: L_y9mhIHOxiezLMMv009Hg-1 Received: by mail-wr1-f72.google.com with SMTP id e13so13133089wrg.4 for ; Wed, 03 Mar 2021 10:22:56 -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=qtfuXoAatQvPxKtj9K8TU4EMLdMIgOS3tnO8mUH1X/qmqZaViJ71/vKbeJxKygSPZO KGlttszgaMiSfAO0MYEzDdt4rk3hILG3ZXGSMOFZYO38+h46BxvtT2BXphZmPSmYvTHm I8QNOnjCZiHmPTz0u9552Q5JMMtyPWSY9BxlEJBdu0Om4y15afDvJin4ZYuSyVaW3VyZ B/Tt1uaWbccP62vABsRwXHiJkGwwwEBiJftxj/HZjTC561O0tiRCVqH9UECRwwvoT993 JrOvFnTr+QkEa3SvtOkWemkbD6aQ1KGM5y2gtP8SWKDnevFMG1UpeX6duYurhSvZ7SqK eT+w== X-Gm-Message-State: AOAM532DzFWtEDrcRqPEPWaGfrz2Ro5ZV78GRzvvUgC2bnkaUy/M0R0V nxDzSiTz8rSqUJ8FYDsuIc0gLe8xVi7Ltv93VvLQrNvNrIFhO3CLxSAATmHqtexARso2ZDUbCrA 6SZGv5JoJuvg48TgT1GgTmCkrj54HuQqZvWOfDf13kYmfDOJWisJo+bZFUxFKRBUi X-Received: by 2002:a5d:4445:: with SMTP id x5mr36758wrr.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) 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 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 Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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 , kvm@vger.kernel.org, David Hildenbrand , haxm-team@intel.com, Colin Xu , Halil Pasic , Christian Borntraeger , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , Cameron Esfahani , Roman Bolshakov , qemu-arm@nongnu.org, Sunil Muthuswamy , David Gibson , Marcelo Tosatti , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Wenchao Wang , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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;