From patchwork Sat Jun 24 17:41:09 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: 695713 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp2502476wrm; Sat, 24 Jun 2023 10:42:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Z/w9kgYt/51YvDE9IFQ3IGicgSo7/TAXs7dOJjM1K9XMFZ87iU6ldeeck4KrEUmKKfPMr X-Received: by 2002:a05:620a:3184:b0:763:bf6a:6948 with SMTP id bi4-20020a05620a318400b00763bf6a6948mr14520379qkb.33.1687628535534; Sat, 24 Jun 2023 10:42:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687628535; cv=none; d=google.com; s=arc-20160816; b=MLZSwCV1VkUyNS98vWfn/GHGHo1ACzkRhGbnP6aWn1Fdn9CC4+9N8EuLONC1n6Pz7Z IIlLYrP/yX/WUzDzVwoTG9NtrNCgpgblg2D4BD97E9irHuajscM645gqSPeI277gbmMx X35UUvt+oxa2SkTA/w7BjwuGr/nx+j3lGW890REzT8ZWNUxQwx+pnK8vB/kDXUAfwlMQ 00XAiSEJ/yVpYWtUJ3ldk/2Fvt7E3wQut8Th5jiGznM5dRbGo8O38xZS+RhhGAkdYcMR uJkKB7Puwg0pg9ZjnXSub7D9rPzIKgSL6Vjn6kkLJxBoFj2h9wMyIbgRN2njFcyDda4e zzsQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KWWds0uHrElgc22pSSxJ50tOp/lAV9kSI84s7Y2g/GM=; fh=dxlO8U8n9FJbkfu3NZ9xTJMkF/Fn5IQj359CkmYw0tg=; b=umHy8sdB4VAcdC5cEFHEDkJd6rcdimNUdn0bM44zYr+oGHpYz/ePcJU/rZ8x9Ux0E1 7O4Y2JjVm3WIAEMfKmh/hxHqEX80rTng7tfjbxjO3/jrNMfA7ErBO4v5/W04jqtlNLop GfcwtAdmuZroVtvbczIM5pd44t6ghSn86cHzjF4RFpd7BqJsvFFELlDKzAFElEvCgugp sTBTvwwPJ/hOfJg45Mg119c8MusZlgMKOmXnE6D0bhmj545FwLP9KLz8rLgUPw0XMJX+ SvN8Xz7xwxUcZcqA2T2y0Kn6E9fgOmQ/j7vj5T33KqhCNtMRZiM6UgS68GEe1r1TE+o7 g5ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JjwltddD; 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 s17-20020a05620a29d100b0075c974ce523si671658qkp.577.2023.06.24.10.42.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Jun 2023 10:42:15 -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=JjwltddD; 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-0005kg-GW; Sat, 24 Jun 2023 13:41:58 -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 1qD7Gn-0005k2-3w for qemu-devel@nongnu.org; Sat, 24 Jun 2023 13:41:57 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qD7Gl-00069b-Mc for qemu-devel@nongnu.org; Sat, 24 Jun 2023 13:41:56 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-30fcda210cfso2011700f8f.3 for ; Sat, 24 Jun 2023 10:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687628514; x=1690220514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KWWds0uHrElgc22pSSxJ50tOp/lAV9kSI84s7Y2g/GM=; b=JjwltddD/cnNRwVGBpMlwyJ7wVl1Dd+vLMYIA1ed2CA1z7xOvX3DxVnc8gtCpAefSE xo5g1CiCqTPXpIH4UJy5+rsZYpuKE81Z7be0dQTZ7JzdeX9j5u9Mx8Z5FVXetI2JfTyn 47UG4xbVI3FVQad68NuGZMbwNXEiWjQIy56FIAywQDCoHP3eiLzbyyHqhhjC+Qo5u3Cg 4ws7FQYnR+gqZpuWyo+1mj6A2Kgebxl4XbhZ5VUeZWE7itV80GK8EINXxv01Dffpjd6L xbEKH2Df7yWf84jA7YjCpGFhq4pv94jz889H0Vtin/e3lUxP++i7igvK6CJ6NiiQ/q9Z ZPCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687628514; x=1690220514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KWWds0uHrElgc22pSSxJ50tOp/lAV9kSI84s7Y2g/GM=; b=BRXeSGI2+MvD/ooUwi/tDFGb29H8odtxdHiDASIwd8TCX/yb/2R9Ic220icoqWZKj0 iX9ViSuQ6Yn1rGo2uHPkRqeTc3f0dPhqzzsPnBEU+XL5Z5/XJRQ5g6YxdDJH8KxsWxNM XoFKDTUwvEMCID8wmgzoZt5EArqIP0KW/MbyUzJkBcJo86BCVlBOL42Ys/WSG3qVZaNB wswuUzQg9S7r9FwSKHbsmuWtrFol+hBt2pFQY22j2a+Wf7ByS8vc3nG77VBXPQRjlBcS FYK2cW1EYIg8GPe7Xo1AF0x/zlRgvazqlYSciulQd/wsV5ypxo1VI459PkRT/c05dq1j h0nQ== X-Gm-Message-State: AC+VfDx1k0SdbIBDNzPBgwLoeX6lJHLpndCyyonNwZBynARneYzUkY8A RlsJn4DuPT/i2qAEXCMaGKgpo3MKlynKE+xZpds= X-Received: by 2002:a5d:5541:0:b0:311:abb:e377 with SMTP id g1-20020a5d5541000000b003110abbe377mr6323739wrw.39.1687628513811; Sat, 24 Jun 2023 10:41:53 -0700 (PDT) Received: from m1x-phil.lan ([176.187.217.150]) by smtp.gmail.com with ESMTPSA id i11-20020adfefcb000000b0030ae3a6be5bsm2589165wrp.78.2023.06.24.10.41.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 24 Jun 2023 10:41:53 -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 04/16] accel: Fix a leak on Windows HAX Date: Sat, 24 Jun 2023 19:41:09 +0200 Message-Id: <20230624174121.11508-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230624174121.11508-1-philmd@linaro.org> References: <20230624174121.11508-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 hThread is only used on the error path in hax_kick_vcpu_thread(). Fixes: b0cb0a66d6 ("Plumb the HAXM-based hardware acceleration support") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/i386/hax/hax-all.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c index 3e5992a63b..a2321a1eff 100644 --- a/target/i386/hax/hax-all.c +++ b/target/i386/hax/hax-all.c @@ -205,6 +205,9 @@ int hax_vcpu_destroy(CPUState *cpu) */ hax_close_fd(vcpu->fd); hax_global.vm->vcpus[vcpu->vcpu_id] = NULL; +#ifdef _WIN32 + CloseHandle(cpu->hThread); +#endif g_free(vcpu); return 0; }