From patchwork Thu Mar 14 02:19:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li RongQing X-Patchwork-Id: 10852059 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 2661B1850 for ; Thu, 14 Mar 2019 02:19:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11C0E28AB0 for ; Thu, 14 Mar 2019 02:19:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05E0528AB8; Thu, 14 Mar 2019 02:19:22 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 EFCD328B4A for ; Thu, 14 Mar 2019 02:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbfCNCTS (ORCPT ); Wed, 13 Mar 2019 22:19:18 -0400 Received: from mx139-tc.baidu.com ([61.135.168.139]:19856 "EHLO tc-sys-mailedm02.tc.baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726564AbfCNCTS (ORCPT ); Wed, 13 Mar 2019 22:19:18 -0400 Received: from localhost (cp01-cos-dev01.cp01.baidu.com [10.92.119.46]) by tc-sys-mailedm02.tc.baidu.com (Postfix) with ESMTP id 9F39811C0055; Thu, 14 Mar 2019 10:19:04 +0800 (CST) From: Li RongQing To: x86@kernel.org, kvm@vger.kernel.org Subject: [PATCH] KVM: svm: merge incomplete IPI emulation handling Date: Thu, 14 Mar 2019 10:19:04 +0800 Message-Id: <1552529944-24864-1-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Invalid int type emulation and target not running emulation have same codes, which update APIC ICR high/low registers, and emulate sending the IPI. so fall through this switch cases to reduce duplicate codes Signed-off-by: Li RongQing Signed-off-by: Zhang Yu --- arch/x86/kvm/svm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 276ab8ab6c95..2e0c9cb349d2 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -4508,12 +4508,7 @@ static int avic_incomplete_ipi_interception(struct vcpu_svm *svm) * formats are supported. All other IPI types cause * a #VMEXIT, which needs to emulated. */ - kvm_lapic_reg_write(apic, APIC_ICR2, icrh); - kvm_lapic_reg_write(apic, APIC_ICR, icrl); - break; case AVIC_IPI_FAILURE_TARGET_NOT_RUNNING: { - struct kvm_lapic *apic = svm->vcpu.arch.apic; - /* * Update ICR high and low, then emulate sending IPI, * which is handled when writing APIC_ICR.