From patchwork Sat Jun 24 17:41:05 2023 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: 695711 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp2502460wrm; Sat, 24 Jun 2023 10:42:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pfi0Pqe1GujWJBulpImqeoz47WRozZ4obUU82JRozkknUnCYLkg7RXOuGVM0TxwL4jZGJ X-Received: by 2002:ac8:59c3:0:b0:3fd:de11:d8e4 with SMTP id f3-20020ac859c3000000b003fdde11d8e4mr22008645qtf.23.1687628530437; Sat, 24 Jun 2023 10:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687628530; cv=none; d=google.com; s=arc-20160816; b=feSc45qx9K5hxWag7hUQinEqFfQTRGARdZ6dTD/1qmqvR63wE4CdOcG8IgWMCW36FE UdBCKSncd5G1XLzhH8HcLMBiUQR3PQF0/2rq0svfqQpd+RkoWOuitrgE5sooRq+0I1fF wnarpq8ZDkaZVXBvMuTBUa/rmH11INmEfWfrSiJRKzMT6wRwwY3WFjUJR5UPNjafqqSU 869xxWKZa40amLOCDX5Y4yhe+te2uxfy3ey5NdUGQqkCKUrY6mt9cXWjGhYjikSQRD2t d17o8TPXNrICyKwDg0m+r2pDeEVpMteta8rufjDZ80jctqs5e+jDC1KRuQKI0UP1GDdO 8MIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=9DD8JyzZ0D9c0TVJWROVlnDQP9z+YeCBvlalUwzeBRo=; fh=dxlO8U8n9FJbkfu3NZ9xTJMkF/Fn5IQj359CkmYw0tg=; b=P5LbNKMq+GVsSSQGh3/xILEbyzy49NeBx8tDg9GtutxqHNjXt/+jrY8lKakLdKaOi8 0keX2msDLJQMSXZWNjqda3yJxa/OmZXyoGjdDy6nzWMApQB5+hg49WTHn9Kx/DeSeZoB 0DNNF1HQSi78RWHFIkYGd/VS/h6keh6+ZpPQHm6XQFxBjRKb3xICu8h2OuJiXCMLTczb eChxOYzMS/wCC+gZJHBVoH8gZXjN1p9DMoPzRbwthg0M8ueEuk8Or6zTuNGBLNez/1/8 M+nTJG4EX6HN4zAZ25oygeDZj6yhEribyvxX9DY0YakXkhgwr076ybDDpCU2l/CS9xyC rxbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S8HxrYQ2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y19-20020ac85f53000000b003f9ac43ae09si597160qta.612.2023.06.24.10.42.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Jun 2023 10:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S8HxrYQ2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qD7GO-0005c1-65; Sat, 24 Jun 2023 13:41:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qD7GM-0005bg-9v for qemu-devel@nongnu.org; Sat, 24 Jun 2023 13:41:30 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qD7GJ-00063i-H2 for qemu-devel@nongnu.org; Sat, 24 Jun 2023 13:41:29 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fa70ec8d17so26238385e9.1 for ; Sat, 24 Jun 2023 10:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687628485; x=1690220485; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9DD8JyzZ0D9c0TVJWROVlnDQP9z+YeCBvlalUwzeBRo=; b=S8HxrYQ2qhgw56X9JXNpzNmjfiViWtcbiWCpgQccPHZivixZ7QAzwnG0azVoU7xVwb akuxl0mdCTpThLPPNG44q2zM7WFBYRf++FIjeb7OZaKYcNCoxQVVFO06aKvqykPLZlYZ ZvpNiq98b5G8YgGvHvAodfNZ2LcJFFazSZG27b+pSB9bw6v7bdgijzZhhCtwRpACo7M0 slPhBm89C1gJKR7y1ERfGhGue/oWbU0iTwXu9x0IUylVr99MqavVrVlJRD4xj8CSGUvm 6za9HdL9/cV4dMDN2/DHhAKDF5i4CxvXeVSa4T7v0NhA1XGwrIFxIoVXTwJ+ThKpvofI 84Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687628485; x=1690220485; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9DD8JyzZ0D9c0TVJWROVlnDQP9z+YeCBvlalUwzeBRo=; b=NfWKlwEMNa6J6FAo0O/eXozVYt9t/etgyQ6YR/I1AZmF71AaUqfrYuFBIIvk7IgoEa pOd67xvP63dOY2OlmQ+RYQ93C3CbxFDHaZfQLsV2S7kO1uOKuOLZEU25zR59XExmakVJ dqDcefVum/ZmK4t+2sYHSg/EHhdVGE8yPx18EVTQ4n1GRWlTICXyVLdbATqrQ2H+IIRD DZOT+aP0Qk0CRw7lUbQNw510forNq0uElAVz/o+nx8gbv9HApAdbkK40y1C3/AkvIQaA YuZL5pQRZSlXd7+zXPORf+y30iGFGGcQsnuVaIAAvHbelPcOyRedMOp5eVumS2KGAI9J z94A== X-Gm-Message-State: AC+VfDx4K1LORUyA69atF0CNIsj6f8P/QMlQjX4LQTaaL7dfid8jDaru 0KLmXp068DDSpz4zLhzEMjr6D2w1pE2FdkYARyY= X-Received: by 2002:a05:600c:2942:b0:3f7:e7a2:25f6 with SMTP id n2-20020a05600c294200b003f7e7a225f6mr21913470wmd.17.1687628485030; Sat, 24 Jun 2023 10:41:25 -0700 (PDT) Received: from m1x-phil.lan ([176.187.217.150]) by smtp.gmail.com with ESMTPSA id p23-20020a1c7417000000b003f9b0f640b1sm2711760wmc.22.2023.06.24.10.41.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 24 Jun 2023 10:41:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Marcel Apfelbaum , Peter Maydell , Roman Bolshakov , qemu-arm@nongnu.org, Richard Henderson , Alexander Graf , xen-devel@lists.xenproject.org, Sunil Muthuswamy , Anthony Perard , Stefano Stabellini , Yanan Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paul Durrant , Reinoud Zandijk , Eduardo Habkost , Cameron Esfahani , Paolo Bonzini Subject: [PATCH v3 00/16] accel: Share CPUState accel context (HAX/NVMM/WHPX/HVF) Date: Sat, 24 Jun 2023 19:41:05 +0200 Message-Id: <20230624174121.11508-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This series is part of the single binary effort. All accelerator will share their per-vCPU context in an opaque 'accel' pointer within the CPUState. First handle HAX/NVMM/WHPX/HVF. KVM and TCG will follow as two different (bigger) follow-up series. Except HVF/intel, all has been (cross-)build tested. I plan to send the PR myself. Since v2: - Addressed rth's review comments - Added rth's R-b tag Since v1: - Addressed rth's review comments - Added rth's R-b tag - Converted HVF intel (untested) - Rebased Philippe Mathieu-Daudé (16): MAINTAINERS: Update Roman Bolshakov email address accel: Document generic accelerator headers accel: Remove unused hThread variable on TCG/WHPX accel: Fix a leak on Windows HAX accel: Destroy HAX vCPU threads once done accel: Rename 'hax_vcpu' as 'accel' in CPUState accel: Rename HAX 'struct hax_vcpu_state' -> AccelCPUState accel: Move HAX hThread to accelerator context accel: Remove NVMM unreachable error path accel: Rename NVMM 'struct qemu_vcpu' -> AccelCPUState accel: Inline NVMM get_qemu_vcpu() accel: Remove WHPX unreachable error path accel: Rename WHPX 'struct whpx_vcpu' -> AccelCPUState accel: Inline WHPX get_whpx_vcpu() accel: Rename 'cpu_state' -> 'cs' accel: Rename HVF 'struct hvf_vcpu_state' -> AccelCPUState MAINTAINERS | 4 +- include/hw/core/cpu.h | 10 +- include/qemu/typedefs.h | 1 + include/sysemu/hax.h | 2 + include/sysemu/hvf_int.h | 2 +- include/sysemu/kvm.h | 2 + include/sysemu/nvmm.h | 2 + include/sysemu/tcg.h | 2 + include/sysemu/whpx.h | 2 + include/sysemu/xen.h | 2 + target/i386/hax/hax-i386.h | 12 +- target/i386/hvf/vmx.h | 22 +- target/i386/hvf/x86hvf.h | 18 +- accel/hvf/hvf-accel-ops.c | 18 +- accel/tcg/tcg-accel-ops-mttcg.c | 4 - accel/tcg/tcg-accel-ops-rr.c | 3 - target/arm/hvf/hvf.c | 108 ++++----- target/i386/hax/hax-accel-ops.c | 5 +- target/i386/hax/hax-all.c | 26 ++- target/i386/hax/hax-posix.c | 4 +- target/i386/hax/hax-windows.c | 6 +- target/i386/hvf/hvf.c | 104 ++++----- target/i386/hvf/x86.c | 28 +-- target/i386/hvf/x86_descr.c | 26 +-- target/i386/hvf/x86_emu.c | 62 ++--- target/i386/hvf/x86_mmu.c | 4 +- target/i386/hvf/x86_task.c | 10 +- target/i386/hvf/x86hvf.c | 372 +++++++++++++++--------------- target/i386/nvmm/nvmm-all.c | 42 ++-- target/i386/whpx/whpx-accel-ops.c | 3 - target/i386/whpx/whpx-all.c | 45 ++-- .mailmap | 3 +- 32 files changed, 469 insertions(+), 485 deletions(-)