From patchwork Fri Sep 21 08:22:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8479014BD for ; Fri, 21 Sep 2018 09:05:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 720A129CAF for ; Fri, 21 Sep 2018 09:05:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62A0F2DBE4; Fri, 21 Sep 2018 09:05:49 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 EE4A829CAF for ; Fri, 21 Sep 2018 09:05:43 +0000 (UTC) Received: from localhost ([::1]:54658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3HNf-0007HT-6E for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 05:05:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gi0-0006kn-8q for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:22:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3Ghx-00024m-1D for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:22:40 -0400 Received: from mail-eopbgr70098.outbound.protection.outlook.com ([40.107.7.98]:35648 helo=EUR04-HE1-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 1g3Ghw-0001yN-Kl for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:22:36 -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:X-MS-Exchange-SenderADCheck; bh=L4lqpj6ihCv/Nzylmh1kczaggMGe7R/yuTUxwM2k0po=; b=djuBxO0G1uRLu3ksvfiXdgpQQ9DZFa2K4yD9TrBXKo7PmqoH6R2HFwddviRpMW+Z+DXm4Nf3M03D6HzHW0Lg14mydshJhDfv5pLodYoTy/lpzVWgbsyLgIe8lBYS457qWL4N/r4qCZ8+KpIzfjobG51hqhu3Cb4DWf1EfAWiq6U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3588.eurprd08.prod.outlook.com (2603:10a6:208:e1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:22:33 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:22:10 +0300 Message-Id: <20180921082217.29481-4-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921082217.29481-1-rkagan@virtuozzo.com> References: <20180921082217.29481-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0003.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::13) To AM0PR08MB3588.eurprd08.prod.outlook.com (2603:10a6:208:e1::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25bed2db-bde1-421b-4319-08d61f9b61e8 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3588; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3588; 3:h4iIW3yxoilCiT0BjvLogo8gvwo2vzIAa2j4qYr1n4W3Rj7NXvvagQeVFmytDdICTZm9YLR6YIT9XdvbtIEc1/VMi0IF3pLOghdIZzz4HLMIZs8Nl9NvKd+rTkTmGLw7a5MOidWrcWWTtymQ5HBV9JOItsiI4rirS1VXzFNQoOPw+dikGHKHeI3homMA4dandcJuFT2lNGk/TKgNUpo/QticbHrZu9FPpHTkLRVESWgAZJ7CUS0vEGsDpumH3tBN; 25:gYSsC1t9VpaucJo/6fBy4rKvr/VJgrpzogGWMsFzZ+aSYHFDevokAexA/Y4TizwZTIla1n4fZXm/frhBH6aVOdnvS3csuWCr8aY1r6KWfacKY36HbS0s0E9nWyFdMAArb3Bd7CZIfKDcWZVTv94zcrgFha9NgtFW2Rh+rhdhXpvPfMCjw1L/XC0dq052jw+akhkYMgpQbJ7azk/xmoC7VeEL4nUYXXK9d3mDLXtKH+VFw5BUNN3j52LlvMWsEHIUoRuUrhh+IwKYPvvmYfg/7DGhQXb6JpJCGRPWgQQ/c5LHT+dO1VRinXCv4GryqPyMJ6UCBt2nlAq20lobLW2e7g==; 31:Q1bAxZMMMQcci1FhqGnwoYLaZ+7XcUG1Oo16cESLsF1n1Ku008z8K5+BOqyGNtvWeBMzvKbN1HKz+jWpDWjNNGmfiVzdzB2Vi5GhIVMzoxhLCFq341UoFGxbVm1DxxzgV+VITtrMuf0XzbMB4MgBhEYXqfMvBnGJZYByPF2re+98pSj9z1sLBmDZmeIV+m268AmC5W8bHokEW47r/ICtSW9Pi6xKYR0qz19BQ08NOKY= X-MS-TrafficTypeDiagnostic: AM0PR08MB3588: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3588; 20:Pz8c1+ZWQ4MwUTUZMgmgmGSHuKclwDve4C0YHMbejB0RH9IGZjtTTBClEcVRZVYZPFggIGSZocbtaGTo1Cu/3dNl+KdMyqwJi5GyOCvrUW+5GoK8OzVwgbkGDXidgD9EaeqzCZtA/iHAigQcV+Jl4kri3eNGAjYlmYpS46bpWWEVwmsyMo9gnAI4h5DeiglNZUt3NIH1HRxcTtPtE+PodAUMLlqOSUwwp3dLBWx0L1v390XzIY787ov4Ud1jUBgLzj7CllqZn/lU9zn/72ZkRTrvWOH6ZjID6D5UqQAjhS3FMv+FqfTiPQnH2LRdVl9w1rVOsMdOp+u16KE0xyRWcbanp91vzFnAfFC0IWSDx6p5zvHMepQSFFQu+VvVq/DPTYwP0SpjEOv0OWYrhybxFsxq8ALwUy9UI+pzmEZDJhA63+lKP6UOP+NxlKJEBxQEq2fFmMke/67VCff28YmrL+mtK9UbQBsFklkYLROenYTNxUS0jtChT1SZhgW2pk2b; 4:Dl6HItRhk+bdYUyXkW5jOb2wQ4hqqxQEE7OsSsoeEOvvHk+9YxWfmtF9/ToMHqZEVTCGBWwmxepfTZd3hheABG2Ij+4/JP13MvRURfOZjbXLbj1d7atsuDVQfgmMrBG/vouZmSY6QUod4oHiMb4ANrInWadN2M+FWNqqE1y86cvcLMY4j/llv1ohUR8yMRhN+NG122+2ZTlfAy5gJz0qCyB+CYxVGSvFMbrrHnvvyVWPBuZUe7WQ4PEHyZoggAP1c006UJleWFPhlSgMJmIC5A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051); SRVR:AM0PR08MB3588; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3588; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(136003)(396003)(39850400004)(366004)(376002)(189003)(199004)(6916009)(16526019)(5660300001)(36756003)(3846002)(54906003)(48376002)(6506007)(476003)(486006)(52116002)(446003)(1076002)(76176011)(386003)(51416003)(186003)(6116002)(16586007)(2906002)(66066001)(6512007)(7416002)(50226002)(53936002)(25786009)(106356001)(53416004)(81166006)(47776003)(316002)(956004)(11346002)(2616005)(7736002)(8936002)(305945005)(8676002)(2351001)(105586002)(97736004)(4326008)(86362001)(6666003)(68736007)(478600001)(6486002)(2361001)(50466002)(26005)(69596002)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3588; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3588; 23:IRKaraEUSrmzarih52o6gDbqteaO9N1+pUxFi6/qs?= F87bCGhWmS0XeB1D+aYaEaLIQacz6Wa5BSwr4ZnF1NEUGdd5P8s7u9FRX8Gdz2xbsmLJ68MVHnvsmlXacAHP2ZJ8bG5H3r36n/YGLWucCwOazfWNiAah4FQgVCgepA4hGEI82yy7yIHJnRWpHFpFbV2xgNhIlNSmdCQoxJ0T7Fo48+VHIcxtx23fDLbjoAO/Opnx8FsE8NyXHHff3VYmBP+M4AShsYXm/0J1fyQvuFNvk8XGzd80nngvcyowaIBuHT7BIktiMDQ8mRjQZGbw3mZC4XDioDaUomfWRi1WWpEAjqUp3R0l7I44zOKxmXBYZ8ZnfUDuSXLVzJzrlCE19rG4/M0n4PIlhRlGZdG0Pl9gIxifruP5hd56oSjh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fdwP7mWG8JawlvO9qiawhgjYByTJBgzOxOZ8ajx9SjMLY3LwoLUKmoOn3mzEp7tHvLto7cG8Y SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3588; 20:Zk/+D7A6W/I7/KwbHE2WN3Fcjx099FK8U/UNGcxZbOJSurtWoWh302+s2SbHFeQbKmfNsVWKMtZucyPtCgzsPpobJ6uEWzetCwxn2xoTMIPpmdJlYIfyntIik79kv4IpMsq+R+Nl/SNnB3a7v5o1IKRZDEOzFL4CGiYMoz2diUA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:22:33.1261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25bed2db-bde1-421b-4319-08d61f9b61e8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3588 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.7.98 Subject: [Qemu-devel] [PATCH 03/10] hyperv: only add SynIC in compatible configurations 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Certain configurations do not allow SynIC to be used in QEMU. In particular, - when hyperv_vpindex is off, SINT routes can't be used as they refer to the destination vCPU by vp_index - older KVM (which doesn't expose KVM_CAP_HYPERV_SYNIC2) zeroes out SynIC message and event pages on every msr load, breaking migration OTOH in-KVM users of SynIC -- SynIC timers -- do work in those configurations, and we shouldn't stop the guest from using them. To cover both scenarios, introduce an X86CPU property that makes CPU init code to skip creation of the SynIC object (and thus disables any SynIC use in QEMU) but keeps the KVM part of the SynIC working. The property is clear by default but is set via compat logic for older machine types. As a result, when hv_synic and a modern machine type are specified, QEMU will refuse to run unless vp_index is on and the kernel is recent enough. OTOH with an older machine type QEMU will run fine with hv_synic=on against an older kernel and/or without vp_index enabled but will disallow the in-QEMU uses of SynIC (in e.g. VMBus). Signed-off-by: Roman Kagan Reported-by: Vitaly Kuznetsov --- include/hw/i386/pc.h | 8 ++++++++ target/i386/cpu.h | 1 + target/i386/cpu.c | 2 ++ target/i386/kvm.c | 30 ++++++++++++++++++++++-------- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 6894f37df1..dfe6746692 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -294,6 +294,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); int e820_get_num_entries(void); bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); +#define PC_COMPAT_3_0 \ + HW_COMPAT_3_0 \ + {\ + .driver = TYPE_X86_CPU,\ + .property = "x-hv-synic-kvm-only",\ + .value = "on",\ + } + #define PC_COMPAT_2_12 \ HW_COMPAT_2_12 \ {\ diff --git a/target/i386/cpu.h b/target/i386/cpu.h index b572a8e4aa..e2e87dc13f 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1376,6 +1376,7 @@ struct X86CPU { bool hyperv_vpindex; bool hyperv_runtime; bool hyperv_synic; + bool hyperv_synic_kvm_only; bool hyperv_stimer; bool hyperv_frequencies; bool hyperv_reenlightenment; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f24295e6e4..9c29c5db81 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5575,6 +5575,8 @@ static Property x86_cpu_properties[] = { * to the specific Windows version being used." */ DEFINE_PROP_INT32("x-hv-max-vps", X86CPU, hv_max_vps, -1), + DEFINE_PROP_BOOL("x-hv-synic-kvm-only", X86CPU, hyperv_synic_kvm_only, + false), DEFINE_PROP_END_OF_LIST() }; diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 47427d98f8..056a482d3a 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -733,8 +733,18 @@ static int hyperv_handle_properties(CPUState *cs) env->features[FEAT_HYPERV_EAX] |= HV_VP_RUNTIME_AVAILABLE; } if (cpu->hyperv_synic) { - if (!has_msr_hv_synic || - !kvm_check_extension(cs->kvm_state, KVM_CAP_HYPERV_SYNIC)) { + unsigned int cap = KVM_CAP_HYPERV_SYNIC; + if (!cpu->hyperv_synic_kvm_only) { + if (!cpu->hyperv_vpindex) { + fprintf(stderr, "Hyper-V SynIC " + "(requested by 'hv-synic' cpu flag) " + "requires Hyper-V VP_INDEX ('hv-vpindex')\n"); + return -ENOSYS; + } + cap = KVM_CAP_HYPERV_SYNIC2; + } + + if (!has_msr_hv_synic || !kvm_check_extension(cs->kvm_state, cap)) { fprintf(stderr, "Hyper-V SynIC (requested by 'hv-synic' cpu flag) " "is not supported by kernel\n"); return -ENOSYS; @@ -783,18 +793,22 @@ static int hyperv_init_vcpu(X86CPU *cpu) } if (cpu->hyperv_synic) { - ret = kvm_vcpu_enable_cap(cs, KVM_CAP_HYPERV_SYNIC, 0); + uint32_t synic_cap = cpu->hyperv_synic_kvm_only ? + KVM_CAP_HYPERV_SYNIC : KVM_CAP_HYPERV_SYNIC2; + ret = kvm_vcpu_enable_cap(cs, synic_cap, 0); if (ret < 0) { error_report("failed to turn on HyperV SynIC in KVM: %s", strerror(-ret)); return ret; } - ret = hyperv_x86_synic_add(cpu); - if (ret < 0) { - error_report("failed to create HyperV SynIC: %s", - strerror(-ret)); - return ret; + if (!cpu->hyperv_synic_kvm_only) { + ret = hyperv_x86_synic_add(cpu); + if (ret < 0) { + error_report("failed to create HyperV SynIC: %s", + strerror(-ret)); + return ret; + } } }