Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751938AbdILPnF (ORCPT ); Tue, 12 Sep 2017 11:43:05 -0400 Received: from mail-bl2nam02on0080.outbound.protection.outlook.com ([104.47.38.80]:8448 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751517AbdILPnA (ORCPT ); Tue, 12 Sep 2017 11:43:00 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; From: Suravee Suthikulpanit To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, joro@8bytes.org, Suravee Suthikulpanit Subject: [PATCH v2 0/3] KVM: SVM: Fix guest not booting w/ AVIC enabled Date: Tue, 12 Sep 2017 10:42:39 -0500 Message-Id: <1505230962-86304-1-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.2] X-ClientProxiedBy: BN6PR2001CA0014.namprd20.prod.outlook.com (10.172.112.152) To CY4PR12MB1733.namprd12.prod.outlook.com (10.175.62.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ce6ea28-4a9c-4f13-7d16-08d4f9f4f149 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR12MB1733; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1733;3:JCIm9S8bPoccpT8w+cKVlEHznoJxhGuCVqodgJMiN/xM8Q/69EADjU5JKU/zMPuLCxdiJfZdtF49OL3OPbK0FbjNDU4a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6lpH9+6jqSIQI8ukTbpov38X2kkpIOBNGAVy41dsz1hNorWnJZLazcc8dRMeLUEWje/uw+i/V7ZtPSQR0KpgvzcjuabP8EbhjOuiT3u5lLv13l4CQ80FzVm/cN3lsIgQBzHEg7H2pBmsXRDbXylFXlxBTot1QAopLQN5552iJF7G3ncldOPisNlv4t0MMeDv4YRHeMGHLjUAV/q6GGQ+wP6G5jyBWfFB+jigMKfJENb0+W0Yhgj/eFA;4:4NSdjUj4aS1w4bGbxuDqarHvRA4zadVLhHXEZ7HQqBwl40RzOWUjHenPvQbfort9eON00uu4JkeVMZGsXDX1NgpJC/olTAN6kSnyEGRZTZ0vz+8xD87macVRfIfSzj0dgJyXRkpXY5lwSTvd3gVScPWU4U/RGHN63UWqFKl7oQf2TMbHVKl8Rax3vlS7rCYJehWaGVoMMffOZkFg5CgVbxYPjAPp9sTznJwhTAAaynh2HpWC81pPforGysLqo90a X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR12MB1733;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR12MB1733; X-Forefront-PRVS: 042857DBB5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(199003)(189002)(6306002)(305945005)(5660300001)(53416004)(7736002)(72206003)(25786009)(2906002)(50986999)(106356001)(189998001)(4326008)(316002)(478600001)(33646002)(105586002)(101416001)(6486002)(48376002)(81166006)(36756003)(8936002)(47776003)(68736007)(3846002)(6116002)(81156014)(110136004)(42186005)(6666003)(97736004)(53936002)(50226002)(5003940100001)(8676002)(4720700003)(86362001)(66066001)(50466002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1733;H:dave-rhel73-ethanol.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR12MB1733;23:EkCYI8tQ+Jd/0iyvnblpJm4L9ANtKVj76xT3U2FqG?= =?us-ascii?Q?NzwV4PdvTAoL5HK6VrPPdLt4mmYMDuPKisCs0zmJScSiECLx9cvBT0KGaQI3?= =?us-ascii?Q?GP/JjdB+zR5DzkElxAygR4+RiFneriRkTQ+Rw8o2cFL/OpQVVrKgOkId/bQv?= =?us-ascii?Q?NF4E3Q70A/waXXCxXxdZlxp4z1tQOgcUWhQ27GFzWXr+MTYZ3tu5vSS1Wg5J?= =?us-ascii?Q?BdFZ2Ppua7hzgrVdfzIjdgElDBxAjHFYfmXxfmEmdc/GeQlKM9Rd2FwVExjh?= =?us-ascii?Q?DcIZB3NEbYfXDHmSwNtVm0Ba7V/hgCZ6NIJ+GbLlPYNa7TKCU+2mFqOG2DBp?= =?us-ascii?Q?AFq3kx9H1nefGVBvhxVQYqpViJtHTJnZaKOMgtfNDe8kXUc1b8arPcfUs1mC?= =?us-ascii?Q?UHFwl9W0VW57GPEL6IeK1H0XLm1KmhRxAV9cyT/JFinQ+6eWoFiExI+NfYbN?= =?us-ascii?Q?KKIlG++v4lSIxCWgpc9k0hyDEAeyZDH25p+ty8T1IJBgQOnI7lH/+d07+P9S?= =?us-ascii?Q?xdrEMqodHcCwXOSGEBF4G9HO5MlzHEleZeVkQjSk3lRclaL/5NjWEr8OlMhR?= =?us-ascii?Q?02ZyKNmrNYlQOefR6io+4w1gg1gyrkjx7poAlCX+sEjsgzEaSRThBnCTHP7U?= =?us-ascii?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;24:DgWYCHTF1Jfj+GnGv0eqxX+eNE7uZld8auILv8exKLYj+01kTJnr1+ew1Y6NHcxlxvzFpOi6qbnZR/noooDtC3QZIVdRnbXSjwi6lZZNSwA=;7:DAhpCz9YasiD+g2y8H+he4xt+4SF3Uy/Qv9BkmzDCPCEboVV6GEk5a2frWsx65VXJRnjp81WRsefn3X0iH+5SRFY7XPoMYds624i0/tA0Zyzky+hl1zr1+HL0GLkrH7gTl9mbKn0WI3oKjfBjuSg3PZpe6K/MYKQabr2WzS1czXdiJnjxvAvAkqTb/VW4jqMUuCvfocsC/8iZ4Jl2g19Zut7pVhnJdh3Gb4MnTLShe8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1733;20:AXgqU1m5LAysuxUa30Kv0C7Cy4VHRrbBSnlb6DQGcs759/8VvlDm/aMkcuRITJzj8v9Z91NJWlrz62ufkYV87pAbrPZwg3aQEua675KO6mu5yVnkWSrIKCbl/Um3StNgqQCiMNfkwB2LnZKujFZPqdZHqIlzlREzyEq9vpQdNPyh0IGRW8E3HacpHsoaCHeTMfhnzKJhv+sNHkazoi+y7Qz99ITMOPUjrab7tTRyY/pj4wpnp8v3DBtmVvb0DWOH X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2017 15:42:57.2325 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1733 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1093 Lines: 26 Certain QEMU options fails to boot VM guest w/ SVM AVIC enabled (e.g. modprobe kvm_amd avic=1). Investigation shows that this mainly due to AVIC hardware does not trap into hypervisor when guest OS writes to APIC_EOI register. The boot hang is caused by missing timer interrupt when using in-kernel PIT model (e.g. launch qemu w/ '-no-hpet' option) since it requires irq acknowledgmen before injecting another interrupt in case irq re-injection is enabled (normally default). Changes from V1 (https://lkml.org/lkml/2017/9/5/826) * Consolidate irqchip_split() check to only one place (per Radim). Suravee Suthikulpanit (3): KVM: SVM: Refactor AVIC vcpu initialization into avic_init_vcpu() KVM: Add struct kvm_vcpu pointer parameter to get_enable_apicv() KVM: SVM: Add irqchip_split() checks before enabling AVIC arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/svm.c | 43 ++++++++++++++++++++++++++++------------- arch/x86/kvm/vmx.c | 2 +- arch/x86/kvm/x86.c | 2 +- 4 files changed, 33 insertions(+), 16 deletions(-) -- 1.8.3.1