From patchwork Thu Jan 23 03:14:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 11346717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44C596C1 for ; Thu, 23 Jan 2020 03:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 236412465B for ; Thu, 23 Jan 2020 03:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726181AbgAWDMI (ORCPT ); Wed, 22 Jan 2020 22:12:08 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9236 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725911AbgAWDMI (ORCPT ); Wed, 22 Jan 2020 22:12:08 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 38780C59AB2450DB0290; Thu, 23 Jan 2020 11:12:05 +0800 (CST) Received: from huawei.com (10.175.105.18) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Thu, 23 Jan 2020 11:11:58 +0800 From: linmiaohe To: , , , , , , , , , , CC: , , , Subject: [PATCH] KVM: nVMX: set rflags to specify success in handle_invvpid() default case Date: Thu, 23 Jan 2020 11:14:01 +0800 Message-ID: <1579749241-712-1-git-send-email-linmiaohe@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.105.18] X-CFilter-Loop: Reflected Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Miaohe Lin In handle_invvpid() default case, we just skip emulated instruction and forget to set rflags to specify success. This would result in indefinite rflags value and thus indeterminate return value for guest. Signed-off-by: Miaohe Lin --- Chinese New Year is coming. Happy Spring Festival! ^_^ --- arch/x86/kvm/vmx/nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 7608924ee8c1..985d3307ec56 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -5165,7 +5165,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu) break; default: WARN_ON_ONCE(1); - return kvm_skip_emulated_instruction(vcpu); + break; } return nested_vmx_succeed(vcpu);