Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB186C433E4 for ; Tue, 28 Jul 2020 00:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C688A20786 for ; Tue, 28 Jul 2020 00:11:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="XsXx7GUQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbgG1ALQ (ORCPT ); Mon, 27 Jul 2020 20:11:16 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:34448 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbgG1ALP (ORCPT ); Mon, 27 Jul 2020 20:11:15 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06S06swi020875; Tue, 28 Jul 2020 00:11:03 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-2020-01-29; bh=1uVks55KihUgSYCMq0k3DOhEyTRXQpuU/TvMQ/0yXqg=; b=XsXx7GUQ7F51LQduXwRA7ndSZZpox6o/w+5kT+f8Qw+vAvtQ+PgUDL0FiS2TIDvPUFK7 Lgn94gBrkCZ102rxdmCAqXqUr1d6QTJIZFLxNlsOD2QiRsXXLoMgJNLY4kxRGiJGl/SC pVMqdZcyhaI9BPkSJiVB0eCZlRVOlhnwd1jMO4+NdevIjSYcDdorSr8r+afa0v8WhTql +x4+nzhjAFjL7feAMseoihV6ERWepUejFMIVz9ewrdyDs845AkOHaVbCYOw7Hq7f/0U3 ryHYE6wvDtcOap/iAYS90UpU5BSHBRj9fY51d1TlXPAZP6vVNBl57fxqvHOglh4Ma9tr og== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 32hu1j4g3q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 28 Jul 2020 00:11:03 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06S08QnP040776; Tue, 28 Jul 2020 00:11:02 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 32hu5s4mm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Jul 2020 00:11:02 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 06S0B0Vl020214; Tue, 28 Jul 2020 00:11:01 GMT Received: from nsvm-sadhukhan.osdevelopmeniad.oraclevcn.com (/100.100.231.196) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 27 Jul 2020 17:11:00 -0700 From: Krish Sadhukhan To: kvm@vger.kernel.org Cc: jmattson@google.com, sean.j.christopherson@intel.com, pbonzini@redhat.com, vkuznets@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 3/6 v3] KVM: nSVM: Fill in conforming svm_nested_ops via macro Date: Tue, 28 Jul 2020 00:10:47 +0000 Message-Id: <1595895050-105504-4-git-send-email-krish.sadhukhan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1595895050-105504-1-git-send-email-krish.sadhukhan@oracle.com> References: <1595895050-105504-1-git-send-email-krish.sadhukhan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9695 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007270165 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9695 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 clxscore=1015 malwarescore=0 spamscore=0 suspectscore=1 bulkscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007270165 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The names of the nested_svm_ops functions do not have a corresponding 'nested_svm_' prefix. Generate the names using a macro so that the names are conformant. Fixing the naming will help in better readability and maintenance of the code. Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Signed-off-by: Krish Sadhukhan --- arch/x86/kvm/svm/nested.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 3be6256..7cb834a 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -718,7 +718,7 @@ static int nested_svm_intercept(struct vcpu_svm *svm) /* * Host-intercepted exceptions have been checked already in * nested_svm_exit_special. There is nothing to do here, - * the vmexit is injected by svm_check_nested_events. + * the vmexit is injected by nested_svm_check_events(). */ vmexit = NESTED_EXIT_DONE; break; @@ -850,7 +850,7 @@ static void nested_svm_init(struct vcpu_svm *svm) } -static int svm_check_nested_events(struct kvm_vcpu *vcpu) +static int nested_svm_check_events(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); bool block_nested_events = @@ -933,7 +933,7 @@ int nested_svm_exit_special(struct vcpu_svm *svm) return NESTED_EXIT_CONTINUE; } -static int svm_get_nested_state(struct kvm_vcpu *vcpu, +static int nested_svm_get_state(struct kvm_vcpu *vcpu, struct kvm_nested_state __user *user_kvm_nested_state, u32 user_data_size) { @@ -990,7 +990,7 @@ static int svm_get_nested_state(struct kvm_vcpu *vcpu, return kvm_state.size; } -static int svm_set_nested_state(struct kvm_vcpu *vcpu, +static int nested_svm_set_state(struct kvm_vcpu *vcpu, struct kvm_nested_state __user *user_kvm_nested_state, struct kvm_nested_state *kvm_state) { @@ -1075,8 +1075,10 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, return 0; } +#define KVM_X86_NESTED_OP(name) .name = nested_svm_##name + struct kvm_x86_nested_ops svm_nested_ops = { - .check_events = svm_check_nested_events, - .get_state = svm_get_nested_state, - .set_state = svm_set_nested_state, + KVM_X86_NESTED_OP(check_events), + KVM_X86_NESTED_OP(get_state), + KVM_X86_NESTED_OP(set_state), }; -- 1.8.3.1