From nobody Mon Feb 9 03:30:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522071544015619.5620609967483; Mon, 26 Mar 2018 06:39:04 -0700 (PDT) Received: from localhost ([::1]:56804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0SKw-0007mt-4R for importer@patchew.org; Mon, 26 Mar 2018 09:38:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0SIx-0006V5-CL for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0SIs-0006ru-Nk for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:55 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:36589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0SIs-0006rX-Ft for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:50 -0400 Received: by mail-wr0-x242.google.com with SMTP id d10so18956564wrf.3 for ; Mon, 26 Mar 2018 06:36:50 -0700 (PDT) Received: from 640k.lan (94-36-194-48.adsl-ull.clienti.tiscali.it. [94.36.194.48]) by smtp.gmail.com with ESMTPSA id g186sm6710105wmd.41.2018.03.26.06.36.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 06:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=3swAcFIlAUMChLIFP9bXEez25iDId2wjKpNdd+dyksE=; b=ne5Haylm2r9C+YpJPSpAg6x36OJukRDu0kq43JvkIqnwSlnsGjBMEfDTrWbCyVM+5z EmNN4tPncVNtGUc3Od/SPC+7hufaswL2oG3D89o3f+01GxdQmTnYRIq08rPdJvGljfSQ fapBjGCyw2hWvh5AH0zKXNR4wiqP/pakirplGmsZuflt1S03FyU9hnbZQn0t9NZKh5wd eT7I0iSPhj4zGCH+CsofUdyli4riLKDWeCioFzbNWKL9Nb4o1s402PZJe5WNdPSUsiRj 2OQPiuNyg/22PfdVj8HkOdWKrjEkvVkKcgafge1MmU4/onmKUQRsqrEQ2YD5GHMQG4Ll FPgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=3swAcFIlAUMChLIFP9bXEez25iDId2wjKpNdd+dyksE=; b=kkCLT6deKJS/TgReLCJtCZbcnrMzv5GHcraFuM6WO2CYrHgsuIzvXbEkO+hW0WhewJ 9kgmbAt/2fQRNktKep7Iunk7sKZoz2J4Cn3qD/3v6XIfxWBFZ8SV4mylAia95Cj1U9eG r/Uc7cxAixNl7Ih3LAZ5SzsNqkF/iuzY4cxmLkjS5mLJmBnUkWLtRehuHES2gwu//Luc DMfVbZo6umNG7eVistUXOBsX2pwK4akDpmmFpgClVW7QR2F3lj74shZa1SPZSAURbq0b LonW+RLBJY449vC+1nTkUkmr+mA2UrSqk43wFV4OKGWBM4hA3Epy1XqEDPATocdYIRRO Lv3w== X-Gm-Message-State: AElRT7EvdUHE89mvh2amneft1NbKzBd8P4jF+CMo3/gLusGnmPCHDePG E26EJz12pOJrB4obMRRD2IEEa3nf X-Google-Smtp-Source: AG47ELvNGxhYnEAa4wLfgzA5S5D/Zrh2pfcgXpuI9lX55a8/tCJy27KfvJOAYKadxEqMgcdeBqeKFA== X-Received: by 10.223.141.162 with SMTP id o31mr32236384wrb.167.1522071409017; Mon, 26 Mar 2018 06:36:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 26 Mar 2018 15:36:29 +0200 Message-Id: <1522071403-52486-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1522071403-52486-1-git-send-email-pbonzini@redhat.com> References: <1522071403-52486-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 02/16] WHPX fix WHvGetCapability out WrittenSizeInBytes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM)" This fixes a breaking change to WHvGetCapability to include the 'out' WrittenSizeInBytes introduced in Windows Insider SDK 17110. This specifies on return the safe length to read into the WHV_CAPABILITY structure passed to the call. Signed-off-by: Justin Terry (VM) Message-Id: <1521039163-138-2-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini --- configure | 4 +++- target/i386/whpx-all.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8376cb1..4d0e92c 100755 --- a/configure +++ b/configure @@ -2496,7 +2496,9 @@ if test "$whpx" !=3D "no" ; then #include int main(void) { WHV_CAPABILITY whpx_cap; - WHvGetCapability(WHvCapabilityCodeFeatures, &whpx_cap, sizeof(whpx_cap= )); + UINT32 writtenSize; + WHvGetCapability(WHvCapabilityCodeFeatures, &whpx_cap, sizeof(whpx_cap= ), + &writtenSize); return 0; } EOF diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 940bbe5..2080d58 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -1254,6 +1254,7 @@ static int whpx_accel_init(MachineState *ms) int ret; HRESULT hr; WHV_CAPABILITY whpx_cap; + UINT32 whpx_cap_size; WHV_PARTITION_PROPERTY prop; =20 whpx =3D &whpx_global; @@ -1262,7 +1263,7 @@ static int whpx_accel_init(MachineState *ms) whpx->mem_quota =3D ms->ram_size; =20 hr =3D WHvGetCapability(WHvCapabilityCodeHypervisorPresent, &whpx_cap, - sizeof(whpx_cap)); + sizeof(whpx_cap), &whpx_cap_size); if (FAILED(hr) || !whpx_cap.HypervisorPresent) { error_report("WHPX: No accelerator found, hr=3D%08lx", hr); ret =3D -ENOSPC; --=20 1.8.3.1