From patchwork Tue Jan 25 09:58:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42C55C433EF for ; Tue, 25 Jan 2022 10:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237927AbiAYKCD (ORCPT ); Tue, 25 Jan 2022 05:02:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238381AbiAYJ7W (ORCPT ); Tue, 25 Jan 2022 04:59:22 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43DB4C06173E; Tue, 25 Jan 2022 01:59:20 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id d7so18734260plr.12; Tue, 25 Jan 2022 01:59:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MQeM6vIxMZvFlKo4v9hbzR1rquivdNYZS0j3o7B/fwk=; b=S/XB1UxNdTAu3Pt96Tx2FkHJeD7V1KI5QaimN/TSbPStOm23ogD0frWiuy4Gjvut+v YZnf+wOLcvtgnN6k/Zt6EP+ZK+lLKYPMGnu0UOpaXHq2fq4VaZQyZeJBLEseuzlTFfyb 93M8Dc0wf5bXyTjY3CtAFrxJdZXKRed4n5MhgfeYzmZ4moD4daebq05x+7YoZkh4gVkT wW3AfMIIMQNRChxBSy5K+djQE+LpyHIK4jpotGxt/kbyrHxAg/8HaTpvJdX/Y/A7+wL1 5FF4mDE36SbkZm5MI03NL9VXB1iwDpfFsQ9E0v9kfkJ5DYlWVRWwWbKHLe7mc3Iv8lXe 3rkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MQeM6vIxMZvFlKo4v9hbzR1rquivdNYZS0j3o7B/fwk=; b=Wq6VwrBI852Q5pZbS6bnPXQLNPx7h5I/SW6vMaPuW1lHFI5nTsA28OY+tNqm9cEtTm 7gvvpiqyidQlRqlE6BvXs9R35aBWxm/GoP+falaLiw8xoQjekWofmbpGvqds3aYvmarK xNBsUcXyNM+CefHv7H5ILglEj5IUEwmekHEivf2Nh+Hr09VGjQJXNQn9XV6IEeSECREc ciKC6LYVDpvNStTjgAmDbz0CFwdxI/B2d52cncO3UchcVD5xv6Z/8svrkbSeoG+JngtC KWftL13lO5NcHyl0RCV88NECRP9Z/5BArwiFBhb4IjJsb1wtKyAACWxEz1ncPCBnv5AM D+/g== X-Gm-Message-State: AOAM533kveZ7WzR7lViFvFj+WcoUEUEyuR5Y8qzE9kmcX5xTjcwbwhpB k25UbMHB4+i01Hecv0emQqfo31OemgXxfg== X-Google-Smtp-Source: ABdhPJwApbcOM6iYH3gdbKpV8Q3BpENbIjt5SquZUGzAwxYkKwLk1g70YihEKH+jBj+vtAol5vsxFg== X-Received: by 2002:a17:903:41cf:b0:14b:5b0:484b with SMTP id u15-20020a17090341cf00b0014b05b0484bmr18518725ple.155.1643104759854; Tue, 25 Jan 2022 01:59:19 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:19 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/19] KVM: x86/mmu: Remove unused "kvm" of kvm_mmu_unlink_parents() Date: Tue, 25 Jan 2022 17:58:51 +0800 Message-Id: <20220125095909.38122-2-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm *kvm" parameter of kvm_mmu_unlink_parents() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/mmu/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 593093b52395..305aa0c5026f 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2307,7 +2307,7 @@ static int kvm_mmu_page_unlink_children(struct kvm *kvm, return zapped; } -static void kvm_mmu_unlink_parents(struct kvm *kvm, struct kvm_mmu_page *sp) +static void kvm_mmu_unlink_parents(struct kvm_mmu_page *sp) { u64 *sptep; struct rmap_iterator iter; @@ -2351,7 +2351,7 @@ static bool __kvm_mmu_prepare_zap_page(struct kvm *kvm, ++kvm->stat.mmu_shadow_zapped; *nr_zapped = mmu_zap_unsync_children(kvm, sp, invalid_list); *nr_zapped += kvm_mmu_page_unlink_children(kvm, sp, invalid_list); - kvm_mmu_unlink_parents(kvm, sp); + kvm_mmu_unlink_parents(sp); /* Zapping children means active_mmu_pages has become unstable. */ list_unstable = *nr_zapped; From patchwork Tue Jan 25 09:58:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDEAAC433F5 for ; Tue, 25 Jan 2022 10:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238732AbiAYKCe (ORCPT ); Tue, 25 Jan 2022 05:02:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238382AbiAYJ7Z (ORCPT ); Tue, 25 Jan 2022 04:59:25 -0500 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4C2C061401; Tue, 25 Jan 2022 01:59:22 -0800 (PST) Received: by mail-pj1-x1043.google.com with SMTP id d5so17022438pjk.5; Tue, 25 Jan 2022 01:59:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zds+6NGj4r5Cgf49TNd0ICEUzlDMHJlb5d/51ngIGcY=; b=FPq9Vcjqt0nTW+XIHcP+SFASqW+hp1tbi/NDSAy5DGJNynrClbaVord3oKGHXwgk0e y1yov5feI2dwoI5FcjI0YIXpZJhLWRyf2vT1R/KvWLhNaNk6FHVAMofkk/UxEbwAw6fh r5IsdNml1hDxTvdyJ+Iv4Yf6Wcjud8kQ4DEwdXWtsxrumZKgzFwgbSv4Gi+7Zk8KA7kV 3YrhRRtt98L2nrt4AYjLwG1MyTex+0YqaVtOCkAG0xVNwORhZDrIgP2A61Ysd3fVO72Q Xww2Jf2mMfK+6gXVbmOopE3KHM0UpPP9j8cAU2QzgPtekl0fFrH3KWw5GsnEuf7YMI9+ UrqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zds+6NGj4r5Cgf49TNd0ICEUzlDMHJlb5d/51ngIGcY=; b=p5jAt7ihPfBADiJyFsdF/7R2IARyniBlBEcSjKHzbaqWsQk40vGa+u957/7lN4MV5l yyRkwhYSdFbY612CbX1aHb0NCIeTXkJnDGiNoY2f2vWktIyxj5T+mvMElIHt7F09dFif j0uuwxYoLOJs1LfK7kRKRhNaa9EGa2AEppXS1+UrPV8C4C9ZV1efucGSNWckwdW534ir vYJGfiNIlaAfSU1xkxfLYQg4oNW5NgvdGXigsMCDR4F9RBgIU7hXQ53nnZngPZhbxVtW RscCGBJQtRz5bdFTZI2EnzrscORp8Rb+RoJhvhTDfDTaoUYC8vpzgGiemt2AHMc/LjJT cY4Q== X-Gm-Message-State: AOAM531jlWWrGM6gKODj+MulQ6e3LI2m7t7TB2H+Sv3+YEK7ZtZW3Y2A FE1qmkywuIFU3tncXLLdJ/A= X-Google-Smtp-Source: ABdhPJyJ/kfuWDn6T2bse0t/3zBL2P2KyOlJhtUHjbpznQcxoh4DcmAlrs6pIXWssTrGtABK9yzabA== X-Received: by 2002:a17:903:24d:b0:149:b68f:579 with SMTP id j13-20020a170903024d00b00149b68f0579mr18675922plh.1.1643104762396; Tue, 25 Jan 2022 01:59:22 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:22 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/19] KVM: x86/mmu: Remove unused "kvm" of __rmap_write_protect() Date: Tue, 25 Jan 2022 17:58:52 +0800 Message-Id: <20220125095909.38122-3-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm *kvm" parameter of __rmap_write_protect() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/mmu/mmu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 305aa0c5026f..bb9791564ca9 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -1229,8 +1229,7 @@ static bool spte_write_protect(u64 *sptep, bool pt_protect) return mmu_spte_update(sptep, spte); } -static bool __rmap_write_protect(struct kvm *kvm, - struct kvm_rmap_head *rmap_head, +static bool __rmap_write_protect(struct kvm_rmap_head *rmap_head, bool pt_protect) { u64 *sptep; @@ -1311,7 +1310,7 @@ static void kvm_mmu_write_protect_pt_masked(struct kvm *kvm, while (mask) { rmap_head = gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask), PG_LEVEL_4K, slot); - __rmap_write_protect(kvm, rmap_head, false); + __rmap_write_protect(rmap_head, false); /* clear the first set bit */ mask &= mask - 1; @@ -1410,7 +1409,7 @@ bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm, if (kvm_memslots_have_rmaps(kvm)) { for (i = min_level; i <= KVM_MAX_HUGEPAGE_LEVEL; ++i) { rmap_head = gfn_to_rmap(gfn, i, slot); - write_protected |= __rmap_write_protect(kvm, rmap_head, true); + write_protected |= __rmap_write_protect(rmap_head, true); } } @@ -5802,7 +5801,7 @@ static bool slot_rmap_write_protect(struct kvm *kvm, struct kvm_rmap_head *rmap_head, const struct kvm_memory_slot *slot) { - return __rmap_write_protect(kvm, rmap_head, false); + return __rmap_write_protect(rmap_head, false); } void kvm_mmu_slot_remove_write_access(struct kvm *kvm, From patchwork Tue Jan 25 09:58:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9B6FC433EF for ; Tue, 25 Jan 2022 10:02:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238369AbiAYKCW (ORCPT ); Tue, 25 Jan 2022 05:02:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238387AbiAYJ7Z (ORCPT ); Tue, 25 Jan 2022 04:59:25 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52148C061747; Tue, 25 Jan 2022 01:59:25 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id h23so17806688pgk.11; Tue, 25 Jan 2022 01:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sFcu61MZ2RkaH+ZyWsgAfQkoqzX6pbxtu6BZspxx0Xc=; b=QT54k1tCufiOx+YVxE6HumrP+DNXKuk5L+k+bjRS0b2lw1vWHg8wr5sYQ2uUxoFexl DIwVskQW4gsK2jXahHsK53XODLiZAsfYdSZGP9rpCiyhFh3769ccPuYXWSZci5StAKf9 uiI8Hhs0PVvrrFO+66DdGOuKaa03btdF17R4JaWwJGw+JYBF2m+fcCcMf7rjJgy7A/OZ PlppjIIwNKSGcsxteWYCXJ55c+EoJg8d7k8o6EebGgW8RWvtwM9qwogKUW5nry7r81Iv ssHvaD2ENoU3mhjVBg7xOKuAsWjnT0egZn/K7ticw2I0tWsYGmkjLEmu6wJjlE6LVJ74 ixrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sFcu61MZ2RkaH+ZyWsgAfQkoqzX6pbxtu6BZspxx0Xc=; b=FL+Yhyoko8+80DSfTEQ0vEnT6DpIIF/ucKV6g1gGYw0Vj/LjKZNE+L7ynw/CYfg4jX JAHgm0yYthSECgbnOKDaEKVHbVaQIXnpLCFa8olSco34zhJccfWaH2Qk/olfXkF5fNMs bULgvDrULZjwH+QSGyZwv8xRjAuJAIpT6k4lEWYIVd41USksNN4VNvfzM7MP4mDxGsyg 49Z/zzHtzf5V55GUeOc9I7GRPGZINHaA31v+QtPZ7HbkWRBUmESurrrc9ssJD5UQoNXa hYotKZfMsIg42jVOy2fOYbGHVfqLl39Pl8+TcQ8ABoN+QKy6KVQ+3RpMAK1wFw38eFn6 ARng== X-Gm-Message-State: AOAM531I/Yz5pXbwSfOIOiKmcabQ0zwRh+AigV1nC+VQDu+zYG9eyQN3 HcrKNfY6RPHuhsti2kdkF/8= X-Google-Smtp-Source: ABdhPJwquQamYHSxsC3lEIS7IKvKf6wBEC/mw7iq2LyFO56MVpNoYvwYoPIF2BtEN9I1Oi/rzpa04A== X-Received: by 2002:a63:2262:: with SMTP id t34mr14735801pgm.341.1643104764866; Tue, 25 Jan 2022 01:59:24 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:24 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/19] KVM: x86/mmu: Remove unused "vcpu" of reset_{tdp,ept}_shadow_zero_bits_mask() Date: Tue, 25 Jan 2022 17:58:53 +0800 Message-Id: <20220125095909.38122-4-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm_vcpu *vcpu" parameter of reset_ept_shadow_zero_bits_mask() and reset_tdp_shadow_zero_bits_mask() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/mmu/mmu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index bb9791564ca9..b29fc88b51b4 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4473,8 +4473,7 @@ static inline bool boot_cpu_is_amd(void) * possible, however, kvm currently does not do execution-protection. */ static void -reset_tdp_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, - struct kvm_mmu *context) +reset_tdp_shadow_zero_bits_mask(struct kvm_mmu *context) { struct rsvd_bits_validate *shadow_zero_check; int i; @@ -4505,8 +4504,7 @@ reset_tdp_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, * is the shadow page table for intel nested guest. */ static void -reset_ept_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, - struct kvm_mmu *context, bool execonly) +reset_ept_shadow_zero_bits_mask(struct kvm_mmu *context, bool execonly) { __reset_rsvds_bits_mask_ept(&context->shadow_zero_check, reserved_hpa_bits(), execonly, @@ -4793,7 +4791,7 @@ static void init_kvm_tdp_mmu(struct kvm_vcpu *vcpu) context->gva_to_gpa = paging32_gva_to_gpa; reset_guest_paging_metadata(vcpu, context); - reset_tdp_shadow_zero_bits_mask(vcpu, context); + reset_tdp_shadow_zero_bits_mask(context); } static union kvm_mmu_role @@ -4947,7 +4945,7 @@ void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, bool execonly, update_permission_bitmask(context, true); context->pkru_mask = 0; reset_rsvds_bits_mask_ept(vcpu, context, execonly, huge_page_level); - reset_ept_shadow_zero_bits_mask(vcpu, context, execonly); + reset_ept_shadow_zero_bits_mask(context, execonly); } EXPORT_SYMBOL_GPL(kvm_init_shadow_ept_mmu); From patchwork Tue Jan 25 09:58:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723612 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A78D6C433EF for ; Tue, 25 Jan 2022 10:02:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237939AbiAYKCT (ORCPT ); Tue, 25 Jan 2022 05:02:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238413AbiAYJ72 (ORCPT ); Tue, 25 Jan 2022 04:59:28 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C105BC06173D; Tue, 25 Jan 2022 01:59:27 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id 133so17875929pgb.0; Tue, 25 Jan 2022 01:59:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zKa7O9jly0TmC+XlGqqr6BfbIZ5VWJb9uLLAbrIft7I=; b=N0bWDnPVNDhPyw9vRxjj9dkZtaXUb2VFb7HUs8semTHvhI/1Hd7Hpg9GNm+ML1uuwr /FzSQSLrx8UnlpyDh9fGJnm+T/jKcqPZ1TlPV6NPXlcNlOE9Ifq8SpaPajGGZJ0vK3Lg 2EkE3at11G5IuzfQxA+PrPspn/zspzLS4od1dsKl9icgvhPUbxk9E5LitonWzPMO6r6w zbDEaKJx0+g7AyHm0WEN20Na4//L6325eQK50QbABBAgupk9CPC8MQpbiKtlUp7BtSSy PgQmaJzaTlnDbd9LZGUBwuoKMUpZi13MmsbwOnn5HMipT9iwSh+kmYUFd8QRB9QINgB+ E5iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zKa7O9jly0TmC+XlGqqr6BfbIZ5VWJb9uLLAbrIft7I=; b=HIlUmhcsfVrpAusqrGzqDwFLYBjg7xOG/fovGz4Nj5as6/8ik04NE09gDzAs7As5ry r6Y2WGK1MJHmQ2DQJzmnx5jPh3NylQhaxJbPSZ1a7RlkGDIuv7xA4vXodaGLSnzpf9NU RWGaVsR/Dz+B5Mc7HP3YHl/Ld/XxJZ68Cdx8MuGQkIEDOGS6PE/UuOcesMDe+yE4Mqbq jl4jLA2YTnFhs9a20Nz3P0eszbW/m/UU7Mh12Xiv9ECm6ycoB76mxPBBUgOdzwaQP1FN Tw7C1PhHuYgf4MOsI7S2+SFahiunuIVkJzX/eMafDDdmCiGnqCWJbA1n5QR4JbhpU+Qa m+mw== X-Gm-Message-State: AOAM532a62sHQ6MJo0iiteiIDwgtmkw4FOs+G3BoPn1cxS4lg9t7leFV jEXNc9KhbE/81cEhU/0hlAk= X-Google-Smtp-Source: ABdhPJy1jcF+7YUEA9nKFYorWmaFH66iBFZi30z3MGYnvjZXwMqhEynxgPjjUUDaHaNR6SnlbPmDRg== X-Received: by 2002:a63:f452:: with SMTP id p18mr14741473pgk.545.1643104767312; Tue, 25 Jan 2022 01:59:27 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:27 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/19] KVM: x86/tdp_mmu: Remove unused "kvm" of kvm_tdp_mmu_get_root() Date: Tue, 25 Jan 2022 17:58:54 +0800 Message-Id: <20220125095909.38122-5-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm *kvm" parameter of kvm_tdp_mmu_get_root() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/mmu/tdp_mmu.c | 4 ++-- arch/x86/kvm/mmu/tdp_mmu.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index bc9e3553fba2..d0c85d114574 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -121,7 +121,7 @@ static struct kvm_mmu_page *tdp_mmu_next_root(struct kvm *kvm, next_root = list_first_or_null_rcu(&kvm->arch.tdp_mmu_roots, typeof(*next_root), link); - while (next_root && !kvm_tdp_mmu_get_root(kvm, next_root)) + while (next_root && !kvm_tdp_mmu_get_root(next_root)) next_root = list_next_or_null_rcu(&kvm->arch.tdp_mmu_roots, &next_root->link, typeof(*next_root), link); @@ -203,7 +203,7 @@ hpa_t kvm_tdp_mmu_get_vcpu_root_hpa(struct kvm_vcpu *vcpu) /* Check for an existing root before allocating a new one. */ for_each_tdp_mmu_root(kvm, root, kvm_mmu_role_as_id(role)) { if (root->role.word == role.word && - kvm_tdp_mmu_get_root(kvm, root)) + kvm_tdp_mmu_get_root(root)) goto out; } diff --git a/arch/x86/kvm/mmu/tdp_mmu.h b/arch/x86/kvm/mmu/tdp_mmu.h index 3899004a5d91..599714de67c3 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.h +++ b/arch/x86/kvm/mmu/tdp_mmu.h @@ -7,8 +7,7 @@ hpa_t kvm_tdp_mmu_get_vcpu_root_hpa(struct kvm_vcpu *vcpu); -__must_check static inline bool kvm_tdp_mmu_get_root(struct kvm *kvm, - struct kvm_mmu_page *root) +__must_check static inline bool kvm_tdp_mmu_get_root(struct kvm_mmu_page *root) { if (root->role.invalid) return false; From patchwork Tue Jan 25 09:58:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6F80C433EF for ; Tue, 25 Jan 2022 10:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238855AbiAYKCs (ORCPT ); Tue, 25 Jan 2022 05:02:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238468AbiAYJ7a (ORCPT ); Tue, 25 Jan 2022 04:59:30 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A451C061751; Tue, 25 Jan 2022 01:59:30 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id k17so1215266plk.0; Tue, 25 Jan 2022 01:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oYvl3LXfq2Z7qoIfNjZ5GsgYEqtM3wk9CuvlXSIi+kA=; b=Wlj/sKZXZpqy/o1WYQu+xr6CjK2FGzWSNz5NdVM4P9zzuRB0zxYaBgxFZONutu7xka EmdMealNBliAlnARYU4X5e6CkhJYajhepYqoI/N0tdLPXuG81BbVram+8k1pL562Bw84 /pfACoBuVGEaOyOjBS/beEz03XCBvTQyz3hfFvn64B/FazsZMojNICTOrYx5mO/ms9TE 1Rs7hASxXb9SIZ7nOcfUbIHyn30T1nVeX3J0OEbRER3UKskVCVh4giP6/CFH8yvW2Tjw 8GDcaO4i1nIIK0NXIb4rp9SOBIZ+J5Q1BEc2TnD7wOTzZ+cHs36X9AURRpOy7TQp3XTH sFBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oYvl3LXfq2Z7qoIfNjZ5GsgYEqtM3wk9CuvlXSIi+kA=; b=WwFSA6+RsA6RSnKIkgnaX6VhNF4aOmYDx0053rM7TFCm34JTR4kC//eVBt9hFkhW7A XESk8+HyxGvLaPrAlxuN9qvpAYkXByioxVx8NcACAUMonuP/CbEX/k0bdtIYC3TEGE8+ dszG8wup8C+dP8iSFiWD8q9IiDqs99F2G2u/Z3QZginczrYH/ssn+VE/uL791eapksKZ 2r5TDvLyHDpgzcQNDYYPyDN6ZoibGUc3SpDjqTQD2OV4DPHs847xdTTaer0YtSDKOPIF FOgtmo3JpH+FL0f7QUiWoiCIx+M4diXE+MZ33qEBbU2XphqKECl2agnJZGVRNz1h96gH yB3g== X-Gm-Message-State: AOAM5339MvZeS5uag/5qp1NsVaWrvOVN+GRWmocZQ6D5F6csEXzsgeco zdVNJo4dfpP2glTwHB9zu6M= X-Google-Smtp-Source: ABdhPJwu6Vdz0Bw1KltVyRagJh0tG49h6WEICpjQ7NHc6M397SQTTLplnau8Wgr6EO6lb4bOPLePwg== X-Received: by 2002:a17:90b:3b88:: with SMTP id pc8mr2716352pjb.245.1643104769736; Tue, 25 Jan 2022 01:59:29 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:29 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/19] KVM: x86/mmu_audit: Remove unused "level" of audit_spte_after_sync() Date: Tue, 25 Jan 2022 17:58:55 +0800 Message-Id: <20220125095909.38122-6-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "int level" parameter of audit_spte_after_sync() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/mmu/mmu_audit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu_audit.c b/arch/x86/kvm/mmu/mmu_audit.c index 9e7dcf999f08..f31fdb874f1f 100644 --- a/arch/x86/kvm/mmu/mmu_audit.c +++ b/arch/x86/kvm/mmu/mmu_audit.c @@ -163,7 +163,7 @@ static void audit_sptes_have_rmaps(struct kvm_vcpu *vcpu, u64 *sptep, int level) inspect_spte_has_rmap(vcpu->kvm, sptep); } -static void audit_spte_after_sync(struct kvm_vcpu *vcpu, u64 *sptep, int level) +static void audit_spte_after_sync(struct kvm_vcpu *vcpu, u64 *sptep) { struct kvm_mmu_page *sp = sptep_to_sp(sptep); @@ -225,7 +225,7 @@ static void audit_spte(struct kvm_vcpu *vcpu, u64 *sptep, int level) { audit_sptes_have_rmaps(vcpu, sptep, level); audit_mappings(vcpu, sptep, level); - audit_spte_after_sync(vcpu, sptep, level); + audit_spte_after_sync(vcpu, sptep); } static void audit_vcpu_spte(struct kvm_vcpu *vcpu) From patchwork Tue Jan 25 09:58:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54169C43219 for ; Tue, 25 Jan 2022 10:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238994AbiAYKDP (ORCPT ); Tue, 25 Jan 2022 05:03:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238491AbiAYJ7d (ORCPT ); Tue, 25 Jan 2022 04:59:33 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B69EC06175B; Tue, 25 Jan 2022 01:59:32 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id j16so8192691plx.4; Tue, 25 Jan 2022 01:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j/rRmDiMdmGlDszyCo/+/fHqa/st5+5A7HjoH3NKV08=; b=cYnSfuu7cXdFeqfoM+hegTyG4JSAyN1qSNbeBX1V1k3y0Jlvzele4X5rrqc9MTA70F DzRy3+qKF2rm3varwe20/g098zxwHdokrfUwZEX4Wxogx8HSQ4T7sRoJWww7gUgESoOQ h3G2sIxGvdfDG5pJChVK8Imr40QYdabRIDM+8C8aldKJP7YyycSxpVny2yrr5bsB0mUy 8M3P4MZOAJSiyn46N6gOGXSIHQYSWSAEvduVq3dYxskroY7W7zaqiKsMRGUr/A5komaF qGqADiMqXzL1IgljGbkw5dTH0oSZomXCmAXqtEA4ybI+rASYG3iW76UceqT8kMCWmTyM 4TSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j/rRmDiMdmGlDszyCo/+/fHqa/st5+5A7HjoH3NKV08=; b=sAr1hl1fkusq4RnkvB1m6yt/tg7M1OWu1JoFx6nUoMATRPH4sYFBY2HEZrFdtukdQB 25GIpJROHgb6dFNwl8tNyMp6bL64QmOBkLi7tYpR0Q6PS7A3NDPvSfYgHOa4ZhvHaNd4 sARXegfG2FEc0x4gvWYY9BEkeHli/u8mYLaAQlQMhjxKJOEVqcQsT20ih7/HNH8Kp/L7 6XSr77cM9qjHnANVEW1ZyhzlBJMJ/oYjewssThatKvjaBxwxGgISWJZz13xW9WOgCKxa S+CPib/GR5fGpcTF8uOIdOg4/cTQhzFIT9+hkQaRQknK76QXm3i8J5czXIdvCT2gSFh4 5M1Q== X-Gm-Message-State: AOAM53255f5/VaJgIiFq5ArNl6rmfLBFBz/6kakMVo57EXRA+2Xyf5WD ++AtOE4QqzaRvyVpJPQigGI= X-Google-Smtp-Source: ABdhPJwLivPrqbSTiB4hpRIeQmhCIfmFOKjpzqLDUHj2ySIix16rb7GMsX2N9oGFO7SEmd9UopVAwg== X-Received: by 2002:a17:902:dac6:b0:14b:51c2:5d6d with SMTP id q6-20020a170902dac600b0014b51c25d6dmr8068078plx.3.1643104772108; Tue, 25 Jan 2022 01:59:32 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:31 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/19] KVM: x86/svm: Remove unused "vcpu" of svm_check_exit_valid() Date: Tue, 25 Jan 2022 17:58:56 +0800 Message-Id: <20220125095909.38122-7-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm_vcpu *vcpu" parameter of svm_check_exit_valid() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/svm/svm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 6d31d357a83b..bc733dbadbdd 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -3120,7 +3120,7 @@ static void dump_vmcb(struct kvm_vcpu *vcpu) "excp_to:", save->last_excp_to); } -static bool svm_check_exit_valid(struct kvm_vcpu *vcpu, u64 exit_code) +static bool svm_check_exit_valid(u64 exit_code) { return (exit_code < ARRAY_SIZE(svm_exit_handlers) && svm_exit_handlers[exit_code]); @@ -3140,7 +3140,7 @@ static int svm_handle_invalid_exit(struct kvm_vcpu *vcpu, u64 exit_code) int svm_invoke_exit_handler(struct kvm_vcpu *vcpu, u64 exit_code) { - if (!svm_check_exit_valid(vcpu, exit_code)) + if (!svm_check_exit_valid(exit_code)) return svm_handle_invalid_exit(vcpu, exit_code); #ifdef CONFIG_RETPOLINE From patchwork Tue Jan 25 09:58:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EF8DC4332F for ; Tue, 25 Jan 2022 10:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238952AbiAYKC6 (ORCPT ); Tue, 25 Jan 2022 05:02:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238496AbiAYJ7h (ORCPT ); Tue, 25 Jan 2022 04:59:37 -0500 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42E3C061744; Tue, 25 Jan 2022 01:59:34 -0800 (PST) Received: by mail-pf1-x444.google.com with SMTP id a8so13907222pfa.6; Tue, 25 Jan 2022 01:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=scA+WO/7zy1xEMVYISep/dAL7wm6VBA9xpopPadR530=; b=mZN8F9BJMrFhJhSJVwScLdFEt8dhtp6iOh0kBzJye9ur29QN3+jVxB+5+UJsqojwht jJeNXxT4C74bxDAFgfh2VQcC4RlzsYizLG8gtXFzRa1op4dp3fJxltsvd2tTboN2IOxk L3tIBILIRKwjGUF1Os9oi59SRVOHCjE5wrKMfqBq8SrrKF9jMO4K7id3YOcPaF6I44fB TDeHnSHFBB0Cc1kBIfAD7czYkh0Qs6wqq3uPTsvgpn0JoweE+OyHMo5jd7e0DR90wTFu ZzRnS67P/X3i0GRjFPld2Qo7UVzYETUomV8TTrr56WEziUR6u5mBLsxl2nIuBjUk5XLa xLHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=scA+WO/7zy1xEMVYISep/dAL7wm6VBA9xpopPadR530=; b=cPWLXZlbluYqEVf3FMddr78LTuzDEzmSQxVrwJ6Zmxarhtj34j7fKCel8blhh0KrRC qkoPilOXohjy1AgI7MNdrCvJUOFKwDuEJmxoYKxhZc3fbzIer56v0mZX8f0dV+FH+fgx j3lMQetddXU6JXnVlHMY6JhEd4OJ1QKmWuvB+BuawzZQWxESj5nFpyX3wP0uHkwwbaRy NWxTmsb4ca3Nxr0swmQqaNeshYKtxlGmxkC5aS31r6Gi4uyfGRpfpfH+paVFYbCLjJ64 xVDiNtu3P7toqDE7eYh8bG20j2mivGtbSzorjLxWTQpaYtqV979yfVDph2DC+gAw34c/ Bnlw== X-Gm-Message-State: AOAM532WF6ZvDadgp/4vzR5zlPEPx6mcZDFw5zI2ije98ympgLgZRFS2 RqCJ/WLXNbWB+UFCj8uiJZ0= X-Google-Smtp-Source: ABdhPJxwOLoU1nzuWo/msDqKR1WDXqXoaEO9O2aNuVN6/BK251EHfGQyFCnlmL2XZ1VJmbr+PKN7pw== X-Received: by 2002:a63:7019:: with SMTP id l25mr2991454pgc.321.1643104774522; Tue, 25 Jan 2022 01:59:34 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:34 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/19] KVM: x86/svm: Remove unused "vcpu" of nested_svm_check_tlb_ctl() Date: Tue, 25 Jan 2022 17:58:57 +0800 Message-Id: <20220125095909.38122-8-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm_vcpu *vcpu" parameter of nested_svm_check_tlb_ctl() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/svm/nested.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index cf206855ebf0..5a1a2678a2b1 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -209,7 +209,7 @@ static bool nested_svm_check_bitmap_pa(struct kvm_vcpu *vcpu, u64 pa, u32 size) kvm_vcpu_is_legal_gpa(vcpu, addr + size - 1); } -static bool nested_svm_check_tlb_ctl(struct kvm_vcpu *vcpu, u8 tlb_ctl) +static bool nested_svm_check_tlb_ctl(u8 tlb_ctl) { /* Nested FLUSHBYASID is not supported yet. */ switch(tlb_ctl) { @@ -240,7 +240,7 @@ static bool __nested_vmcb_check_controls(struct kvm_vcpu *vcpu, IOPM_SIZE))) return false; - if (CC(!nested_svm_check_tlb_ctl(vcpu, control->tlb_ctl))) + if (CC(!nested_svm_check_tlb_ctl(control->tlb_ctl))) return false; return true; From patchwork Tue Jan 25 09:58:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDD35C4167B for ; Tue, 25 Jan 2022 10:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239085AbiAYKDe (ORCPT ); Tue, 25 Jan 2022 05:03:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238501AbiAYJ7i (ORCPT ); Tue, 25 Jan 2022 04:59:38 -0500 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61111C06175C; Tue, 25 Jan 2022 01:59:37 -0800 (PST) Received: by mail-pj1-x1043.google.com with SMTP id s2-20020a17090ad48200b001b501977b23so1645027pju.2; Tue, 25 Jan 2022 01:59:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FM5pcNZb9iz5vCSPvdknnsJq7LFJsbOHrnL0CWm1fY8=; b=FfrOVLVxAr1U0q6A89oN8AlGrFHBD6+1usdFkL8nXiF6n39K8Ge8E6UEZAAsBPDYt3 9Mq//E7pGo3kw+v/jmVsKpe4WkikWA3kg0eim03DFhlr/IuYYgL+1FKYjpPLKabTefju lkokuwyGOCYkvdL56Dkf1h6bnSdaa2CI5nP38twHwz5yTv9wDpk1TxO6MUaKOjadKoJR 10dU17vMD4NDYcmlhQ/bdIO7s4XHVeqZhgKkEGKmUe2+KjSuo4tCtY7MOoFqwHBI/G/B J8SGPTV7Tf8RdtJvOaGTO3Wnv2mTBal15pV8kwieBWEsJiHJkXPWdY8qhXZoj+1D6ayH VZgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FM5pcNZb9iz5vCSPvdknnsJq7LFJsbOHrnL0CWm1fY8=; b=y4DQw3Sm9V2ClBO36oUs43Hc/4YEANp053j/+zwBKBmmL5iqyPQixkhBs1IVakte43 skOgwT8DjH8V/9gbtWXtFvcoPpXEZqo+/Gikq1sV99qcIw4a8o0sA3536+m+g2pceR9l D2RuNsfg02HcXIbe3/HA0rcHu7/v/mC5EAwaZX1u1lYAcN46eF/+NqZPhB5pneEPOld3 yuXWiy/2DY+/oQxM1vWLtK4mMsxagrOzykVDXohLFeBBRFZTDCJv/kLZVWwGr6Hvv5TZ Oco+NEXKYP5qqK/nu4SMUSWnE0Z9l+AFUJa0iytNoxsYSumJQDFBo3cgOjfFPi/isdkt R3bg== X-Gm-Message-State: AOAM53356K7n1F3s6Kxtv7bXE34ek7CUafeKwX55Ks+39Bul4c7vi5ly 3BalUGJxXf0fGrW50hojtME= X-Google-Smtp-Source: ABdhPJxI9k7iHgnNBmOf81BloRoGh9PVBlAA/BtGWSejzRigOrY3HL55gaecq97eWoC1PgucwX4jkQ== X-Received: by 2002:a17:902:ed82:b0:14a:9ad8:a146 with SMTP id e2-20020a170902ed8200b0014a9ad8a146mr18004700plj.55.1643104776958; Tue, 25 Jan 2022 01:59:36 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:36 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/19] KVM: x86: Remove unused "vcpu" of kvm_after_interrupt() Date: Tue, 25 Jan 2022 17:58:58 +0800 Message-Id: <20220125095909.38122-9-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm_vcpu *vcpu" parameter of kvm_after_interrupt() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/svm/svm.c | 2 +- arch/x86/kvm/vmx/vmx.c | 2 +- arch/x86/kvm/x86.c | 2 +- arch/x86/kvm/x86.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index bc733dbadbdd..744ddc7ad6ad 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -3737,7 +3737,7 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu) /* Any pending NMI will happen here */ if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) - kvm_after_interrupt(vcpu); + kvm_after_interrupt(); sync_cr8_to_lapic(vcpu); diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index a02a28ce7cc3..62b0335d9ae2 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -6453,7 +6453,7 @@ static void handle_interrupt_nmi_irqoff(struct kvm_vcpu *vcpu, { kvm_before_interrupt(vcpu); vmx_do_interrupt_nmi_irqoff(entry); - kvm_after_interrupt(vcpu); + kvm_after_interrupt(); } static void handle_nm_fault_irqoff(struct kvm_vcpu *vcpu) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 55518b7d3b96..df46d0737b85 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -10094,7 +10094,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) local_irq_enable(); ++vcpu->stat.exits; local_irq_disable(); - kvm_after_interrupt(vcpu); + kvm_after_interrupt(); /* * Wait until after servicing IRQs to account guest time so that any diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index 1ebd5a7594da..651aa7ed5200 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -399,7 +399,7 @@ static inline void kvm_before_interrupt(struct kvm_vcpu *vcpu) __this_cpu_write(current_vcpu, vcpu); } -static inline void kvm_after_interrupt(struct kvm_vcpu *vcpu) +static inline void kvm_after_interrupt(void) { __this_cpu_write(current_vcpu, NULL); } From patchwork Tue Jan 25 09:58:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6332DC4321E for ; Tue, 25 Jan 2022 10:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239064AbiAYKDb (ORCPT ); Tue, 25 Jan 2022 05:03:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238516AbiAYJ7k (ORCPT ); Tue, 25 Jan 2022 04:59:40 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B13C061755; Tue, 25 Jan 2022 01:59:39 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id v3so12559877pgc.1; Tue, 25 Jan 2022 01:59:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nE41yYPMv1zFtz9X94ECgyvNJnmsVPwBnhbwEvP7f3E=; b=QOHgBqmr88TELjvu7ow7qs6mVlO/IpLLPivcSo971gunDB2aTWTaeDwJILuJ2jnGeN eBQiNhAid2Lwe1phF9w7FiAQM/kk9Zdrn3Bphr53O4R8bh+CNN7CJwSSeiMA/+nyvsv8 zwNmADVbtIZaII1GLULpDWwSY/kPQUFI3BveVcftx4UoV62yXgpmAVsx6xJ1hdZtJFMc 0ME6VsXJwrq+XbwPRvyR5e+Yu/ianA7FtRCMMC8k00hbpoBb51DBXXwTTN/SWspJIl1E TFwatVo2/Wt4+pvBFspqQCDIG0fPXPipnZRrSROxTsUSACaqvdMSMhmVOCxM+Ri5Og3q FhNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nE41yYPMv1zFtz9X94ECgyvNJnmsVPwBnhbwEvP7f3E=; b=fURvZI38tldXZfHMp8JeGuAeomfmGy8gpJUCh+v2VUYZamGgG1WQj5EQHdFSGR45wI SgtnwhDnqS3DA915Fcx4SkXtv6MEPKDkbE2nld+GEbabY2vvk+KhB29KJQHG6ow+a17R VXwZsct4kj8cAvPOeJgAeqeQyk75aj9DD7bgTGdVd/cw3gjri05wSvQa5wogxTWOd7w4 xsYGwYpA9/R//gp+Gr8tltoMJt8zB2CAkPdadmuVN743bR4JCoS7q0FcotvoRMelQEWS oy96fAfHgpJFgau+/EMSOouxcIyKatj1PoQTMqXS4yBQTfEyoEw/PjXPPA1/auFEhR+P BJaQ== X-Gm-Message-State: AOAM533o72sa7WSpwBb5vlsfWGFhpvNQj97N11JvXEDfuOXI89xPntWh DlWANyg9c/YVUMHz1IWk0Cg= X-Google-Smtp-Source: ABdhPJzHX7bMzjHlAQz7S1myug705M1pTgB4K+zlQhlFPEQCrmaQ6lkr7d7MP/x7zngSMZPAKYfDrA== X-Received: by 2002:a63:1053:: with SMTP id 19mr14746034pgq.478.1643104779383; Tue, 25 Jan 2022 01:59:39 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:39 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/19] KVM: x86/svm: Remove unused "svm" of sev_es_prepare_guest_switch() Date: Tue, 25 Jan 2022 17:58:59 +0800 Message-Id: <20220125095909.38122-10-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct vcpu_svm *svm" parameter of sev_es_prepare_guest_switch() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 2 +- arch/x86/kvm/svm/svm.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 6a22798eaaee..eae234afe04e 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -2902,7 +2902,7 @@ void sev_es_vcpu_reset(struct vcpu_svm *svm) sev_enc_bit)); } -void sev_es_prepare_guest_switch(struct vcpu_svm *svm, unsigned int cpu) +void sev_es_prepare_guest_switch(unsigned int cpu) { struct svm_cpu_data *sd = per_cpu(svm_data, cpu); struct vmcb_save_area *hostsa; diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 744ddc7ad6ad..3e75ae834412 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1276,7 +1276,7 @@ static void svm_prepare_guest_switch(struct kvm_vcpu *vcpu) * or subsequent vmload of host save area. */ if (sev_es_guest(vcpu->kvm)) { - sev_es_prepare_guest_switch(svm, vcpu->cpu); + sev_es_prepare_guest_switch(vcpu->cpu); } else { vmsave(__sme_page_pa(sd->save_area)); } diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index 47ef8f4a9358..0a749bbda738 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -622,7 +622,7 @@ int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in); void sev_es_init_vmcb(struct vcpu_svm *svm); void sev_es_vcpu_reset(struct vcpu_svm *svm); void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector); -void sev_es_prepare_guest_switch(struct vcpu_svm *svm, unsigned int cpu); +void sev_es_prepare_guest_switch(unsigned int cpu); void sev_es_unmap_ghcb(struct vcpu_svm *svm); /* vmenter.S */ From patchwork Tue Jan 25 09:59:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89D31C433F5 for ; Tue, 25 Jan 2022 10:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239132AbiAYKDs (ORCPT ); Tue, 25 Jan 2022 05:03:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238524AbiAYJ7q (ORCPT ); Tue, 25 Jan 2022 04:59:46 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D22C061756; Tue, 25 Jan 2022 01:59:42 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id nn16-20020a17090b38d000b001b56b2bce31so2271291pjb.3; Tue, 25 Jan 2022 01:59:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YCL/z3KlGNzFsVCJ/3z3F4LH/FmJiw0KoHdi2KVVmgk=; b=gVcJuLPGV54zqq+spLjzSiaCND99bX63oHpJ6CucKDneVPQ4zgveS0nl2SuK31c6WA s9/RSvBxt2ab6cAM0aUY73Uuak5ORezldkllhRLXYip2s/qgHeJFndT2ZubDM8nCt6o2 AJcobDggVSijg32KWNmyczUK8JwgPMo6KXhvnuPY5sPBvBYt1bkqVl3G1MUeUimsJPn4 MvSg62qys7MfPTPR50RkZ8kBjZW4jOq1MjtzHVFWeYbDhZBJCLMWogYlyGVlL7e3SmWN OX46SAWqxHw/qTyZNzIQodX5UuLkJXJC8X+Kphs6LipNnawwZpfeZQU24LaDmWr2Y6Ji 8VMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YCL/z3KlGNzFsVCJ/3z3F4LH/FmJiw0KoHdi2KVVmgk=; b=cSg0lMUcuzbuyjoVhJNgGb8IdV9podlYSUJmVBJpL9nhduiD0fsI0Z6EmpscfCfd21 1QYgV96YcDWNL8jPKWfCAZHfY1Qj+lFPCY0Xnv53+oRsUxEr6j794S0KRt8hwrf4U+Gj Xv8GTrEk7SgG99xCzZ8Y2k4sSU1cVdZfItWOG95IyO4P+8uTB7hkuCK6BHkyQ0NJjYBq IVQKlS0YgzqlWWo1Elk/dwm3B2ZOP25iicpZmn159uiJsQ4QAbIzq7Z93t3k7C/vWIxq qtQ/t0Sk0btJGit8xByYYEgZnIFotf/VfHIOVivh0LLngPYF3ppQHI2Jt0kKv7vguJUb 1xVA== X-Gm-Message-State: AOAM532FWQaACbs7spEGo0GDhVwnoaP5bXi8DizXlYnknD01J/R+aqJf yLj2nCgYjJPT9/hPaY8EOls= X-Google-Smtp-Source: ABdhPJzPVmkIK7wMi/i4VnSk7XEpJzBzxl3aNCucA2MqQnRG7cLZU+sJOmCW3ilnTvg4V0olJVHGuQ== X-Received: by 2002:a17:90a:f413:: with SMTP id ch19mr2650547pjb.19.1643104781737; Tue, 25 Jan 2022 01:59:41 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:41 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/19] KVM: x86/sev: Remove unused "kvm" of sev_unbind_asid() Date: Tue, 25 Jan 2022 17:59:00 +0800 Message-Id: <20220125095909.38122-11-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm *kvm" parameter of sev_unbind_asid() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/svm/sev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index eae234afe04e..0727ac7221d7 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -217,7 +217,7 @@ static void sev_decommission(unsigned int handle) sev_guest_decommission(&decommission, NULL); } -static void sev_unbind_asid(struct kvm *kvm, unsigned int handle) +static void sev_unbind_asid(unsigned int handle) { struct sev_data_deactivate deactivate; @@ -363,7 +363,7 @@ static int sev_launch_start(struct kvm *kvm, struct kvm_sev_cmd *argp) /* return handle to userspace */ params.handle = start.handle; if (copy_to_user((void __user *)(uintptr_t)argp->data, ¶ms, sizeof(params))) { - sev_unbind_asid(kvm, start.handle); + sev_unbind_asid(start.handle); ret = -EFAULT; goto e_free_session; } @@ -1426,7 +1426,7 @@ static int sev_receive_start(struct kvm *kvm, struct kvm_sev_cmd *argp) if (copy_to_user((void __user *)(uintptr_t)argp->data, ¶ms, sizeof(struct kvm_sev_receive_start))) { ret = -EFAULT; - sev_unbind_asid(kvm, start.handle); + sev_unbind_asid(start.handle); goto e_free_session; } @@ -2078,7 +2078,7 @@ void sev_vm_destroy(struct kvm *kvm) } } - sev_unbind_asid(kvm, sev->handle); + sev_unbind_asid(sev->handle); sev_asid_free(sev); } From patchwork Tue Jan 25 09:59:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C435DC433FE for ; Tue, 25 Jan 2022 10:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239273AbiAYKEB (ORCPT ); Tue, 25 Jan 2022 05:04:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238517AbiAYJ7q (ORCPT ); Tue, 25 Jan 2022 04:59:46 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73BBEC06175E; Tue, 25 Jan 2022 01:59:44 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id q63so14779972pja.1; Tue, 25 Jan 2022 01:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gJXu3XDntG3sYuZsaAy93XgNQyjjQDdCF6KOBgCQ6T8=; b=l4Qf+2yFfQZKC8zuNjxLmbGXa1WmfnQIutDsVBe4VjYUa30G4bJXmx8CRWmeXK9tAO 16zdGhUe2dZtpd41xgzg4prgqcEizIpe/A/MBeTbUei/FcP4l08vTIU9A4WfOBlt7a2I vOJ9FkxOGwfBlEUY5drA+6kClr19yU/LSKTG8l9iRo9LRycWlOChrLg4brdA3ymmGFSS IlgsK2WmixCkmUNCbglGLRHXZ5UX8KtYPFh+k2yXkFp0y61KdH/JjUb5ZNEXFcWE6fnF mkaNdk2YBpuwgT7J74DUQoOFXdDTmih93v9KsoISfsi6D1fompENqtP+1AESiVvFjT8a 164w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gJXu3XDntG3sYuZsaAy93XgNQyjjQDdCF6KOBgCQ6T8=; b=GaVBo7CJ4tPTAsq4LCI6AS7VvgSdmqOLe5rEqPKjuYof9mrTAaVRKH1GZtXkkAe8Ms c0lPVUPK/YN+k4A3QA3klvfzcPMKWJF2zbutLDEWl8gXu637sGrNc+foFVaCS0TfTKe0 sx1A0mixSVxHXmbObE4MzC2xpaOuvTqgpxEqHjxZ4nkqX6ieniPflF9LDsB/6083m+aq sjNwLeqx9P+0bwxOTPdzPWX2Dvl96Q+qy43ebSYqB9FdyTBiHPQLStsTnmG7j8G2oo+6 sHFnoTtzRAIkq9DrQU+A6SAogWItFFd+/z6MfN5mfrRWDlcWFiNePBTMUvdMsS7fgpUT KRFw== X-Gm-Message-State: AOAM532kGCLTdyeSVKCH2YpPSaWOWg1mHUZbnIICJ1qIFTBYqd3L1PuC SLUkf76IakwcvbHpqv1u/Izw9TFkWJsqUQ== X-Google-Smtp-Source: ABdhPJxmvtMII3KhHayu1fLjLASIEeiLAP6uRb1v+w7SNfbXr/hHJ4ol7JH0ir2ec2HDUxEViqz3vg== X-Received: by 2002:a17:90b:3148:: with SMTP id ip8mr2731496pjb.72.1643104784108; Tue, 25 Jan 2022 01:59:44 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:43 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/19] KVM: x86/svm: Remove unused "vector" of sev_vcpu_deliver_sipi_vector() Date: Tue, 25 Jan 2022 17:59:01 +0800 Message-Id: <20220125095909.38122-12-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm_vcpu *vcpu" parameter of sev_vcpu_deliver_sipi_vector() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 2 +- arch/x86/kvm/svm/svm.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 0727ac7221d7..2fd1e91054b3 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -2925,7 +2925,7 @@ void sev_es_prepare_guest_switch(unsigned int cpu) hostsa->xss = host_xss; } -void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) +void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 3e75ae834412..aead235a90ee 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -4348,7 +4348,7 @@ static void svm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) if (!sev_es_guest(vcpu->kvm)) return kvm_vcpu_deliver_sipi_vector(vcpu, vector); - sev_vcpu_deliver_sipi_vector(vcpu, vector); + sev_vcpu_deliver_sipi_vector(vcpu); } static void svm_vm_destroy(struct kvm *kvm) diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index 0a749bbda738..61c96f4a7006 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -621,7 +621,7 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu); int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in); void sev_es_init_vmcb(struct vcpu_svm *svm); void sev_es_vcpu_reset(struct vcpu_svm *svm); -void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector); +void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu); void sev_es_prepare_guest_switch(unsigned int cpu); void sev_es_unmap_ghcb(struct vcpu_svm *svm); From patchwork Tue Jan 25 09:59:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3684C433EF for ; Tue, 25 Jan 2022 10:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239468AbiAYKEX (ORCPT ); Tue, 25 Jan 2022 05:04:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238530AbiAYJ7r (ORCPT ); Tue, 25 Jan 2022 04:59:47 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02508C06175F; Tue, 25 Jan 2022 01:59:47 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id c9so18743507plg.11; Tue, 25 Jan 2022 01:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xy58X9ZqsU+Q+x1fD7dGP98jr1M3OQ5O7hFyw/uTpBo=; b=K1csWq0YFWq17jyYUVKdjSWRmI9iFTTulrCS8E81NVmcF5tVCX3tYwOWDkjGG9uDgZ S71g6dScNDDK2kJIyb2zRwlBRLJTTbhLWCO645QTYytf+zmY+jUpVtCGl+Y8+mNl/Ood VEWfj0YcCnbZkgUh/bExJckvquMNY6e0BUEhYRgi3aCmG/rJR4Bsy6kjcYzIWKOYd7sO LWHfi6ey9ev+O5OGhH0gHOWYUP4Hf7rJclBZMvxDrfO8llYsi7P+3se3Q4I/RACKbTXL uZULM8kNpohHbIkOhTDcHenEGFdd9PhcwuvOSi+qILGzQMK5+N1h27WtT3Q5kTqIHBJm 8vFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xy58X9ZqsU+Q+x1fD7dGP98jr1M3OQ5O7hFyw/uTpBo=; b=lfbgLCbeZ9xJ757YWtxo6wX5QOjd/D+dzSslWolgFweSfBMn3fXEasblRvoGlrB3wg r7OODd4b/zvIMCJbFfrb44gmzqB+WOT7Nj4fU87pYy+UsuK0AmX7AzSUThYWqPIQIX0m YUV0zGra2otcOfW5cOFSixbAqRRAE9QZUx8xhCiiscX63Tw7ItAvKsbaONRzZRkYWK9d QW0K0vIHhBXBIFv29LIaIXiQpljrYxCE4t5k5PfEdNOq1aPmIfy22gWrdBfq8Iqt7bYP osmr/gOkiNQOI3oLxSuvNbIfAzTkprH4EFZPn01K/Hz13MdpRl1nrvWgmp/bU3LSbLJa bONw== X-Gm-Message-State: AOAM532eDyDas/kOPoDztzgBMD5q0OdZtQLoWh22WulDMa7g6MTyzCBS rUJzfqCN5qKir0edeUVxB2Q= X-Google-Smtp-Source: ABdhPJzhUcAag9bH49+qyomod77yB4zrMr6c2mVnNwikP5K8xDfXGKVEcCyL1nqCdpa2kl1JeFxt0g== X-Received: by 2002:a17:90a:5503:: with SMTP id b3mr2630839pji.187.1643104786499; Tue, 25 Jan 2022 01:59:46 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:46 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/19] KVM: x86/i8259: Remove unused "addr" of elcr_ioport_{read,write}() Date: Tue, 25 Jan 2022 17:59:02 +0800 Message-Id: <20220125095909.38122-13-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "u32 addr" parameter of elcr_ioport_write() and elcr_ioport_read() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/i8259.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index 814064d06016..be99dc86293d 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c @@ -437,13 +437,13 @@ static u32 pic_ioport_read(void *opaque, u32 addr) return ret; } -static void elcr_ioport_write(void *opaque, u32 addr, u32 val) +static void elcr_ioport_write(void *opaque, u32 val) { struct kvm_kpic_state *s = opaque; s->elcr = val & s->elcr_mask; } -static u32 elcr_ioport_read(void *opaque, u32 addr1) +static u32 elcr_ioport_read(void *opaque) { struct kvm_kpic_state *s = opaque; return s->elcr; @@ -474,7 +474,7 @@ static int picdev_write(struct kvm_pic *s, case 0x4d0: case 0x4d1: pic_lock(s); - elcr_ioport_write(&s->pics[addr & 1], addr, data); + elcr_ioport_write(&s->pics[addr & 1], data); pic_unlock(s); break; default: @@ -505,7 +505,7 @@ static int picdev_read(struct kvm_pic *s, case 0x4d0: case 0x4d1: pic_lock(s); - *data = elcr_ioport_read(&s->pics[addr & 1], addr); + *data = elcr_ioport_read(&s->pics[addr & 1]); pic_unlock(s); break; default: From patchwork Tue Jan 25 09:59:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723626 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA102C43217 for ; Tue, 25 Jan 2022 10:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240151AbiAYKE4 (ORCPT ); Tue, 25 Jan 2022 05:04:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238537AbiAYJ7u (ORCPT ); Tue, 25 Jan 2022 04:59:50 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 553EBC061760; Tue, 25 Jan 2022 01:59:49 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id u130so14981644pfc.2; Tue, 25 Jan 2022 01:59:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oOTkb+Q9/amZvPIG5yANfVQOPdgSqbGAc2I9WSO6Uo0=; b=LBKx/2P/Nl1mXqyOzGdfy6es73hzU5cLrnMBc/8D16QS4gzweCSUg053vZdQQHEoJk smcJuXwuzajr4jO4qDb5Ww/Uiol3edThXD4KBPUAztqdEPweLxBQy3R0STBvQqqz/58Z Nuaf7ehMAXc55act5ScYkDhjxSL2DePwQbmTv7M+f9vef6Hjyf9TTlrYlEyrcvNfP0wx brm0XIu+xUWSIr4gdqplgchY/MgX/E+ibf//YmXtkHV9kgnj1GBTqD3ZVSXv55hcAdn0 BXwhZxM7h+pTt1a/wO5YE6xTNgUrdyl/IIvp6LuqgNQpQQct73eRP2hY5TNGopp5kos9 2BRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oOTkb+Q9/amZvPIG5yANfVQOPdgSqbGAc2I9WSO6Uo0=; b=hrxvrEb9EzISCE7OOzHPt+RcUKKZRWuunVWwwXh0T2kfTCJHMlJgzp9fw+todTVzhT d4cXOaswGuvYW5xxDpBiJNwTGplbxN0ThOJWHBCNYLebu/SoIkSkb9aJVsJZcvCayzLR glAyy5XhjgEBivvnj1K/dfIj/daUAKpy1i+GP+by6xFEInZ3LPaMYEthQcRa8Xu/ipg7 RAiB2frk4+IExJZFRt162aSoUfCXUflVnIW23Smr3VyeI0HAqM5nlrqKrnHSKQq/PwIU SgXv/6DVQAWsUFBCMUbdqXsFtREjjfRFJKAVNKqEDNwLNOZ21P+WMLBHU3q4qEdSwlzH LWgw== X-Gm-Message-State: AOAM530bx9el1CNdK3d9wtn5AlcRPxYyfSoaUaCKjJoKyLszSXZ0xKLK oHrvt6+F60tjq4ptH/a/TWQP9yvfxSmMvA== X-Google-Smtp-Source: ABdhPJxA+sRmuOjK5WwrchT84Iisf5iF/g6SB9x+mzdxo7GQSXv+7UqPZOxad0NFRp/xYRJPZ6Nl/w== X-Received: by 2002:a05:6a00:10d0:b0:4c9:1d31:c596 with SMTP id d16-20020a056a0010d000b004c91d31c596mr8357350pfu.73.1643104788970; Tue, 25 Jan 2022 01:59:48 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:48 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/19] KVM: x86/ioapic: Remove unused "addr" and "length" of ioapic_read_indirect() Date: Tue, 25 Jan 2022 17:59:03 +0800 Message-Id: <20220125095909.38122-14-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "unsigned long addr" and "unsigned long length" parameter of ioapic_read_indirect() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/ioapic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index decfa36b7891..765943d7cfa5 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c @@ -54,9 +54,7 @@ static void kvm_ioapic_update_eoi_one(struct kvm_vcpu *vcpu, int trigger_mode, int pin); -static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic, - unsigned long addr, - unsigned long length) +static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic) { unsigned long result = 0; @@ -593,7 +591,7 @@ static int ioapic_mmio_read(struct kvm_vcpu *vcpu, struct kvm_io_device *this, break; case IOAPIC_REG_WINDOW: - result = ioapic_read_indirect(ioapic, addr, len); + result = ioapic_read_indirect(ioapic); break; default: From patchwork Tue Jan 25 09:59:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8537DC433FE for ; Tue, 25 Jan 2022 10:05:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240154AbiAYKE5 (ORCPT ); Tue, 25 Jan 2022 05:04:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238549AbiAYJ7w (ORCPT ); Tue, 25 Jan 2022 04:59:52 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB7DC061757; Tue, 25 Jan 2022 01:59:51 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id u10so14717391pfg.10; Tue, 25 Jan 2022 01:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2dd3yWlp7t7pUwagBpLgmf/wkJEyGPWss2ymxB0oGHo=; b=jC4Sm+nkUlDMgAPZXuN73FYNW/Z4JlUQZx9m0wPJtOe/TIjnoTDMqt+a32QpKq5zv+ RPjWRCKyBpMNhwI/EQcLAUbM6OO/EDb7Rygw+0+W0nHcTjx/LXlbG4rXcfyrw0gYOasU B75qAj6TeLYa34LX+x3qhcGu2p9HvuxfOQKkhl3kTVwqnScorGnRY5R8pO/Mrpc8h9Ib pqersKjlq/BzCdmq5erlJl/bSDqV0cZQHuJrCPO2Gx6ezIo0oQ279edHM0y6bv9IaY5+ 300Q6s8byykPqIGAQmEsJuDWhmgM6dVVa3keXi3539+EJW8RkCAxYBQ+MreBKIOL4+Nh J+Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2dd3yWlp7t7pUwagBpLgmf/wkJEyGPWss2ymxB0oGHo=; b=OdxQwgo+uTXLJAEeAiFOGnqzbn1a7gNIHFh8qCd3nO+pev/hcJFuISrFbqCAyY0fhb 6ZnTbSnujV1dN/O5p5LOkrpNT8FcOQi4ofVAU+uwlR+vZu9+OPzu4CgFeQyh0jSz/UyV DBiFiu11pWQZr8vU6wP6FVWN6Wd+JgzGM2uZ5kxrlnYjHQOUFia2xrwbyrRq26qhNbDW i0yDNKDoyO/evG0c/f2sbvG+bPw1yx6XlTI1XhlpPy8rXrkyuK3ED/n2MqxyDoMN0Yhk Q7AVf5DHIwjdiokXO2DlqumUHNlGJEjRaxIQhkhlLSUWiIp+EQhHnfJ/uodQp7VdVbOL qVlQ== X-Gm-Message-State: AOAM533rr3OFJe/HbnqqmHKuT703lZyLnJdZY04Ywk/LfSdAMv4liMMP k8nrCEuyjPo9q+jcB384lyY= X-Google-Smtp-Source: ABdhPJxyrj6nMBx1HXE+BU8tZnWfLwnZQtbPsFDyqQr6OzRIaEDbRM13Gm24MEqImq8PyzBv8bvTjA== X-Received: by 2002:a05:6a00:a92:b0:4c5:90cb:71e4 with SMTP id b18-20020a056a000a9200b004c590cb71e4mr17548664pfl.1.1643104791447; Tue, 25 Jan 2022 01:59:51 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:51 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/19] KVM: x86/emulate: Remove unused "ctxt" of setup_syscalls_segments() Date: Tue, 25 Jan 2022 17:59:04 +0800 Message-Id: <20220125095909.38122-15-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct x86_emulate_ctxt *ctxt" parameter of setup_syscalls_segments() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/emulate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 166a145fc1e6..c2d9fe6449c2 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2608,8 +2608,7 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt) } static void -setup_syscalls_segments(struct x86_emulate_ctxt *ctxt, - struct desc_struct *cs, struct desc_struct *ss) +setup_syscalls_segments(struct desc_struct *cs, struct desc_struct *ss) { cs->l = 0; /* will be adjusted later */ set_desc_base(cs, 0); /* flat segment */ @@ -2698,7 +2697,7 @@ static int em_syscall(struct x86_emulate_ctxt *ctxt) if (!(efer & EFER_SCE)) return emulate_ud(ctxt); - setup_syscalls_segments(ctxt, &cs, &ss); + setup_syscalls_segments(&cs, &ss); ops->get_msr(ctxt, MSR_STAR, &msr_data); msr_data >>= 32; cs_sel = (u16)(msr_data & 0xfffc); @@ -2766,7 +2765,7 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt) if ((msr_data & 0xfffc) == 0x0) return emulate_gp(ctxt, 0); - setup_syscalls_segments(ctxt, &cs, &ss); + setup_syscalls_segments(&cs, &ss); ctxt->eflags &= ~(X86_EFLAGS_VM | X86_EFLAGS_IF); cs_sel = (u16)msr_data & ~SEGMENT_RPL_MASK; ss_sel = cs_sel + 8; @@ -2803,7 +2802,7 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt) ctxt->mode == X86EMUL_MODE_VM86) return emulate_gp(ctxt, 0); - setup_syscalls_segments(ctxt, &cs, &ss); + setup_syscalls_segments(&cs, &ss); if ((ctxt->rex_prefix & 0x8) != 0x0) usermode = X86EMUL_MODE_PROT64; From patchwork Tue Jan 25 09:59:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723624 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14651C433F5 for ; Tue, 25 Jan 2022 10:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239788AbiAYKEk (ORCPT ); Tue, 25 Jan 2022 05:04:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238553AbiAYJ7y (ORCPT ); Tue, 25 Jan 2022 04:59:54 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C12C061759; Tue, 25 Jan 2022 01:59:54 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id h23so17807615pgk.11; Tue, 25 Jan 2022 01:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CubPfo8X6E6cLCRQ+9YQFpgd03CzrlDLAlSclXyiqwM=; b=TYu2hzxhyUdjSdW4KzB0PgKW9Qz71gcHjEYoVWvjdSBfpPlHxw+0PXC3VLvLMHIFK2 a/j+0xzi533KhtP5gZ2w+vyWVf6354B3agubc74M5PlKNK4Tobp0/tSCK303cMHbLMfn shESi3Aq3g/9NY8RhCzvqHCcQTB7DK6JdosachSbNEr/s/XSoYUSuwOW4h7tO9sFwijT nvO8sYjQa1brA8xJLIc8dHlMo/mTdGLOASpxM0LUA0r4ctZPplYRzQXhUC+gkClZrlRD XgRtg2S94K6Oww8Ks5nj434KY4EsDg7N+BpWEutSU/Q8ICBZePIVh97sPlevCORJhh5J Z0uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CubPfo8X6E6cLCRQ+9YQFpgd03CzrlDLAlSclXyiqwM=; b=BVfCIhqgRncsrU11mybbMqQdHKF5Gk1GZPCZziRT1bJbShnddOZE67V6LOKbMelCbV SZsyaTi/TT/wnJa/l6mjW27QUFWPHzRb386pg69JbFsURbrDGPgTbbJrVl0l9JMRQ4vD klOkDBB0qautA5CTRTDqiMr1OXjL/UHK57vEpVaqqd0whwH1etAz9xMb5+DKxq9mQozH odl5bGYTMvYyEdcjVQrhbbJN2YIQrooNh1qqQ4w3DdHyBM+y6zK7j30cAXb8FfOJxuzU tjsQUlE+5OlT/kFyEfryhvHz1sX4zjj5ABpNZKJDcKNcLuLCmO/JRGaP0goFzXph7b1F h3nQ== X-Gm-Message-State: AOAM531c9/hzQFl1+08UYqEv/SA2QwtNGgn1ZZ7QQ2JMmDkN5Nvy2Bw4 QO21d1ZNPsfAzKZL8FuCjUs= X-Google-Smtp-Source: ABdhPJz9mzW3DR7bpfB4++1k/wQOade45pfCyNWq75tTufotEG/+KFC05x9/DGi+H0VIlfK+eR8Eaw== X-Received: by 2002:a05:6a00:15ce:b0:4ca:5090:dbe6 with SMTP id o14-20020a056a0015ce00b004ca5090dbe6mr4828275pfu.84.1643104793842; Tue, 25 Jan 2022 01:59:53 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:53 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/19] KVM: x86/emulate: Remove unused "ctxt" of task_switch_{16, 32}() Date: Tue, 25 Jan 2022 17:59:05 +0800 Message-Id: <20220125095909.38122-16-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct x86_emulate_ctxt *ctxt" parameter of task_switch_{16, 32}() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/emulate.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c2d9fe6449c2..9e4a00d04532 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3020,8 +3020,7 @@ static int load_state_from_tss16(struct x86_emulate_ctxt *ctxt, return X86EMUL_CONTINUE; } -static int task_switch_16(struct x86_emulate_ctxt *ctxt, - u16 tss_selector, u16 old_tss_sel, +static int task_switch_16(struct x86_emulate_ctxt *ctxt, u16 old_tss_sel, ulong old_tss_base, struct desc_struct *new_desc) { struct tss_segment_16 tss_seg; @@ -3159,8 +3158,7 @@ static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt, return ret; } -static int task_switch_32(struct x86_emulate_ctxt *ctxt, - u16 tss_selector, u16 old_tss_sel, +static int task_switch_32(struct x86_emulate_ctxt *ctxt, u16 old_tss_sel, ulong old_tss_base, struct desc_struct *new_desc) { struct tss_segment_32 tss_seg; @@ -3268,10 +3266,9 @@ static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, old_tss_sel = 0xffff; if (next_tss_desc.type & 8) - ret = task_switch_32(ctxt, tss_selector, old_tss_sel, - old_tss_base, &next_tss_desc); + ret = task_switch_32(ctxt, old_tss_sel, old_tss_base, &next_tss_desc); else - ret = task_switch_16(ctxt, tss_selector, old_tss_sel, + ret = task_switch_16(ctxt, old_tss_sel, old_tss_base, &next_tss_desc); if (ret != X86EMUL_CONTINUE) return ret; From patchwork Tue Jan 25 09:59:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B5F8C4332F for ; Tue, 25 Jan 2022 10:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239881AbiAYKEn (ORCPT ); Tue, 25 Jan 2022 05:04:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238559AbiAYJ75 (ORCPT ); Tue, 25 Jan 2022 04:59:57 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3C33C061762; Tue, 25 Jan 2022 01:59:56 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id z5so4853359plg.8; Tue, 25 Jan 2022 01:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YnN/7fp1e87Xkb15yeqSf2q+9XCvC4rYSD1MfFhGDFg=; b=Bb7ez8ndfUaWuwAE5qwgFjDjKsFfdcKEcLWJ21pvJsV+7H40n2LLgR+wbaEcEFJnYK t0Wcjc69jL7xc+uVD/cOq88PAMXcCcMFEwmcMvTuXDJK0DnDu6nuQ2N5ViPk+oDxF9ud fr4s7Emv6ybchbE0aSqVCnQHOC+MP22XFTV5HTap2T+t4kuxB6PTP2Ab/X6f5UaXNtKk tjgNBWhtKzyDl8GEg+Dobl06vZXkhEKdVZe7gYr4v4RKsCfNpzr+RbFqGmLWFMarWB+i NFS3DiG74nRvai2QhAcFlS/arZVn+qE/PRqAWfCXuLa1w7BZK6ocXvaWXCyjVuOShzRh OCkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YnN/7fp1e87Xkb15yeqSf2q+9XCvC4rYSD1MfFhGDFg=; b=YIDMgE5Bf2pxwwNYnbHqfWVCG6oZhGXboju0b8GKuNbwJzaIQloMG5zM4vMwIAhCwg zyn/0IIQ9xZxS9U9go0c1esyuTB6QDRgF92I3c5vDPyAFBwMfJxObWTaF1C+NU6/6/Ma 2rB7HjQ3kGmPXg9sRTAI1lgCSZzFg3AAGEFwGHOVtKQemLh/kUab4CkhVeA1rCXt2Jij 2MldRw2jZa9rnQe/EqMV479pqOebk4p9Ddnp75SXb1CtL+48vEOUfI5q0TszuDLT26ju hsknWjX7W7vxIABebEVgZVk+9TBU2OLoA0KOMHP6ipu/7frriL15vk5Mpu1NOBD+b2T8 jQJg== X-Gm-Message-State: AOAM5313FYP6dv/21I9bJKoOPf87jDsDEDeZIrcPv+sTGk2x9sC4L7yk k5wpnUyRJBVa+4/9tueSIy0= X-Google-Smtp-Source: ABdhPJw8R5DkDfp8TLbsqdtNRklBVYWp57XWzVzCBV18mZEznh+5aak3Hh+XKXheTJPyoak47oCAMQ== X-Received: by 2002:a17:90a:7891:: with SMTP id x17mr2699783pjk.112.1643104796316; Tue, 25 Jan 2022 01:59:56 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:56 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/19] KVM: x86: Remove unused "vcpu" of kvm_arch_tsc_has_attr() Date: Tue, 25 Jan 2022 17:59:06 +0800 Message-Id: <20220125095909.38122-17-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm_vcpu *vcpu" parameter of kvm_arch_tsc_has_attr() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/x86.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index df46d0737b85..22b73b918884 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5003,8 +5003,7 @@ static int kvm_set_guest_paused(struct kvm_vcpu *vcpu) return 0; } -static int kvm_arch_tsc_has_attr(struct kvm_vcpu *vcpu, - struct kvm_device_attr *attr) +static int kvm_arch_tsc_has_attr(struct kvm_device_attr *attr) { int r; @@ -5099,7 +5098,7 @@ static int kvm_vcpu_ioctl_device_attr(struct kvm_vcpu *vcpu, switch (ioctl) { case KVM_HAS_DEVICE_ATTR: - r = kvm_arch_tsc_has_attr(vcpu, &attr); + r = kvm_arch_tsc_has_attr(&attr); break; case KVM_GET_DEVICE_ATTR: r = kvm_arch_tsc_get_attr(vcpu, &attr); From patchwork Tue Jan 25 09:59:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E2F3C433F5 for ; Tue, 25 Jan 2022 10:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240587AbiAYKFi (ORCPT ); Tue, 25 Jan 2022 05:05:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238590AbiAYJ77 (ORCPT ); Tue, 25 Jan 2022 04:59:59 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F526C061763; Tue, 25 Jan 2022 01:59:59 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id k17so1216444plk.0; Tue, 25 Jan 2022 01:59:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9H2RK8DHWUQ8flbtobvjjEJWkT4wxuUh6nAS0SNRdvM=; b=LYVSwsR5VkUmnzLoKDW0Dh5QOI7K7kPhc0fcFv74Z6QR/gjEnpEvmD0RhwikT3W+HO sjbN/N9zwH2JJtzPrGmLiWm/FWlDNbj0exJG2+e+b61AjIfX2bQ2iLscQd2OvLEm739u VdNo1rmcOHrdpnU6mfcAeiljwxcZCG0b58J8JIYyQV2hzRez5s4ZhHeV+poWSie6L1R+ lk8G6BXQMj1/pQgQoFCSC/zoywMtilUbEshVKKwKQEXh5q3R3SwZN545iW0A/AwtUJMV f+9J7bnuqk4k5v8Z+qGw4EytTBbjU+c1EsyCSiii8TxQVs7XOzT2JyT4sZtHn4dMgvOe Kmjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9H2RK8DHWUQ8flbtobvjjEJWkT4wxuUh6nAS0SNRdvM=; b=lDyb4qO8XV+Epr9VIk6GUkvXW1DT+01W/pnrvnxkni+F1XRmfFb/uVqZnbw3IDnrA6 ondmmzCcx0AVpgBbE721gZzmdkUVk0rbbVH9PEL4sUGF1htGdkMX3dJJMf7dsS3mKKXe KFt83N63pPe9ozS9iZoiPMoJTw3EAq18RsHcH1VxLFZff3z0XnstqcF9Z//eY03VJA60 6OEwSbbgPS1Cpj1fQ8hN1IYIjYQstgf+WMn2dTwRMVW+ox3QJa/CvWFWnGwPfQGoz1Kw KlBmxKd6HMiNuh7sJAr+OVoBzxJ3+uuSMyWs5OsvFtDl0Pi1V4AZ0KgIx3Dkttdw1gH7 qUYw== X-Gm-Message-State: AOAM533iTPOF1yT4pswxM3Gt4fQExun7G7c22/C3mKvMrc7Cx/isqfut klzI3NC2wbwA8hU9yKpzLDQ= X-Google-Smtp-Source: ABdhPJwnM1BWbeIyfdBw0xYAlNuKBZp8Mw+OlA1cAca3g7ZZEQ6dQFfFo22ViVxDGGmCmNT9thHhag== X-Received: by 2002:a17:90b:1806:: with SMTP id lw6mr2678516pjb.124.1643104798690; Tue, 25 Jan 2022 01:59:58 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 01:59:58 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/19] KVM: x86: Remove unused "vcpu" of kvm_scale_tsc() Date: Tue, 25 Jan 2022 17:59:07 +0800 Message-Id: <20220125095909.38122-18-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm_vcpu *vcpu" parameter of kvm_scale_tsc() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/x86.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 682ad02a4e58..ebd5a1e8db77 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1871,7 +1871,7 @@ static inline bool kvm_is_supported_user_return_msr(u32 msr) return kvm_find_user_return_msr(msr) >= 0; } -u64 kvm_scale_tsc(struct kvm_vcpu *vcpu, u64 tsc, u64 ratio); +u64 kvm_scale_tsc(u64 tsc, u64 ratio); u64 kvm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc); u64 kvm_calc_nested_tsc_offset(u64 l1_offset, u64 l2_offset, u64 l2_multiplier); u64 kvm_calc_nested_tsc_multiplier(u64 l1_multiplier, u64 l2_multiplier); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 22b73b918884..4e438e009ba9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2397,7 +2397,7 @@ static inline u64 __scale_tsc(u64 ratio, u64 tsc) return mul_u64_u64_shr(tsc, ratio, kvm_tsc_scaling_ratio_frac_bits); } -u64 kvm_scale_tsc(struct kvm_vcpu *vcpu, u64 tsc, u64 ratio) +u64 kvm_scale_tsc(u64 tsc, u64 ratio) { u64 _tsc = tsc; @@ -2412,7 +2412,7 @@ static u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc) { u64 tsc; - tsc = kvm_scale_tsc(vcpu, rdtsc(), vcpu->arch.l1_tsc_scaling_ratio); + tsc = kvm_scale_tsc(rdtsc(), vcpu->arch.l1_tsc_scaling_ratio); return target_tsc - tsc; } @@ -2420,7 +2420,7 @@ static u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc) u64 kvm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc) { return vcpu->arch.l1_tsc_offset + - kvm_scale_tsc(vcpu, host_tsc, vcpu->arch.l1_tsc_scaling_ratio); + kvm_scale_tsc(host_tsc, vcpu->arch.l1_tsc_scaling_ratio); } EXPORT_SYMBOL_GPL(kvm_read_l1_tsc); @@ -2623,7 +2623,7 @@ static inline void adjust_tsc_offset_host(struct kvm_vcpu *vcpu, s64 adjustment) { if (vcpu->arch.l1_tsc_scaling_ratio != kvm_default_tsc_scaling_ratio) WARN_ON(adjustment < 0); - adjustment = kvm_scale_tsc(vcpu, (u64) adjustment, + adjustment = kvm_scale_tsc((u64) adjustment, vcpu->arch.l1_tsc_scaling_ratio); adjust_tsc_offset_guest(vcpu, adjustment); } @@ -3043,7 +3043,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) /* With all the info we got, fill in the values */ if (kvm_has_tsc_control) - tgt_tsc_khz = kvm_scale_tsc(v, tgt_tsc_khz, + tgt_tsc_khz = kvm_scale_tsc(tgt_tsc_khz, v->arch.l1_tsc_scaling_ratio); if (unlikely(vcpu->hw_tsc_khz != tgt_tsc_khz)) { @@ -3854,7 +3854,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) ratio = vcpu->arch.tsc_scaling_ratio; } - msr_info->data = kvm_scale_tsc(vcpu, rdtsc(), ratio) + offset; + msr_info->data = kvm_scale_tsc(rdtsc(), ratio) + offset; break; } case MSR_MTRRcap: @@ -5067,7 +5067,7 @@ static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu, kvm->arch.last_tsc_khz == vcpu->arch.virtual_tsc_khz && kvm->arch.last_tsc_offset == offset); - tsc = kvm_scale_tsc(vcpu, rdtsc(), vcpu->arch.l1_tsc_scaling_ratio) + offset; + tsc = kvm_scale_tsc(rdtsc(), vcpu->arch.l1_tsc_scaling_ratio) + offset; ns = get_kvmclock_base_ns(); __kvm_synchronize_tsc(vcpu, offset, tsc, ns, matched); From patchwork Tue Jan 25 09:59:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04E90C433F5 for ; Tue, 25 Jan 2022 10:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240342AbiAYKFL (ORCPT ); Tue, 25 Jan 2022 05:05:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238620AbiAYKAB (ORCPT ); Tue, 25 Jan 2022 05:00:01 -0500 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7139C061765; Tue, 25 Jan 2022 02:00:01 -0800 (PST) Received: by mail-pj1-x1043.google.com with SMTP id h12so19432438pjq.3; Tue, 25 Jan 2022 02:00:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k0kf51n6IyPfulhV98Cqhgqk8V87O+wD98aCTABuT/8=; b=jxR3fSQn2SIOlSqeCo0N4ZF4EkoASI2lwdGuP9rf9m1fJRMjfg1gyQHvNgwRQN9Psx 1ULXx5VA5jTv3Nic5RlnjtaL7qRGmO1JDJhJhVGwh8YZ26vKoFMqYEkkYyUoByz4eCkH Xv6VccQ6B4VdpJKMxBMuv6iPcBzk1pGZaDqzRKp7kwFlhznvGbgxk2/ICzabqGzGn4Ju P5lb5GiSPo6vHew/568KAKWY93c8Gx3gQKUDgRDCCxwoXi98FOyCvRkNORyeLnGXrg83 uiP5ZE0CRIRfPIevbdrCdh8H34TvUL+yayZKocQRGLMr2gPKpES1QLVI4nslpkyrFiAb YU2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k0kf51n6IyPfulhV98Cqhgqk8V87O+wD98aCTABuT/8=; b=hrRJO3GX+J1TWv1R9rsbF31R7IaVhT4qDOU33O4SrZJ40l3hReIP+gX/OdKuu65Zxa v5rSmbkWkrDFMVNFycBluPXBauHJDQs5NDlTw9n0MYsWWHZ44sCLK7ZcA+QI2tMMeYFv TB2Tg8F+TGl/zIhJjA2YNXBOkOuJFnsW/6M2/jLyfBrm0naMOZqdU0kRHdnoAqpv223t QnXzO05NVfveGTBkld3SIFsOqfc6xmv/Drp7nBv62ReqhMuh+Ff8HAyFpAkL0s15UeVg 2PFq8OUwXEidVM/INafkaIiXmx6ATltCu8HpLW3p57HKm14VCUTe1ZWMGzrgOJwv6fg4 c05w== X-Gm-Message-State: AOAM531xn651WwW9GGV9O3vzBVaUETbapKz0ik4FL1N1CJw5wkotFXBJ SEsETtTNY23Gmzq4q2aiCL0= X-Google-Smtp-Source: ABdhPJwvw6KfDKluuJS1i0sjUTcygJqrxm6knMaK2EAZYsPwW48EwE90DjtJqiENVqCTovgNum5t0A== X-Received: by 2002:a17:90b:1d92:: with SMTP id pf18mr2658168pjb.162.1643104801241; Tue, 25 Jan 2022 02:00:01 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.01.59.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 02:00:00 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/19] KVM: Remove unused "kvm" of kvm_make_vcpu_request() Date: Tue, 25 Jan 2022 17:59:08 +0800 Message-Id: <20220125095909.38122-19-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "struct kvm *kvm" parameter of kvm_make_vcpu_request() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- virt/kvm/kvm_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 5a1164483e6c..1c98a47c8908 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -246,9 +246,8 @@ static inline bool kvm_kick_many_cpus(struct cpumask *cpus, bool wait) return true; } -static void kvm_make_vcpu_request(struct kvm *kvm, struct kvm_vcpu *vcpu, - unsigned int req, struct cpumask *tmp, - int current_cpu) +static void kvm_make_vcpu_request(struct kvm_vcpu *vcpu, unsigned int req, + struct cpumask *tmp, int current_cpu) { int cpu; @@ -291,7 +290,7 @@ bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req, vcpu = kvm_get_vcpu(kvm, i); if (!vcpu) continue; - kvm_make_vcpu_request(kvm, vcpu, req, cpus, me); + kvm_make_vcpu_request(vcpu, req, cpus, me); } called = kvm_kick_many_cpus(cpus, !!(req & KVM_REQUEST_WAIT)); @@ -317,7 +316,7 @@ bool kvm_make_all_cpus_request_except(struct kvm *kvm, unsigned int req, kvm_for_each_vcpu(i, vcpu, kvm) { if (vcpu == except) continue; - kvm_make_vcpu_request(kvm, vcpu, req, cpus, me); + kvm_make_vcpu_request(vcpu, req, cpus, me); } called = kvm_kick_many_cpus(cpus, !!(req & KVM_REQUEST_WAIT)); From patchwork Tue Jan 25 09:59:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinrong Liang X-Patchwork-Id: 12723629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 240EAC433FE for ; Tue, 25 Jan 2022 10:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240667AbiAYKFw (ORCPT ); Tue, 25 Jan 2022 05:05:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238629AbiAYKAG (ORCPT ); Tue, 25 Jan 2022 05:00:06 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4EDEC061768; Tue, 25 Jan 2022 02:00:04 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id z5so4853747plg.8; Tue, 25 Jan 2022 02:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+9/h4WgwvINM2uXFYzps/DVN0t3qraH1rjLtTgc8ipg=; b=BY1Kpc6uzILlB69ntbdcG2NpCbHQ8Kgd1/1Li8Tju2eMKDY9dOYABLBX/ZV+gNSB4x HKQJ9oDd0SWF0AGc9y99lvHQYi1aKBZUxPtjknshvOzJpm8gnILRuU4pwvel550nWeQz 5iRbxJfwOvnPPAejDvi/6WSyjS5KlAq2lnrFu+vqvmn9Iy6dYAFq/uWO1LA71qjEY5oe zdSQZId+y8KwX+VtkbC7XsUzfJ8DfMd1+NtknroUpNHq79pEYBUHqw0shUV7skIXIF8y sF2lPJNBbYgDDzh6yGDM2gepbiOcr0OaSV+5+jn1bdNr5lTNHNpA92Ihrdj1qO1MSUp6 D1Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+9/h4WgwvINM2uXFYzps/DVN0t3qraH1rjLtTgc8ipg=; b=Kr+rEoo3hR2Ft1viIC8mRlBAsR7C/NX2q1R6bdCMelumw8T7YOSrZP0twuwM9LXkYe izbihSOk11RRKNUmv124csJj5wxlRVl9PE84HlmNz+9DOcvIWoAWzmtRx2LgWjLC5y2w +Op8JeLHeO02ychT+ZBNbh7XuOMY6ULth9CTE8Bhfxc78ZDzLVZzuTS+bWYsibhvq/pm z/le88QZlh64PazknsxrHhTQnuUMT6Agmgw38BCvnrQfuCQN63o8XFb1yG106GmAmdnM yDdCMwj6lMLKmvAMb+JCzD/4Jr3SG5W48CmKXSOiRRVuIOYhFiH6EMy0BPgsAGmGQQxH z/Fw== X-Gm-Message-State: AOAM533DA1OFUDVmNYgjqD6iwX2kchs4P20qIwENgBcDujKm1uCN4lWJ 4WaUB7goHi8SoJM+kHrq0oI= X-Google-Smtp-Source: ABdhPJx9dQJt1f7yFLZ5RvUiloClMf6N9IKzWq88HkQ/mZTjsAYfIya8rtD+02X0/9THQWaQx6g2cQ== X-Received: by 2002:a17:90a:5d8c:: with SMTP id t12mr2601800pji.189.1643104803775; Tue, 25 Jan 2022 02:00:03 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id mq3sm201606pjb.4.2022.01.25.02.00.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jan 2022 02:00:03 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Xianting Tian , Jim Mattson , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/19] KVM: Remove unused "flags" of kvm_pv_kick_cpu_op() Date: Tue, 25 Jan 2022 17:59:09 +0800 Message-Id: <20220125095909.38122-20-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220125095909.38122-1-cloudliang@tencent.com> References: <20220125095909.38122-1-cloudliang@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jinrong Liang The "unsigned long flags" parameter of kvm_pv_kick_cpu_op() is not used, so remove it. No functional change intended. Signed-off-by: Jinrong Liang --- arch/x86/kvm/x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4e438e009ba9..acd34adc097f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -8940,7 +8940,7 @@ static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr, * * @apicid - apicid of vcpu to be kicked. */ -static void kvm_pv_kick_cpu_op(struct kvm *kvm, unsigned long flags, int apicid) +static void kvm_pv_kick_cpu_op(struct kvm *kvm, int apicid) { struct kvm_lapic_irq lapic_irq; @@ -9059,7 +9059,7 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) if (!guest_pv_has(vcpu, KVM_FEATURE_PV_UNHALT)) break; - kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1); + kvm_pv_kick_cpu_op(vcpu->kvm, a1); kvm_sched_yield(vcpu, a1); ret = 0; break;