From patchwork Mon Feb 26 17:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)\" via" X-Patchwork-Id: 10242871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A32F602A0 for ; Mon, 26 Feb 2018 17:21:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 908E62A1F8 for ; Mon, 26 Feb 2018 17:21:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83D7F2A1FB; Mon, 26 Feb 2018 17:21:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 19D042A1F8 for ; Mon, 26 Feb 2018 17:21:50 +0000 (UTC) Received: from localhost ([::1]:60498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqMTF-0004ZX-Be for patchwork-qemu-devel@patchwork.kernel.org; Mon, 26 Feb 2018 12:21:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqMLw-0007Li-5i for qemu-devel@nongnu.org; Mon, 26 Feb 2018 12:14:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqMLs-0004fV-EW for qemu-devel@nongnu.org; Mon, 26 Feb 2018 12:14:16 -0500 Received: from mail-sn1nam02on0111.outbound.protection.outlook.com ([104.47.36.111]:45325 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eqMLs-0004es-7o for qemu-devel@nongnu.org; Mon, 26 Feb 2018 12:14:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=p+uch34/nGnGOsD150UKkUzrFQZzF+coqc6GtN+O+W4=; b=DMwBzf5kYgC9UnlXxRK7DDStRaFoOHpRFsiTWsqyVvEZP1SnhcxiPOjlztulsc+gz27hpnYvIxdbl7rh/dAE28rkmFwTkkUP105chhNiqpt5PnnOfUxMmbVW7gNGD2HrEC5j9/ofOdaMsT7INXTV8017/9uJ2T/S/OyKhlAWJHY= Received: from DESKTOP-CS4P60I.corp.microsoft.com (2001:4898:80e8:9::75b) by CY4PR21MB0168.namprd21.prod.outlook.com (2603:10b6:903:b9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Mon, 26 Feb 2018 17:14:10 +0000 To: qemu-devel@nongnu.org Date: Mon, 26 Feb 2018 09:13:35 -0800 Message-Id: <1519665216-1078-8-git-send-email-juterry@microsoft.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519665216-1078-1-git-send-email-juterry@microsoft.com> References: <1519665216-1078-1-git-send-email-juterry@microsoft.com> MIME-Version: 1.0 X-Originating-IP: [2001:4898:80e8:9::75b] X-ClientProxiedBy: DM5PR1401CA0003.namprd14.prod.outlook.com (2603:10b6:4:4a::13) To CY4PR21MB0168.namprd21.prod.outlook.com (2603:10b6:903:b9::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f561f66a-3b2c-45e5-eb46-08d57d3c5a56 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7193020); SRVR:CY4PR21MB0168; X-Microsoft-Exchange-Diagnostics: 1; CY4PR21MB0168; 3:g4uYijfv6mHwVshjK4GSQMrLvKoSkq4EvpHWia2zA4vPBTIcHTIIamV1XaIj3w7/B7flSUOORLhGXcMk0D7OZM2RxTqbRpgVSapTgln0r6fF90nzn/pqmjAZWbt6WmwL9/hukwkKpAzpaYdUL/iySzcHytX22FFo1KiUuC2QYSD19JJhEw037b+9zr39qRvVKXXam4zHs08x7n8rq0y2I6x7HzPkig3hG/P7/ZYeog51zu59K0HQ6tcv7+VDc6eO; 25:DKi+jT5EfjBtbt0JOyKO+3lQLfh9Msqed3+mQuJljHfn5l+P7nmzkuqxrPxkgSrGG3XHK6UmfvYgQdLshZHIdvMaC/kId0S2GQEk6k+ACgQcLXGrjqucjOmBpbcxsv2yr8HjrglaeBQlklxADW6B1MQ+e/mx4lqJEdhrMlB0m4FPldCIXyZXoVMcZy4pNI2zjgTXuCCpUHjXZrPYBy5pa7OBmAP5NsgZWCKOBjL/sR9urkZlTk7XchYEAgLEx0fhsFkZvrvzWNnSI17rHv2w7DVXMXaWxgW3tFS+Hn1pXj13gLRZ89BMu0rIOzNpC0Dz8TeilwRGWowFc2MMCPs8ug==; 31:Q4nF18725LaB7qNK1wyRrr1D5HKz8TpXKZRvsXfXfAbg53HttwaynUqP7ltUKiHEoidPYAqvRd/XHZtkQoShlwVgsfaKDOkJxIqv6xqzbuxlDwTjbUZ4Z7FzqZoVXO2zqAZKyQzROT6+RRFKMHCmzyoNRb8nsQSTxI+0vdfxwOTAV3yrk6qd7IcTU0Dw1FclFYSULp3H5l5/C/vs4AEZiafCoJGeG92uHRBbe8bNfg4= X-MS-TrafficTypeDiagnostic: CY4PR21MB0168: X-Microsoft-Exchange-Diagnostics: 1; CY4PR21MB0168; 20:mzcy2U8J4D1ev+tTW0kDip4GLhzjw6gnjxFK433bc1sA77F6NL8uCL9JpXP3ZcSElaNuZnPS7iq5cv6ZZRYAJe8wQLx4Aoibx+8nmVMMII+g5aVLT6J31h2EmYGzYqGfsCK5lJz9sEc3ZuQwiWOO25EhwODOy7O/LtJpmnHk36nG/9KVdX0XKT7Hi1RSnaYlWbEPWpnD8HsYg8PDN/B7oHGdU+H16re/3OxVXrgvPxwIHjH3g6oV1pHP/y9SI5ddb7FOb8jWnV3Fbr+3LfQt9oglA2tcMPwfAZfV3o/FOZTZzuCa4fZayzHkqfbiULFaxVHGpNbinTxhFzJ0eX+XDvcUG+jsAsIXcNa/DMYfF1D1pTAEL4TB79cUoiV62m+/guyS/t6+AD8Pqh0Qp1y9A5P1SEwcU6IsCu1F75JINfja+XT//XWEPb6xRteq/dhfLHwRmhbLHuhKo0ecBlrRxUw4+roxfTXGzIYdzxH00PQPyTnjrZA1v/+BC/LSrhqv; 4:37xMsubCuMCC+UO83E7+y6NKUor3b9T76+z/+plp57co3sFROFUeMweh/hfytvXcNHRS8hbwe+D2mdC8XTrlasn1YyjNYUlTSS9oujYdqAUXNB9konLDx9+gUjG1ERByaoxq6ftpSLAylyGamwCheRay43RSfoesWHgz4uMktQp0m21+UvuESyMp+c629ojxjk43NTBcE/38h42o98WzYfbzJHJFEfuqcwAPzPmw78bnyA4Kylst+I/Tdh0m5andMKlQG8MiQgnEzWsFlE7zW4UXHhD6IBUeEL/tGqKrkqLGufjpPe/4NQ8mhrRbi3zW/33rA35w85KrvbNzWerquOibpD0HXbVIpxXZmh8EY+c= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(28532068793085)(89211679590171); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231220)(944501187)(52105095)(3002001)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:CY4PR21MB0168; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0168; X-Forefront-PRVS: 05954A7C45 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6029001)(376002)(396003)(39860400002)(366004)(346002)(39380400002)(189003)(199004)(5660300001)(36756003)(53936002)(10290500003)(7736002)(6116002)(105586002)(478600001)(6666003)(8936002)(8676002)(81166006)(47776003)(2950100002)(81156014)(50226002)(10090500001)(6916009)(106356001)(2906002)(52396003)(50466002)(51416003)(6486002)(48376002)(52116002)(7696005)(97736004)(76176011)(68736007)(86612001)(6346003)(107886003)(386003)(25786009)(86362001)(22452003)(2351001)(2361001)(316002)(305945005)(16526019)(59450400001)(4326008)(186003)(16586007)(145603002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0168; H:DESKTOP-CS4P60I.corp.microsoft.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=juterry@microsoft.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR21MB0168; 23:yQ0qyof06pjbEwm+DF/5qB2evPvGifvR+XqKL82N1?= =?us-ascii?Q?M38fikoOTQ52EPmWtYKVNKRUKZtpN2OJd23/Kl+0XUzRy0HKoMHZJzmZDJ5S?= =?us-ascii?Q?MdWJj93+CD2+AY2/8gkVOMGAF0kd0ndtGEjEU2iI82BlCfkL/WQutI8Bg+Me?= =?us-ascii?Q?HqcTyWamNGQcvZu0IgD95uGy4IYG2i46hDE5Kegj4F32z3wuYyG/aFQ/7kIT?= =?us-ascii?Q?WfGkpBOz/CWQ8NbTXMbMQ5EPAJYIepGV/Ovegh9dVS/eV9Cim9WMCKD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t9vhci2AuQtfeuoOXZ9JQWwcXB5lickdJqV5z5PRuvEGB8BTTbDt++YvjVD9SbFbrNBOItVI0CzxU0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2018 17:14:10.4874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f561f66a-3b2c-45e5-eb46-08d57d3c5a56 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0168 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.111 Subject: [Qemu-devel] [PATCH 7/8] 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: , X-Patchwork-Original-From: "Justin Terry \(VM\) via Qemu-devel" From: "Zhijian Li (Fujitsu)\" via" Reply-To: "Justin Terry \(VM\)" Cc: pbonzini@redhat.com, "Justin Terry \(VM\)" , ehabkost@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The use of WHvGetExitContextSize will break ABI compatibility if the platform changes the context size while a qemu compiled executable does not recompile. 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) --- 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 47a6935288..24387bebad 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; }; static const WHV_REGISTER_NAME whpx_register_names[] = { @@ -899,7 +898,7 @@ static int whpx_vcpu_run(CPUState *cpu) } hr = WHvRunVirtualProcessor(whpx->partition, cpu->cpu_index, - &vcpu->exit_ctx, whpx->exit_ctx_size); + &vcpu->exit_ctx, sizeof(vcpu->exit_ctx)); if (FAILED(hr)) { error_report("WHPX: Failed to exec a virtual processor," @@ -1042,8 +1041,7 @@ int whpx_init_vcpu(CPUState *cpu) } } - vcpu = g_malloc0(FIELD_OFFSET(struct whpx_vcpu, exit_ctx) + - whpx->exit_ctx_size); + vcpu = g_malloc0(sizeof(struct whpx_vcpu)); if (!vcpu) { error_report("WHPX: Failed to allocte VCPU context."); @@ -1300,9 +1298,6 @@ static int whpx_accel_init(MachineState *ms) goto error; } - whpx->exit_ctx_size = WHvGetRunExitContextSize(); - assert(whpx->exit_ctx_size); - whpx_memory_init(); cpu_interrupt_handler = whpx_handle_interrupt;