From patchwork Wed Jun 21 16:24:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9802239 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 93968600C5 for ; Wed, 21 Jun 2017 16:28:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 836512862B for ; Wed, 21 Jun 2017 16:28:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7759128632; Wed, 21 Jun 2017 16:28: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 DAABF2862B for ; Wed, 21 Jun 2017 16:28:49 +0000 (UTC) Received: from localhost ([::1]:55044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiUq-0000ZU-Sm for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Jun 2017 12:28:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiRL-0006Nj-JJ for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNiRI-0004OD-Ti for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:25:11 -0400 Received: from mail-eopbgr30125.outbound.protection.outlook.com ([40.107.3.125]:54342 helo=EUR03-AM5-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 1dNiRI-0004Lx-Ha for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:25:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VZgMZhWdrbTo4qSg+HIp23u/x9BYHNomyEJOgkFfHqI=; b=hwIg/TPZpwo7EiTE3CYo9ZZbOx3TOP02hZtYo6GeaVS8A/v2rbuWvW6r9cGYhidiqfJ+k043W7ZFFBBgfLTyO04JHALpOzm7962lDVLMYS9TKONvqZuYh8USVh0kMlM1lQosj+3ubozREzyJ2h5+NRDDKEKHSTa1ht90R6eCZZw= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from rkaganb.sw.ru (195.214.232.6) by HE1PR08MB0842.eurprd08.prod.outlook.com (2a01:111:e400:59b2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Wed, 21 Jun 2017 16:25:01 +0000 From: Roman Kagan To: qemu-devel@nongnu.org, Paolo Bonzini , Eduardo Habkost Date: Wed, 21 Jun 2017 19:24:04 +0300 Message-Id: <20170621162424.10462-4-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170621162424.10462-1-rkagan@virtuozzo.com> References: <20170621162424.10462-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2P15301CA0022.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::32) To HE1PR08MB0842.eurprd08.prod.outlook.com (2a01:111:e400:59b2::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1dc3ed72-6c2a-4aaf-0206-08d4b8c213cf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:HE1PR08MB0842; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 3:oupiq915niE2HN6KCK6wp51jA/ywa9NTrTWJe3NkM9Z1quragQ/rR+ELA7QIqIPhPNbcbOOAVC4tJqNwTjDpVH1Nkzlc3+pg+miu0SRD8I4VHnkisjGyMFaKSdoW1ZgqPpv1GL0+5ukxQcvpcxw7rE0aFzvcLBoF/x8O2VjIgX+beM2S8hFyW/v0XpTbmgNPyGDQ1YUzMGSyOlAHq+FIgYWYMCfG/F6SqAY/s6tSqevoTzPbIWuKijrwC65ikRzzabfZlNIIFjuFOnjXAj9TK4qKnCgJ6Ykm56KgGAtEeDqylOYyqOwDcTBOi/iRo3guKJLcj4164UcWxwqeyaCNtA==; 25:pAkAf+2ujaK2lHdmPjHNBawIZGveItGz0u1XDO/DmxYyUQ3t7dCukwLwSZwPzzxT92Ocz9otKbk0QDfE1Ftws60veEP+hDWx6STsyN5EogK67kfZRF5PfR0ad0p0Rr20VT/aQpVaGZ/CGSdlalpsCeDLoCr0F73CTyOoZ/D1WtCfDaoRIkrdoH9zP8iSTKca/x1I6k7/bYxJd+peZHD8aGRe6MvR6crVcuNLmw+o9j/Kv9GGxOC/SRDfb6mouCAM4t7q9ykUHmMZYac+IwE0/6U55BGbkT9c1Vwr9sFSllBEVBfhCSW3uTJ5+EN9J3H0uCH3ALf1y2/u28TDhDQB08+tTvtrU3RNRkytkoxKuESNwhuQ+QDaE71tyu/5K0rjMmBOUMPnbaMiYKY2BHu/hhuYF3XuwFqIDNFJRvRbazArmN61qBihd22Dm1wQlldK4enJabbUT4FA98kisvgh5OdQ6I67Gr7uy2322jUHqwo= X-MS-TrafficTypeDiagnostic: HE1PR08MB0842: X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 31:3rtLLYrOapv5ZGvjPxfQBBUqwN5CHqMvN88O6VaEdBW6nzc5KLJX8laqcFnDMTvWDIUfTG8w01dDwwm+fo0VjVpJLtI1XMWDwB6PfdYN90xOdrjIt0+X/TNEIxlw5Do1VUfiwGNxBU+TwuOBjTPdmOM5pMvPj58L+n5n7aPBlXpk07GKdREx4pe6r+hx+Gijuo1hXAleu8LVc4afoM26F2M6+NcRM5sdoxFgeo2jZE8=; 20:PExhFqg2StGe6lDhH4VjeQ8JcgPQo7gxVc8bGYKDoeX4/xPGqAACyKzXLYnMX6pUkdGW8f31aEbDT8fdNGte90yUvzPzgeYR+HYbrDYmH3zYaut+DvQ01nYIpfPqyysnxTU30epthfAvs2/TVt5gk8HAyBnBJ40qfE7UnBRzKRwDoimr897Z7Ed1v7PakrGXRmUncR1y0txru5xr3irlNIbZFQoKpSjFJvfr4m0qtwjUMBNQBLBPCGzLYyW6ex+VQUKpqDPIyXVHBre9BncmxYSHfEA+c2LPkqLd+zsqYkC6fIbtGqESrM8OhtgPWRldl3tHFGVSF2ehWt5tKBx4MUW4HKMxyUy0jq/oLE2+CavvGxwfWw1PGMxL+iX9+Su9G0Ei7kLVCvTLwkFWiHhFOIK2cYBAGln6oiyb2Qu7+zo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR08MB0842; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR08MB0842; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0842; 4:5bLLchUA4OFDDeQP74+u3LbDD7gGuLpMSuOCe2M8az?= =?us-ascii?Q?u+dygxOXLDnXsX0nXw65c9QYk49eajzVT4b9iqBmQhiQgEaDzs5HXYktBciB?= =?us-ascii?Q?mYagJ4P31B3RZaxmgCZgplrrb24kd5IxY8ftO2TO2rNVnswJyUoqabE+GcDF?= =?us-ascii?Q?+Mnd2g32M6ukrV0VUzlQlZNbhZMtrUjDZ9TDa+xpZ7eyK2HWFePeLVaEdT+A?= =?us-ascii?Q?wTZKCqFDPVcvHJvqFsUyUKYz/RtjgD/cvzYNai56b8Lk6+ARrW3+5y/lG0ed?= =?us-ascii?Q?xRZaqWv55mpgf97kt68sg3mMMfr1V13RzCo2e1q0MoiC+LtxWLk6yAAYwval?= =?us-ascii?Q?dtVyZMqzbqN1JMnfTEo6TwloKtgTfIOJ8jlLgnguxFX7HOB9qi3w1A75oDx5?= =?us-ascii?Q?wA5Wt9ojr2V/to5equWmbb/eNg5JsP4Oo5i3/q6XnqtaVk18Oq+GEMlMEWd9?= =?us-ascii?Q?E7Y6toTGTnl3XSbVQMAdc3vfr9N/2ReVIWymtmFsrAsw0q1bPPHJ2XE6hEx4?= =?us-ascii?Q?wBO3hVCa4XA1tHfb9EjYl9SjQ0rtRBQ0N8jgeE1p3xyU4fwBE3++fuLy43+w?= =?us-ascii?Q?vS5MqE4CUfFZadE1DTj8GNcLL/7jubmOYkTU5axL/qXPzZx05TDZrNcXnB7o?= =?us-ascii?Q?2btHak9sWeh7pJu55/JnF644KVyHtsKBcFmoOstsccQ3w78XaW/HmjGOsMsZ?= =?us-ascii?Q?mQIIJiE2ZyRfTzlNINBLQMLDnYdUzR+cpc0tGKR8NXbUcbVHODzoMPyKajXT?= =?us-ascii?Q?pgSuSO1zDjgg17c98wYKoFDUz9nlvLiq4UkhhkTh+2aLJj5KqqtAfkyZp7cL?= =?us-ascii?Q?MeIWCv0FoQXlphGW1cGq2oHB8Skm8pVLIPW8Y57+X5WU5Rkd2hm3AYo4vLVm?= =?us-ascii?Q?2p1MX+L6czshQb2Yl/nwod5N/1NTAHdtBBc+ni4dCnlIvjIF2HtB/DJQtx7d?= =?us-ascii?Q?j9YopAPuqQ6BlZoZGaSKOUN/nUZVa5YE/zNLCs4HGQEpkH4tFxqg4EmTvyXx?= =?us-ascii?Q?OO6fww5mQChQLj5d6i98yh8it7U23XNrqE3LMPytwrtyxGCiqdwFEQxz4XwY?= =?us-ascii?Q?rdjGGUgYWaWwgUImcYlrsoLlK75w1Cryv4UibkEMg2g8vMO+ktdPU5BXVILF?= =?us-ascii?Q?ENW0D587F1Q+dvt9BmWdIlEmyXLHwq?= X-Forefront-PRVS: 0345CFD558 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39410400002)(39400400002)(4326008)(2950100002)(6512007)(6506006)(5003940100001)(42186005)(53416004)(54906002)(50466002)(86362001)(38730400002)(33646002)(478600001)(50986999)(76176999)(66066001)(53936002)(81166006)(7736002)(6486002)(189998001)(8676002)(50226002)(305945005)(36756003)(25786009)(5660300001)(1076002)(3846002)(6116002)(47776003)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR08MB0842; H:rkaganb.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0842; 23:jtOFjV3de/hEAUwAO2Wef4MPz5b484kgmmNXPZbjf?= =?us-ascii?Q?wOiSU4mfA4/3UgjMyW/8HQLdFPs1oT2VnQjH5vZ7oKYdG1nP+1810KsaPxG1?= =?us-ascii?Q?aZJLjiRxhm8wuGSsJMCq1JgDElOtPV/ogpzkgFbOAOG2uloGuW70cNTnG1kU?= =?us-ascii?Q?B7YPtSkXMDv0u2yRatYzoZg5se8/HLmNlhDZDJ9m0eezn4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2qF9S/Ww+vHG7wRUE0qUbwR4S2+SE?= =?us-ascii?Q?W4b6E85us9FQqKIC7QdFxbhDY7jmo4zGgnWLwhN3uLIw16ubMbnVHq8eE1wc?= =?us-ascii?Q?Y=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 5:Xa06R64KFVdo2Mq/aIp7zagaHSo9vzIb0iobuU4YvLoU1kt/BkV4pbfRm95e4UF3eLyzPs56DBYVLzBYfPxETCX7tHeWC2ISXRSD/egQk61AU96swM1x0DC3vailbtEDeAN7khKdtX14VZvBckgGWnHNwz39cno80QFmvQ2pd0A94kadcDHqBa5ljBfrff3aAUNBOJD+JSIy/vZCHNZr8yQkM+HGyg/sDpHZWGQy5nqyHL5+dSgxvuXZTJ/XoNhcyhMVKKOAK4rZh/+O90G07HvtowRpdq0ZPjWi1KEAIwaUQR79Y24HaH3TOZDRpM2SkHltoeSoD+1NEBqa2ONf2SXgW7Y7n5fi/sKKa3Qn9J732Xyw21X+nDpPOFYWoysW4c8ukFycSLGQUAdSDxg0SA9NnX85gp7JdAdorK7yft9rn3ef48r+tpH6kKWMxtBHd65OOJZp06+ykcnhkMHtudYAcvASPy/bEHC2kcckS1OuUo2DVPYIEXdoxxuiWL0n; 24:2eh/DSKU3C5HschYtBH1jPhM3euGucW+iW3fBbGeL8BPWx6eTDvDjpjh5yb7EM/2lJPV256XRTBKLf9e139MMIzzgf/WgNEGYbenTmjc+tg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 7:A5gpSDo5xWv7ShUxHlTq71yS0OwgYF0zODqRN1j5EPROksZ0pfSsLmtdG8jDDx/GBMLnUlHUKL43urX82TL8ojJ85kK6rwHP49JzAaPIAlv83fRMfWBXc4Ys/AUKjooo2LIWdcylm2LnjGhxyjpNON1eHApBHk+Q0h/1wzDDQrB6f+pwILjouL5wlnjdu0/6qjpvGwW/fgccxugbVzDcAm9fqVsXKLLBuBcNpOSOyAWJayAd79Z+rjvnZKJKGmnBEHcG7582JtGt4g2WMBcq4SGNNS5pf7+Zz7cHKLnPclHKHxMZyyZyg26vq8hn0p3ovH2y1gduc0TTuaRh7R+jcd8pQOqgBTxixuB8jlRGXDDGlrzOMDX+bYtvdUf5VkjLXUrPgq2T7MbE4/oNR7ed/GGTGq6k1R1i0HEYUmHw8V2fXGb2bNA5qjXJvBqEPjnq9G4mLLkhUjr1HAXG5YCSMdY6U/QDSPJZHUr1+xuDGaDOcCOqzEnxltDZhrMdpFBCDi7alVqQrg0Kkimc9OU5vzk1GzEU70kCS8Aq+i2uGnTuLyU/AzGX8W4fBJWtCTBBAet9Fn75Y6wVS2nCB1cQMoO+Z5kB3tC8mrI9kRIfr10TirVPz0aVHbhg7BFdMmYv3dAc8W/N2yDQ8D+3KMoJe/RROjiYZyBU3E1GdPGAyFMM4N7r8wycj/boCustzzpBoMMQ5py27COgegxpXWx1qn+9qyaAHeEbMZTVfNvjJ8M8mgFD4E+tKG0ssf7Qq4Zp0/CiDWFzZoElnlRcisuBnpAWjlPp91A1eFHG5a7RlGI= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 20:CJq0PWepeM3ehvUnoo9JCx1YYKEZGua5mjqHuDveFpBICnh29KPAFSnPoHmBshb/y33v4Czg6Y/duwyRTZ16ol9Jyo4oJfooZ/tvI1MMAE+4Hs5QXvCKfmvXP+nfR89t3I9siWmMfPI32aO+R0sWvJDnz6E6ckh5hjo+wjdAlU4= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2017 16:25:01.7361 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0842 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.3.125 Subject: [Qemu-devel] [PATCH v2 03/23] hyperv: set partition-wide MSRs only on first vcpu 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: "Denis V . Lunev" , Evgeny Yakovlev , Igor Mammedov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Evgeny Yakovlev Hyper-V has a notion of partition-wide MSRs. Those MSRs are read and written as usual on each VCPU, however the hypervisor maintains a single global value for all VCPUs. Thus writing such an MSR from any single VCPU affects the global value that is read by all other VCPUs. This leads to an issue during VCPU hotplug: the zero-initialzied values of those MSRs get synced into KVM and override the global values as has already been set by the guest. This change makes the partition-wide MSRs only be synchronized on the first vcpu. Signed-off-by: Evgeny Yakovlev Signed-off-by: Roman Kagan --- target/i386/cpu.h | 5 ++++- target/i386/kvm.c | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 464ed1e..ad8600d 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1089,10 +1089,13 @@ typedef struct CPUX86State { uint64_t async_pf_en_msr; uint64_t pv_eoi_en_msr; + /* Partition-wide HV MSRs, will be updated only on the first vcpu */ uint64_t msr_hv_hypercall; uint64_t msr_hv_guest_os_id; - uint64_t msr_hv_vapic; uint64_t msr_hv_tsc; + + /* Per-VCPU HV MSRs */ + uint64_t msr_hv_vapic; uint64_t msr_hv_crash_params[HV_CRASH_PARAMS]; uint64_t msr_hv_runtime; uint64_t msr_hv_synic_control; diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 1c619dc..183a85b 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1718,19 +1718,23 @@ static int kvm_put_msrs(X86CPU *cpu, int level) kvm_msr_entry_add(cpu, MSR_CORE_PERF_GLOBAL_CTRL, env->msr_global_ctrl); } - if (has_msr_hv_hypercall) { - kvm_msr_entry_add(cpu, HV_X64_MSR_GUEST_OS_ID, - env->msr_hv_guest_os_id); - kvm_msr_entry_add(cpu, HV_X64_MSR_HYPERCALL, - env->msr_hv_hypercall); + /* Sync partition-wide MSRs only on first VCPU to avoid races */ + if (current_cpu == first_cpu) { + if (has_msr_hv_hypercall) { + kvm_msr_entry_add(cpu, HV_X64_MSR_GUEST_OS_ID, + env->msr_hv_guest_os_id); + kvm_msr_entry_add(cpu, HV_X64_MSR_HYPERCALL, + env->msr_hv_hypercall); + } + if (cpu->hyperv_time) { + kvm_msr_entry_add(cpu, HV_X64_MSR_REFERENCE_TSC, + env->msr_hv_tsc); + } } if (cpu->hyperv_vapic) { kvm_msr_entry_add(cpu, HV_X64_MSR_APIC_ASSIST_PAGE, env->msr_hv_vapic); } - if (cpu->hyperv_time) { - kvm_msr_entry_add(cpu, HV_X64_MSR_REFERENCE_TSC, env->msr_hv_tsc); - } if (has_msr_hv_crash) { int j;