From patchwork Wed Apr 5 10:17:57 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: 670304 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp186674wrt; Wed, 5 Apr 2023 03:18:31 -0700 (PDT) X-Google-Smtp-Source: AKy350Y8yuBq/TuVcjEmqPGm2NAruPRShfyB/DOC57G9RYMp2Ln4iEc0M+3JVw8ZsU02hMqgkStN X-Received: by 2002:a05:622a:2c1:b0:3e1:bed2:ff0c with SMTP id a1-20020a05622a02c100b003e1bed2ff0cmr3716375qtx.55.1680689910816; Wed, 05 Apr 2023 03:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680689910; cv=none; d=google.com; s=arc-20160816; b=C4cIy410EAyJViH7qWfq29Kuu/BjsNinfaXEm3u6Vn5vNPef8B8ijXCP5S2Idel+Bv mg9dIw3V3BLVHoanDHDdVKxwJnk/Asymvgul4M1eLvHHAjr6fxM4Y+ja+Rf5wWMof/OI 7dSwttEJV1uia/Ka41E3m3TGCid8tBoJbDUplWvZGngroUBy7X0UssDJLs/R4qOEGr+v fN4Qcu9boKCbgbcfo1B6Iq25D2DBo2BdorbDU5WcnKXNGxMe93nzCeyy9RDIqCXk0xkU 0cxcojWOe/sLbyG59ad3Sf8UkJajouV5qAFZBUUClueeKjxPtjb+rU/7mFenghLx7pyN 94JQ== 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=R3c7APLhxJFNCqIErCGS2nhF3aw+HLHuokeVO/lFk00=; b=m0HoHksAm/b4hqduVHcBsXRJKE/BZ63U+lrB8E8OoIBoE728/lNbruDESdiWd4EwSQ rbdQzj2gk+Uzo1Jr1zndiain9qTZBAdneEpJxtft7aXf2hCrSV9ln11zqhMpeD56VbZT 9j5gB2OoEMMszYTv3arJ1LLAaul0Dnl1I0PjHA/DOgXo8QXaeR48417RJzwtXCPRREEn CHJArTFkn4PiGJahZH0zGBl2LfEigMqJyqFmj8t//V5D9+6lhqPSRd75O6w6epVflLQr 0a1fM9GofFY0lZOio2LCsEnWM9W6By+6lj6KLu0zB1ue9lX+VtQ8Ia4RHRq0HPDk0ttr gBFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="OBiO/iyM"; 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 j12-20020a05620a288c00b0074a498be858si4270248qkp.651.2023.04.05.03.18.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Apr 2023 03:18:30 -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="OBiO/iyM"; 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 1pk0Db-00065H-LT; Wed, 05 Apr 2023 06:18:19 -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 1pk0Da-000656-CA for qemu-devel@nongnu.org; Wed, 05 Apr 2023 06:18:18 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pk0DY-00018i-Er for qemu-devel@nongnu.org; Wed, 05 Apr 2023 06:18:18 -0400 Received: by mail-wm1-x329.google.com with SMTP id v14-20020a05600c470e00b003f06520825fso740240wmo.0 for ; Wed, 05 Apr 2023 03:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680689894; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=R3c7APLhxJFNCqIErCGS2nhF3aw+HLHuokeVO/lFk00=; b=OBiO/iyMPp7HhyBZcX7fJgp2AA6LNBmXbyqspQfxTpbw5ifIhJkHachSnVGxiHum7T pDyTjdZU/TDYDH8YqIYCNPP2VKdx3wdUBLlBxM9gzo34nXlEfQws3UH3CuMpU0XuvBtJ BR0Y9rfffghCpUn3Lq722SfA08hTOExgU+rQvnILo+j+5Ft88ticBqenXwg5p/GlGvca 41krEivQExeKbzC6OcydV1hPviKH9pwe4ul7G2ol7M0QTifUHh3PLePZ/6n5cypktE9F 2KVXZ7OB0raOVG9XCJUMp3dAf1zpvJiqWUaGdW48AgcrjBnZSMXe3CucyEtdxru47k5Y KTzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680689894; 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=R3c7APLhxJFNCqIErCGS2nhF3aw+HLHuokeVO/lFk00=; b=enRhiLQCu1ESJzoLSvE+69N2FtEkUoAXF4dCk4lVcYCi84vwh5ZkEK6gHnWID+g/ly hF58UQye9BLeBGcOcncZ57LCmGZ0WPGp/cLI6NNfNt4n44rNOo81g6sxJYqk9jjby+5B SbnSGuHLvcMjdkmpQ8D2RZolWWw0F1wkj5Aov002kA4I+Nfp6C0D5MJ2KsXqk2K7Er6+ 5guvPpYbpDI4EGoNm4J58MlRJN+5nKblmZPiXXhSerWcK+H3aJLk9dK9x12lKASxS+Oo r66VQefGNnG0I1drDoEuKBRwMMdWFqLJOsFkOzy9YLm59lIKpYAvpQ/2NwgTYDMYC19M 4BBg== X-Gm-Message-State: AAQBX9cZC9xWbUlLRqRVGcb1feegQ7FyKfmToP3VrHbRvn6lr02wXsah qFB9apuXs61Y/py0I3AiFvDjZU1Mnuc+j+jdMs4= X-Received: by 2002:a7b:c4d3:0:b0:3ed:551b:b78f with SMTP id g19-20020a7bc4d3000000b003ed551bb78fmr4181570wmk.4.1680689894558; Wed, 05 Apr 2023 03:18:14 -0700 (PDT) Received: from localhost.localdomain (4ab54-h01-176-184-52-81.dsl.sta.abo.bbox.fr. [176.184.52.81]) by smtp.gmail.com with ESMTPSA id t16-20020a05600c451000b003ef66c89af0sm5203608wmo.0.2023.04.05.03.18.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 05 Apr 2023 03:18:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , xen-devel@lists.xenproject.org, kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH 00/14] accel: Share CPUState accel context (HAX/NVMM/WHPX/HVF) Date: Wed, 5 Apr 2023 12:17:57 +0200 Message-Id: <20230405101811.76663-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::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 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. Philippe Mathieu-Daudé (14): 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: Use a typedef for struct hax_vcpu_state accel: Rename struct hax_vcpu_state -> struct AccelvCPUState accel: Move HAX hThread to accelerator context accel: Allocate NVMM vCPU using g_try_FOO() accel: Rename NVMM struct qemu_vcpu -> struct AccelvCPUState accel: Inline NVMM get_qemu_vcpu() accel: Rename WHPX struct whpx_vcpu -> struct AccelvCPUState accel: Inline WHPX get_whpx_vcpu() accel: Rename HVF struct hvf_vcpu_state -> struct AccelvCPUState include/hw/core/cpu.h | 11 ++--- 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 | 14 ++++--- accel/hvf/hvf-accel-ops.c | 16 +++---- accel/tcg/tcg-accel-ops-mttcg.c | 4 -- accel/tcg/tcg-accel-ops-rr.c | 3 -- target/arm/hvf/hvf.c | 70 +++++++++++++++---------------- 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/nvmm/nvmm-all.c | 38 +++++++---------- target/i386/whpx/whpx-accel-ops.c | 3 -- target/i386/whpx/whpx-all.c | 39 +++++++---------- 20 files changed, 123 insertions(+), 130 deletions(-) Acked-by: Richard Henderson Reviewed-by: Richard Henderson