From nobody Sat Oct 25 09:08:52 2025 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 1520344226947932.1766444518215; Tue, 6 Mar 2018 05:50:26 -0800 (PST) Received: from localhost ([::1]:55887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCz4-0007oM-3r for importer@patchew.org; Tue, 06 Mar 2018 08:50:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVr-0005aD-6W for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVq-0006gw-6S for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:15 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:33672) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVo-0006ft-JB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:12 -0500 Received: by mail-wr0-x242.google.com with SMTP id v18so20261543wrv.0 for ; Tue, 06 Mar 2018 05:20:12 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:10 -0800 (PST) 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=0Mp4Sge0QMX+4aE/aXh1JQ5RmXxh4gw1rUr6pS87d5k=; b=Z67Obz7lFSqwhAnnBDueTgJRLFuc7zhgXWDvasJ8sTs1RHeIFWi9fO7KrZEUExSJxs 1B87JenCxTrncZ6wIPL8gfonpCEycoLqI345SNA/QEOSQaVROfrWZ2NA32MDSgeLHi09 55EJFiDs9+7sknOnNNSPf6yl3vM5DI1d7vtd2JdMVuTlBc6lSYaMxd4moulScRtxk+Hp s7DK+yhacsnMd2aVXh/odTJf+s3jVFqvYlbxYbjJSNcAaUuJJ6dp7pF5gVPE/VemFm4l mIYgwWj77Ji2BgSUEL+QtY7M/An54wINjmmgI5J1J271TeqNoVlsGdUo4axJwUvDTQEl ny8Q== 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=0Mp4Sge0QMX+4aE/aXh1JQ5RmXxh4gw1rUr6pS87d5k=; b=DQnn+QP0LqsKXTH94N/37/6SwO+8n/OQY5lcUX8ITJPj6F8z0+/ssT6RK/mOQEcZw7 FJNIM4pIX3xcFXQpuC84oMsQroaV4QUvYc4/sb7lmye1am5+lIsDLS0Y8Xa5VApEMLsn 0DnEbd98axfjCVo2E7KV6u36Yrwh6+IiygB/LRB3L9ynuVMpezWkKgBKHUieNwY9sTIL RT3/YYWOAY6WBopmN+wy09sevxaBZhUPmRnXfXycqjZaE4+eiKfok9o00lz/hn0tuMMI 3nXQGQgK/N/YO+gLF0d+qMxjDxY6doHbJ4ASd7Jh3/auRyU5ZWwkq3SNool3v4QhFnKK dSPA== X-Gm-Message-State: APf1xPDMfFZR/M5kWUv7j1bHpzN9khQEPZOGwA9Zd0HT1TnljPpYLog4 mc0s+rnRsKC6Lj68mNGINK+Qf/7P X-Google-Smtp-Source: AG47ELs+0TYTkUndPJXhx4xqnsNcW+XTz5pDmYd/uztpws50Nx6Z/BoxKIFlZ4PyUxXX+/f8DtAnnw== X-Received: by 10.223.151.204 with SMTP id t12mr17049835wrb.156.1520342411273; Tue, 06 Mar 2018 05:20:11 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:27 +0100 Message-Id: <1520342370-123606-32-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-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 31/34] WHXP Removes the use of WHvGetExitContextSize 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) via Qemu-devel" The use of WHvGetExitContextSize will break ABI compatibility if the platfo= rm changes the context size while a qemu compiled executable does not recompil= e. To avoid this we now use sizeof and let the platform determine which version of the struction was passed for ABI compatibility. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-8-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 47a6935..24387be 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -32,7 +32,6 @@ struct whpx_state { uint64_t mem_quota; WHV_PARTITION_HANDLE partition; - uint32_t exit_ctx_size; }; =20 static const WHV_REGISTER_NAME whpx_register_names[] =3D { @@ -899,7 +898,7 @@ static int whpx_vcpu_run(CPUState *cpu) } =20 hr =3D WHvRunVirtualProcessor(whpx->partition, cpu->cpu_index, - &vcpu->exit_ctx, whpx->exit_ctx_size); + &vcpu->exit_ctx, sizeof(vcpu->exit_ctx= )); =20 if (FAILED(hr)) { error_report("WHPX: Failed to exec a virtual processor," @@ -1042,8 +1041,7 @@ int whpx_init_vcpu(CPUState *cpu) } } =20 - vcpu =3D g_malloc0(FIELD_OFFSET(struct whpx_vcpu, exit_ctx) + - whpx->exit_ctx_size); + vcpu =3D g_malloc0(sizeof(struct whpx_vcpu)); =20 if (!vcpu) { error_report("WHPX: Failed to allocte VCPU context."); @@ -1300,9 +1298,6 @@ static int whpx_accel_init(MachineState *ms) goto error; } =20 - whpx->exit_ctx_size =3D WHvGetRunExitContextSize(); - assert(whpx->exit_ctx_size); - whpx_memory_init(); =20 cpu_interrupt_handler =3D whpx_handle_interrupt; --=20 1.8.3.1