From patchwork Mon Oct 10 00:23:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Longpeng(Mike)" X-Patchwork-Id: 9368761 Return-Path: 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 C69B26048F for ; Mon, 10 Oct 2016 00:24:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1EA028B21 for ; Mon, 10 Oct 2016 00:24:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A40DF28B24; Mon, 10 Oct 2016 00:24:28 +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.9 required=2.0 tests=BAYES_00,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 2F06728B21 for ; Mon, 10 Oct 2016 00:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbcJJAYC (ORCPT ); Sun, 9 Oct 2016 20:24:02 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:63292 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbcJJAYB (ORCPT ); Sun, 9 Oct 2016 20:24:01 -0400 Received: from 172.24.1.47 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.47]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DSG14465; Mon, 10 Oct 2016 08:23:55 +0800 (CST) Received: from localhost (10.177.246.209) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Mon, 10 Oct 2016 08:23:46 +0800 From: "Longpeng(Mike)" To: , , , , , CC: , , , , "Longpeng(Mike)" Subject: [PATCH] kvm: x86: correct the misleading comment in vmx_handle_external_intr Date: Mon, 10 Oct 2016 08:23:43 +0800 Message-ID: <1476059023-33224-1-git-send-email-longpeng2@huawei.com> X-Mailer: git-send-email 1.8.4.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.246.209] X-CFilter-Loop: Reflected Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since Paolo has removed irq-enable-operation in vmx_handle_external_intr (KVM: x86: use guest_exit_irqoff), the original comment about the IF bit in rflags is incorrect now. Signed-off-by: Longpeng(Mike) --- arch/x86/kvm/vmx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index cf1b16d..9fa3c76 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8647,9 +8647,12 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu) register void *__sp asm(_ASM_SP); /* - * If external interrupt exists, IF bit is set in rflags/eflags on the - * interrupt stack frame, and interrupt will be enabled on a return - * from interrupt handler. + * If external interrupt exists, fakes an interrupt stack and jump to + * idt table to let real handler to handle it. Because most of bits in + * rflags are cleared when VM exit(Intel SDM volum 3, chapter 27.5.3), + * the IF bit is 0 in rflags on the interrupt stack frame, so interrupt + * is still disabled when return from the irq handler, but it will be + * enabled later by the caller. */ if ((exit_intr_info & (INTR_INFO_VALID_MASK | INTR_INFO_INTR_TYPE_MASK)) == (INTR_INFO_VALID_MASK | INTR_TYPE_EXT_INTR)) {