Message ID | 20161202084754.22860-5-rkagan@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kvm-owner@kernel.org> 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 EF28D6074E for <patchwork-kvm@patchwork.kernel.org>; Fri, 2 Dec 2016 08:48:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E87B728537 for <patchwork-kvm@patchwork.kernel.org>; Fri, 2 Dec 2016 08:48:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD14A2853B; Fri, 2 Dec 2016 08:48:26 +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=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A48928537 for <patchwork-kvm@patchwork.kernel.org>; Fri, 2 Dec 2016 08:48:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932836AbcLBIsW (ORCPT <rfc822;patchwork-kvm@patchwork.kernel.org>); Fri, 2 Dec 2016 03:48:22 -0500 Received: from mail-db5eur01on0119.outbound.protection.outlook.com ([104.47.2.119]:32352 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932795AbcLBIsU (ORCPT <rfc822;kvm@vger.kernel.org>); Fri, 2 Dec 2016 03:48:20 -0500 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=nVYeug4eU20L0aQa7Brhn5yrI6IygisxfmXz3NcsILk=; b=f5a7QSU4v4TDgE647e05Q9AdsZ5ZhmqvSN21T4cukBEEcjPvHUJ4zNo40eiZc3Xw5fyjI5bqVPofOUUwlhqoJccMR089fhXlTyNaT+FnXa0lVh9btUwdV0NMDwfT+CTANSguG3+YaHz0fOMIQphNWHRbWgwsbs8xGNA8/WliLIQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (195.214.232.10) by VI1PR0802MB2478.eurprd08.prod.outlook.com (10.175.26.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Fri, 2 Dec 2016 08:48:13 +0000 From: Roman Kagan <rkagan@virtuozzo.com> To: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= <rkrcmar@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, <kvm@vger.kernel.org> CC: Denis Lunev <den@virtuozzo.com>, Roman Kagan <rkagan@virtuozzo.com> Subject: [PATCH 4/5] kvm/vmx: kick L2 guest to L1 by ready async_pf Date: Fri, 2 Dec 2016 11:47:53 +0300 Message-ID: <20161202084754.22860-5-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161202084754.22860-1-rkagan@virtuozzo.com> References: <20161202084754.22860-1-rkagan@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: AM4PR01CA0024.eurprd01.prod.exchangelabs.com (10.164.74.162) To VI1PR0802MB2478.eurprd08.prod.outlook.com (10.175.26.21) X-MS-Office365-Filtering-Correlation-Id: a43ebded-e51c-4d11-786d-08d41a8ff406 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:VI1PR0802MB2478; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2478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tuX74mK5c/aJLJM4ugEdqjwUEjXwQD3c8wZMbRPXlx8IXeppa65QHtMXj/f/Xb55sZ9EG8SdVWX1I65QEFcE9CKK9JmijayYyv5uz7gLJTYjl+dqypVpPokC1ZwP6KHHJHs35l6mkD0wFpq1Z/rig/g81BD72+x7Hbji1MuvFk= X-Microsoft-Antispam-PRVS: <VI1PR0802MB2478408FD706816762E9F53FC98E0@VI1PR0802MB2478.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123560025)(20161123558021)(20161123564025)(20161123562025)(2016111802025)(6072148)(6043046); SRVR:VI1PR0802MB2478; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0802MB2478; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2478; 4:CaN1riDchvlim5S7eFG9247o2ssq70sJY4IMcHWBj6+wqrnvmWnb67Kl4DTqQSym3AmsOz/8mF59D7N74GonXG0FtXQNjedxQTBlvVIeyS/qcGb8ayFCyhnmbFxMpIqAi0Srr+2Zz6mDo5LGvXin5Xg5hGBczxsfoV9Hl1arYjPj2sltbGfvFGtt15k8H098BCLQsRGPzaxOaJgQP+uLksXk81hizJvoos6PjmDW2voYtk/rQnJl753L2USpWE65U6zqqo/A3TbeHnpRn0GbHp8s2KplJ4EckLedZDv9Oz87V17h3dTWBSpePL0wBjB/dgclC0yA3OZDI+AIbf4bw3GTz/LPwWv1g0j7E3Q8K8eEalN3KvJECDS/ivjbRY17xzPN4VsRG30QXbjt2zTgbURe3luxrErmNd8K5Gfpo+xiTLqjaDMHqFpTiR53J/Xm5IyrUNqVE5qzZ3JYvUuOwKDtX7Ne6zPnHCcEcjKB6Y2Qhr4Nhde77Js0rCNa3N6flz2KQu8UaiomkM6rcqH2KY+3WTfMUCTTeNL/R+i1+LnxNg/XiLOPjfW2kBxC8vkolWnjg42EkOvx/lv7Zya8/jHgo8kR/SUc9jmuHwc3vltrx+KJHGH08YllQLMNJU3btHD1FIHKq74+3rA4DN5XpO8MzkICF/FB1nIjP+OiA5U= X-Forefront-PRVS: 0144B30E41 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(53416004)(189998001)(81166006)(81156014)(8676002)(5001770100001)(4001430100002)(107886002)(97736004)(39450400002)(305945005)(76176999)(6512004)(2950100002)(6486002)(6506004)(733004)(5660300001)(6666003)(7736002)(5003940100001)(68736007)(50466002)(39410400001)(48376002)(38730400001)(50226002)(50986999)(4326007)(1076002)(2906002)(92566002)(101416001)(7846002)(33646002)(36756003)(69596002)(42186005)(66066001)(86362001)(105586002)(6116002)(3846002)(106356001)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0802MB2478; H:rkaganb.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0802MB2478; 23:6ky3p5StrLQvkaSp5ABXFk6SfN1EXpPK0JgkrnR?= =?us-ascii?Q?ZjDYBQU138HsPDbGTjk++h7J3j817S4kD/1BY/qL8etYNQDJrPPfGQBCN1u6?= =?us-ascii?Q?FUz6cG1Zxwj54AvgLDAhsgBmYFGgqPbuaaHGM26yAApc6b4ucofIWXBztXlJ?= =?us-ascii?Q?dPZTivV/uEpKRwMWbn7ceGLwRX/85autQ/MdsbY8jGZrRufqbaKvZQ0B3H7G?= =?us-ascii?Q?Z4v05/wLdv0jkBch4TUqH7G71/YMS7NRifGJflXsQmUvSzV4YIUuU8Vp7EeS?= =?us-ascii?Q?P/TPQbR0zHnX6lX/dQY6JHUZZlAh+lI9/CvFDHUXySH8KhzGtcgmoXbxG+9J?= =?us-ascii?Q?5uX+Q8H4GarJ6jMTN2ujEQRa/i2gkXOG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w?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2478; 6:hLBINyGzJVAiv+3UkGvfgRP50j3lQ44tCDDuu+/UEiMoCjV9IDp/fFRCrcGV8tJjOEDZ4PlZGzWbD13HfLcUUSM1uy8M7BnVHPxPGp4DRaMkghK4hYYUIMFFMNLhg0+SKbfO22DLdIWptnr77StIbSHm9RRPB0fvUsFPaqKG/moNY7CHeBu698uUdjLI7bfWFHgZQ+AV+XefoRAdAlobAsrv14+DIkoF90QJb+7J8QOC0VWHhqv6Bil+1MXQNFKjKOyYadGxiM0S6gSQSS5kxTnaUXpF/44cSnEsFxFWbpQkeKxJW2WcQikG/KbJSUO68O9zDMQPMzxBUCThxR+64NrclqbjnZ9ScEkD1MYuqnH0ZLVioDMlCkkZKibXSU0DwDdiXsW/u4neWuN/cnbvB0qdQIVug+PbpHiBLXSUXUKbz+KE3k7YhenXV74nYnZo; 5:tFfgUJhjJXEkob3yaKmFmSOjIIkLnQeay73RjdnQyF8hPmm1ywwtypiZXaAZuVEU2+dluTU8lyDsNyZZUZ29eZM/H75/VSQVdfxE9THqrGR3w7S+MEwV+spW4z/Nu6dBbSU974bTUv9DjcE+8dV0+g==; 24:FGNQeXGIdJnS5etbnCmG7vt/2i5GK1j26luzkiF9V9RyOmfhQlu5Ta93Y+JSBi0unBrcOkMj1023fxC9gBNcjrii7v6N9RpZVcVWwhXJlrY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2478; 7:pzzkkyQWqRXPOyYbtTpzfd/e7JuvyBgqcaW8lk/HT/po5dHyIlkBo9i4OCSs9XoKcybIW7BOFPveQH9hN8Jp7c7L7ewVvZopQ0maPHx4IU5iQnVfxLgK/CwfR77iFHc2zIm14LZRIRrfreF3JcMYeSzA4seHOGkeZ7vzD6Eelzr6rO4M5vE2VRQUyD0BNIYayzpj7Kp109EUaj57U9eW7GVfmXUqmABr2mB6FM1T6Ul/fzbGeDiXLhcVEMYX5UnywZpCgPfterFuADflGhmxX322jNr9Sk38Ls/v4IF4pCw3O1PCI3N2rF8p+YJyLEoyzH+VMVoRUpZjHGZ4FfHrBJ7Ms8/sh95/hm/QOxx9E3DL6XYU3J4MBawM7LtORnFrujAcjhCFeUT+VqkaM1CgQuQirxOfZUhYm3q8KuPIeuCGPKVaM6ljFbCrJVqwr7AgNaRcAm+bUku2cHW976DIRA==; 20:OVKajDWHuOVUCznkgiln5okm17wBQHG3lEZBBjCzOfrGD2yLtwILu0aYsgEnQaHABh7Oi//NQpHpzab6w0QpSJ6v9JsJ5XFXuYOKG9De84K4Jb05nfoEygQca1xueLQfXfNu19tQUg5GCrFIrpbQ334B5mN+9W2dPBVH/sHYVBg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2016 08:48:13.8269 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2478 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: <kvm.vger.kernel.org> X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 5382b82..fc97489 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -10420,7 +10420,8 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr) return 0; } - if ((kvm_cpu_has_interrupt(vcpu) || external_intr) && + if ((kvm_cpu_has_interrupt(vcpu) || external_intr || + kvm_async_pf_has_ready(vcpu)) && nested_exit_on_intr(vcpu)) { if (vmx->nested.nested_run_pending) return -EBUSY; @@ -10772,9 +10773,9 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason, if ((exit_reason == EXIT_REASON_EXTERNAL_INTERRUPT) && nested_exit_intr_ack_set(vcpu)) { int irq = kvm_cpu_get_interrupt(vcpu); - WARN_ON(irq < 0); - vmcs12->vm_exit_intr_info = irq | - INTR_INFO_VALID_MASK | INTR_TYPE_EXT_INTR; + if (irq >= 0) + vmcs12->vm_exit_intr_info = irq | + INTR_INFO_VALID_MASK | INTR_TYPE_EXT_INTR; } trace_kvm_nested_vmexit_inject(vmcs12->vm_exit_reason,
When async pagefault is resolved vCPU may be executing L2 guest. In order to allow L1 take better scheduling decisions in such cases, make L2 exit to L1 on a fake external interupt, without actually injecting it (unless L2 has other reasons to vmexit). This patch does that for x86/Intel. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> --- arch/x86/kvm/vmx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)