From patchwork Fri Nov 30 19:04:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krish Sadhukhan X-Patchwork-Id: 10707061 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 8408F109C for ; Fri, 30 Nov 2018 19:29:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 734A830234 for ; Fri, 30 Nov 2018 19:29:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64AB4302AA; Fri, 30 Nov 2018 19:29:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 5634D30234 for ; Fri, 30 Nov 2018 19:29:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727158AbeLAGjU (ORCPT ); Sat, 1 Dec 2018 01:39:20 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:38862 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbeLAGjU (ORCPT ); Sat, 1 Dec 2018 01:39:20 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAUJOcCY065408; Fri, 30 Nov 2018 19:28:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=R897RdjdsPR7ujh5wTpzhB5xJ1NxwJuu+b6qfAtxo3w=; b=0UZLwJ8JSwac0Yowp2W4DdYw04fn+V+ZAWIQkiqEbX+Pv/y7lpwInWJLZrdMKOBSM5e9 0PB6+rj9hmI1xReXt/lvOoTVPKxiQWPVWlAyoRlQfU0c6L1Yx54S0Ymp/yhsV7Uw8aPS Wvgu2UX7A+CqqEcjZCZpnCn6fFxX6wETUq+ijU2vSJijv3gj4ukE3hLcUZAyEAAHrAaW U/MLNRvf+Zvp93b7SrU/xDBER3Ylk2nAcR19bAXSrtlacL6amLyCLVPLTNnmiWLk65Qf X2HB0Pvcz0tRUwExT5kGfYtKMYIegmFIFl5Lj8TQZeSsUAshrzKaHdIEBSWyaR3H+xNQ OA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2p2jf0qa7v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Nov 2018 19:28:56 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wAUJStwc018812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Nov 2018 19:28:55 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAUJSsB9011370; Fri, 30 Nov 2018 19:28:55 GMT Received: from ban25x6uut29.us.oracle.com (/10.153.73.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Nov 2018 11:28:54 -0800 From: Krish Sadhukhan To: kvm@vger.kernel.org Cc: jmattson@google.com, pbonzini@redhat.com, rkrcmar@redhat.com Subject: [PATCH 1/7] KVM: nVMX: Prepend "nested_" to check_vmentry_{pre,post}reqs() Date: Fri, 30 Nov 2018 14:04:32 -0500 Message-Id: <20181130190438.13591-2-krish.sadhukhan@oracle.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20181130190438.13591-1-krish.sadhukhan@oracle.com> References: <20181130190438.13591-1-krish.sadhukhan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9093 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=710 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811300165 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP .. as they are used only in nested context. Signed-off-by: Krish Sadhukhan Reviewed-by: Liran Alon Reviewed-by: Mihai Carabas Reviewed-by: Mark Kanda --- arch/x86/kvm/vmx.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 02edd99..3a74a4c 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -13003,7 +13003,8 @@ static int nested_vmx_check_nmi_controls(struct vmcs12 *vmcs12) return 0; } -static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) +static int nested_check_vmentry_prereqs(struct kvm_vcpu *vcpu, + struct vmcs12 *vmcs12) { struct vcpu_vmx *vmx = to_vmx(vcpu); bool ia32e; @@ -13185,8 +13186,8 @@ static int nested_vmx_check_vmcs_link_ptr(struct kvm_vcpu *vcpu, return r; } -static int check_vmentry_postreqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, - u32 *exit_qual) +static int nested_check_vmentry_postreqs(struct kvm_vcpu *vcpu, + struct vmcs12 *vmcs12, u32 *exit_qual) { bool ia32e; @@ -13379,7 +13380,7 @@ static int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, return -1; } - if (check_vmentry_postreqs(vcpu, vmcs12, &exit_qual)) + if (nested_check_vmentry_postreqs(vcpu, vmcs12, &exit_qual)) goto vmentry_fail_vmexit; } @@ -13515,7 +13516,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) launch ? VMXERR_VMLAUNCH_NONCLEAR_VMCS : VMXERR_VMRESUME_NONLAUNCHED_VMCS); - ret = check_vmentry_prereqs(vcpu, vmcs12); + ret = nested_check_vmentry_prereqs(vcpu, vmcs12); if (ret) return nested_vmx_failValid(vcpu, ret); @@ -14980,8 +14981,8 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, return -EINVAL; } - if (check_vmentry_prereqs(vcpu, vmcs12) || - check_vmentry_postreqs(vcpu, vmcs12, &exit_qual)) + if (nested_check_vmentry_prereqs(vcpu, vmcs12) || + nested_check_vmentry_postreqs(vcpu, vmcs12, &exit_qual)) return -EINVAL; vmx->nested.dirty_vmcs12 = true;