Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753631AbdIFDkI (ORCPT ); Tue, 5 Sep 2017 23:40:08 -0400 Received: from mail-dm3nam03on0078.outbound.protection.outlook.com ([104.47.41.78]:27978 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752221AbdIFDkG (ORCPT ); Tue, 5 Sep 2017 23:40:06 -0400 From: Suravee Suthikulpanit To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, joro@8bytes.org, Suravee Suthikulpanit Subject: [PATCH 0/3] KVM: SVM: Fix guest not booting w/ AVIC enabled Date: Tue, 5 Sep 2017 22:39:26 -0500 Message-Id: <1504669169-4919-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: [114.109.128.54] X-ClientProxiedBy: SG2PR06CA0102.apcprd06.prod.outlook.com (10.170.138.28) To DM5PR12MB1737.namprd12.prod.outlook.com (10.175.89.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b17b158-6e3a-4267-ae9d-08d4f4d8f59a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR12MB1737; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1737;3:RC6sLy0Qt0mEwiSHSrzXcBkDzAguKy7LAk8qQ2PM/eY6GhYUJIKioRpD8Gi29jLkoJ+U+/uNjctoWAp87KkCg3/CzGBweiy/Qo9uoXFLE9FkTH7s+/OxLcI2jAHoKcjYheq/ZaqGkQTS2N2t6qKjeWeq1joarMyKzPGf05KiGPTVydDof/+9WBEtJFFfYReup6J6wBN31RJM5CwWIZl+FwZUa0Fy8zIwn9tGTucQoQ76/fOO9ftzLk/wdUMnA4jY;25:9GUv+jvcbD8BwxlIc5VOzxZ0+8X5NyhpgmjduHr+mUTBvyYXYCU5isSP67GLGAgw7zlKGQzZY5MF9a5wrAPGYD87MUGceJJyJ1ckRPeq1gRdThPcXRnO/Ds4heoH0shDOiSWakonJLtFWhKzSmD9ODXa5xLpJshyHx3cYWMI6KewVDKi8Q1lP0iZDSJQjjLgv/J7RX0ch1OJC4AP6YPYMidQAW7XaVxeALm2D041Lp9kRkmVexexoxic1mogZT9trvr2sDwENhmPCucAB2YCx+c9ICD4AND3Gv7B7ScemEOMo0maDobps8g8hjxLjV5Ac3WI1abPc8V/BAb+078rEQ==;31:ngqHCAvR+G8zVd/3tBxHbBd/hSANFDF458vD256A5avWNDo56dSIiNjSS4SOMW/Lg1rDrCRPBr3qlr/wyisZl/UTMhQy8S9MiBn7RWIh3iK37GULNtg+cNx5byzF8HDJVMFunDQrkpLk7EKGxHZ3ON1DaoBVm7xQNuQBSw2MvAlJ4fxeUoNLmdOcFEXosxyQtXYOwW/aio05Qx2X9im0w2KJXR3cPuss+2mJwX82T8I= X-MS-TrafficTypeDiagnostic: DM5PR12MB1737: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1737;20:MQURZn1WB1giVStT+DkAatX7lCBLUF7InbdaXLy+XD6Iq5V+2zl0JDoGueS9EKc6dMK1wCOFwITWU8Wof+/3x5obbgWzk/QnVzh0MX8iMzM5S7K+Ei7ko7YQP4iP5YXYTAG7Uqiomd+/tmHKYq6deWRhKw9FHBqfgwUCn2jE4U7cM+0kbkwSnAEy+8CgxtMJn2Trn7kUVXL1/7YlE7js3dTtcufSgFBXBAy8jJoEZeYBHwb3BQMK+xurCdOuvpiJm2TuA6S2effOrudV25CHbhpF0wvkImABe70qnCzavHmpp5JbuC1gzzYDruzUZiXktW3dZ0zV3NB/W4IDm6XjCcxDk26cn673ustl9kMEJYG/Tsbi20Vw9wHSJyLUj/XnqiIzKD2uMVhL9o2mH+82X+Ab9nQyysW4LTBxENUGCEc9r1GGlfp0tO5vpNe9/ohq+uy2UKRBRL+qSe0/ePw8Q2iLhNLVh3QwXMsrNmxs+gmi51YU/5Q0VtM5MV9SUxOT;4:VUdttbhJGP2O1YgurFiU9XgF29zOlcuibnMrAuu9ASNDndZO0ZqpY19+ZTo5HufR9rm4TFWW18o8gQKW5jmhjBtVUbR7hhRbNGT4567rmMi5kSa7I6i5rgXiB6e3+0mH16d4tQvJgafbpwcwDDV/JIVCXaI4UQ8/ZJbV1F9agdSVKd+sWGFYJxaPrv/TiEgKjIP7IMINXX2MH6Mr8S/mBQ/bCzCAg/GIY2bz5SYY9j/qpHRlazKeOvAEIxBnIUtA 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)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1737;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1737; X-Forefront-PRVS: 0422860ED4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(199003)(189002)(8936002)(6666003)(6116002)(86362001)(53936002)(4720700003)(101416001)(6486002)(42186005)(106356001)(5660300001)(5003940100001)(105586002)(3846002)(110136004)(305945005)(4326008)(6506006)(72206003)(7736002)(66066001)(47776003)(478600001)(25786009)(2906002)(4743002)(8676002)(97736004)(50986999)(68736007)(50226002)(36756003)(81166006)(33646002)(81156014)(50466002)(189998001)(48376002)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1737;H:ssuthiku-rhel73-zp.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR12MB1737;23:emvn5XbfUM2+bYdESj2xHtAygd0RFRJeawAEx0Eon?= =?us-ascii?Q?RYQ2VNeFlYz5bushroFt0CDhljhu1/JqkmGDGM2WCKlV3tyZu5M+aYAbohHC?= =?us-ascii?Q?DgwrvMLZtpyCaYJUKygutVlDiH1NWy2o+rJzFiQ48duOFu26gJpZ6X6AZGa7?= =?us-ascii?Q?/51InNFFzyfUDptFJN4bNCSHQfynH0qt7BgQLpQKPct03jqppq3mAN5iz4iZ?= =?us-ascii?Q?uvwiGjrCdZir3JXs7etYwNpNjOgdyR+/fDvAJjbyZSCcvu9QgIFnQDaT7bMN?= =?us-ascii?Q?OFnA+5CQK08U8U2i6TkPz2nvMNdDAfuabkOoxk8YhkATCRllFP8mfSvK2UZK?= =?us-ascii?Q?gdJDo8we9mTbC0PvwAfTBvHlTSK7Vzoiz677g5fPo3HgwSTJNn42QOtnTppN?= =?us-ascii?Q?qfqPdb9Yl7gZ0wXbZMWTGw40CFXX9w4CwyBAmVK/fBrIXSKSKa56O1v+8Fse?= =?us-ascii?Q?YS84Dg5GHwkv7f2f25WICg0d8GShfrPJz4pUkwgcS1nt10+g55mMu7ZYXD4z?= =?us-ascii?Q?bdSJQBJqFeDNbt3zmHt2CLWwJSBvJWW1ETMseCnzwebkwRmqx2g2Luvs9T9w?= =?us-ascii?Q?X1zeDworjKuuRgNlg7TPZkfB5m7Xj55ivsSdkWGEgdl3Xur/GXvw3CS2VutV?= =?us-ascii?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vtoc1EHxFQMTou2lWQKIZPjGsSu1kxAMSdWMRTzz75eJZoHDoUxD+2mMWPKUtsgBEvr8X7i8a8Tm4rWEI/09nVitaC6SNQdwD8=;7:Jnv7V9e+D8b0L22er2UWaPsMRLWXG51jE/VdCu3Wpy0h1wc2cuj3VnWtqx73E4siQWgaJIGaI2bF2/gdQDZeK+7YbpOgWChOGyNm/YuEFuuqLdXBQBRsfSFDF0BouCTva8qISjEoIFFzTXfS6YF4CEd/3CK8b/5lJ49B7D2OLv54G+NOGMOceHw5jW8Va1K2E6XseLcx/clBbuiF5Ezrd65B7sBPaCdw06RfILKkUKQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1737;20:YzpWrWaTe6JAi1ZhDlsPnc7sXqxuCmv8MMglsjB6jZrPg0+xId2x0xvfyM25IODwqITbt+vECUTxo9U74fWqVB2UvYUdNRxQJhlaDYVHM/u4rbMq1HDRHsPxN0TYL5iNA/yzkdvbg6UA7va11XS6Z9/Umo9PpsbgVToSh8RYRYUhm6BbaRdlQVDOitZIHN015ptgOQkE93+xNKlR52DctzdQ823kqcaQTfkH3rVT7UVnQ4bGX7/2ZVTMqiJpxRoe X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2017 03:40:01.6125 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1737 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 970 Lines: 23 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). 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