Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp63739lqp; Tue, 21 May 2024 18:41:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZlZvLovSBJ/QwCFkeUET/cPoMTj661TD5v2OcNXsusC5qPu22ZnQjnOUm8HFofEUvW0iSkNg/1AHcGI1nu9XfkVkeWJlnQqDPFhhc/A== X-Google-Smtp-Source: AGHT+IEDOZ2aorTVOJUM0VzoRJRIPjGgs8PET1A6BROl0iPVZGxtRrh+lx6rRL3X6DCfOh+o/WuH X-Received: by 2002:a17:906:7b49:b0:a59:b590:5d71 with SMTP id a640c23a62f3a-a62277406camr25338166b.0.1716342117666; Tue, 21 May 2024 18:41:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716342117; cv=pass; d=google.com; s=arc-20160816; b=yOWiZz7DitoBAB1ewCXd5ARzudCEtNV3V2ihlPD5N+/Qq8Enkfb5XYGv3MesMcbwqG 9U2GbDTVhszxdVyb97TxzcCi4t6VbrsoatXFMGb34XfSo6Yz4gfXWKNrjUz56b2AqNqG /XoSFnbLmWQU2JZYase0AZsmD2qMoNxHvwJA6lQF82UW+/ki0dzNh7ZJ7FkhB4TSvnu+ mAoUKzwYNeqZcQLtVcxXal8XU2v2uYpmjx+8bViNhyJ1k1sbq4U0cOtNnOWloU2JlRMo z12wm+gRPgl1AdBAe8jqfPiIXlysizk04Q8sim/3xXFO+api4W5XgU7tgGMjXTmoKViH W7OA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :reply-to:dkim-signature; bh=YIaHuI54z6BrBG13k0tb5gdPpybD0vyJf2+hzL+sGEQ=; fh=Kohvfmo6L1tXbqfStHFf5vcz4fJrUqTFmc4K/gRfElk=; b=y5tPoS5lX7TPhNpd0EtDuk36Ueq661M/3XmHesdppiiCLbcXUwq39ToV9cuH7zRsNQ zaMeZ4GQL6Y9DfRr+JibCpMyO+8vt368QkBq/1+89jn5MCk+8HCL4ydZlLIgiSYu2xTK tQ1KMGANrtrwBkrwBYuLdtsXKkrDs16XiMGTXpCuZD04Qz7kwv6xebA/HsBX7ACKQd63 6x4ptvGkpEB1XvChDcf8bJZr/P85NJvHNWoOh2Svo8wS9bg55c2WxRTIsXtQBdsdhbiH xkB6fXdkWi+xQee5cvwXhpU5r32KgagwVxKH+IIRqZU9HhNIUzzR6gDuTZuWVrx9pNX8 kruA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=in0iBmHx; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-185665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6abcsi1417761866b.783.2024.05.21.18.41.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 18:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=in0iBmHx; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-185665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 314681F23453 for ; Wed, 22 May 2024 01:41:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3154336134; Wed, 22 May 2024 01:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="in0iBmHx" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 770A221342 for ; Wed, 22 May 2024 01:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716342027; cv=none; b=fMCJS79dpbo6P2eTU+lVR2Bvmr4L0HUiLXTCNxV7B/SjRqHGBN7TiTZvVV5o0IlIbgiMFQyOx72y+GNHSIFYgWh5lWMHpeaVTTdXirfJU+VHBDpWE73v94eaRxeR3gZVr77schX8eInBzG+CzfgU11ezUXiI49DZbzCVXaP3+us= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716342027; c=relaxed/simple; bh=WdlG4f+O5x4XRiT8YMvTWNy6dZwjlO1PItml2z/JwkA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=sfl6ti1GBybdkUmOjoZAXtN5DjHLe8imLf72Nz9dhnqzoPNwhZ+B0j9B+5xNjbYhVPTvbP9BXUq6MDODP169qu48Zr1ZDB40lxIGvCGwYCOlup1jwmRlqZbOLks1clYJBGTLUwTddT3nq7n0Gd1bjr+tLw7Qz3FyDwcWl6rzkl4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=in0iBmHx; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-df4d82f868bso1469422276.3 for ; Tue, 21 May 2024 18:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1716342023; x=1716946823; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=YIaHuI54z6BrBG13k0tb5gdPpybD0vyJf2+hzL+sGEQ=; b=in0iBmHxaYjbw0euzR11jFgbqX/W5s2xtPfVATdy0lo7oRA/Hwwle2O7BOj99TWL5C rMJaJNxybF7GxsP3S2mqoajzZDQgvAmU/NpjW/p9IDJddwHeAVWoopKw7rCE1bUPtdEt qNRnvoSVFm/k58wMgpVaWFTJkv/9CsrICU21WqLCQB8w/ISUy4j/V4DsIqMLwV1DQocC FFjeIymlkBqda74dPeMn4RpebhGWGdz2bGkQlQeWDvu0wwGQNtvyunNYdfoD1UiO3F9o rg/tDIT/+qVQA+CUNtbjnJIZC1voQOaPnpq8EeV97RWsXW1x5iZM5efaFRxoevLhXnf9 A38w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716342023; x=1716946823; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YIaHuI54z6BrBG13k0tb5gdPpybD0vyJf2+hzL+sGEQ=; b=txQryEVY2/k9NtA+0Qr9tjnbiXiUUarHXFDS1TpxjehOSGktlxpexdjatTnA0K3vH/ JtzlJEY9QUziJf0A2SsuXI7Ma6TpdEzaSKgANED7s6bYo7g6gGwXU2Hz3mNbk7+yvkqK TGLeSEVUWTttne2hheaPu68D6F7X0vPiaLTPA6elBr6HLh4KFeh6qkgSonfJLWwBTgmS Tix/OxL3PalH43ubLVWd779y3/K6mOXjMgbucIPSm1HOBHP41bmFI/NptKJRx+cslF49 GYO/GD5eYvAnMNZ/UZ6bdI27+jLkqYGmRiU+Hxb2f0rZ8wf7BUjdAbCeigk6GCu14MwE X1eQ== X-Forwarded-Encrypted: i=1; AJvYcCW743IDzsVa3Z1gnGvlhOAswufy1PTAideBhjTXQKEQQlQJtkUQDuUiJy+LHLnIdrlLQhKWUMxHW1dS+maY5J2JYOAQDUwnRWbDfgX2 X-Gm-Message-State: AOJu0Yxg9XEf9mMKlTO6AMVOCBG+lZachGNS53ucT4K6vPKX6tWSZ52r zD8S6VePNn/F7F5FUd0oFJCpnt7947Z57rpibJLiZhP97K5gSbyM81VJx0xvdLxh/y3lbA267iY IYQ== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:100b:b0:dee:7f2c:ad90 with SMTP id 3f1490d57ef6-df4e0d38b1bmr236895276.10.1716342023595; Tue, 21 May 2024 18:40:23 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 21 May 2024 18:40:11 -0700 In-Reply-To: <20240522014013.1672962-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240522014013.1672962-1-seanjc@google.com> X-Mailer: git-send-email 2.45.0.215.g3402c0e53f-goog Message-ID: <20240522014013.1672962-5-seanjc@google.com> Subject: [PATCH v2 4/6] KVM: Delete the now unused kvm_arch_sched_in() From: Sean Christopherson To: Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Sean Christopherson , Paolo Bonzini Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Delete kvm_arch_sched_in() now that all implementations are nops. Signed-off-by: Sean Christopherson --- arch/arm64/include/asm/kvm_host.h | 1 - arch/loongarch/include/asm/kvm_host.h | 1 - arch/mips/include/asm/kvm_host.h | 1 - arch/powerpc/include/asm/kvm_host.h | 1 - arch/riscv/include/asm/kvm_host.h | 1 - arch/s390/include/asm/kvm_host.h | 1 - arch/x86/kvm/pmu.c | 6 +++--- arch/x86/kvm/x86.c | 5 ----- include/linux/kvm_host.h | 2 -- virt/kvm/kvm_main.c | 1 - 10 files changed, 3 insertions(+), 17 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 8170c04fde91..615e7a2e5590 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -1225,7 +1225,6 @@ static inline bool kvm_system_needs_idmapped_vectors(void) } static inline void kvm_arch_sync_events(struct kvm *kvm) {} -static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} void kvm_arm_init_debug(void); void kvm_arm_vcpu_init_debug(struct kvm_vcpu *vcpu); diff --git a/arch/loongarch/include/asm/kvm_host.h b/arch/loongarch/include/asm/kvm_host.h index c87b6ea0ec47..4162a252cdf6 100644 --- a/arch/loongarch/include/asm/kvm_host.h +++ b/arch/loongarch/include/asm/kvm_host.h @@ -261,7 +261,6 @@ static inline bool kvm_is_ifetch_fault(struct kvm_vcpu_arch *arch) static inline void kvm_arch_hardware_unsetup(void) {} static inline void kvm_arch_sync_events(struct kvm *kvm) {} static inline void kvm_arch_memslots_updated(struct kvm *kvm, u64 gen) {} -static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu) {} static inline void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu) {} static inline void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu) {} diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h index 179f320cc231..6743a57c1ab4 100644 --- a/arch/mips/include/asm/kvm_host.h +++ b/arch/mips/include/asm/kvm_host.h @@ -890,7 +890,6 @@ static inline void kvm_arch_sync_events(struct kvm *kvm) {} static inline void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *slot) {} static inline void kvm_arch_memslots_updated(struct kvm *kvm, u64 gen) {} -static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu) {} static inline void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu) {} diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 8abac532146e..c4fb6a27fb92 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h @@ -897,7 +897,6 @@ struct kvm_vcpu_arch { static inline void kvm_arch_sync_events(struct kvm *kvm) {} static inline void kvm_arch_memslots_updated(struct kvm *kvm, u64 gen) {} static inline void kvm_arch_flush_shadow_all(struct kvm *kvm) {} -static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu) {} static inline void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu) {} diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h index d96281278586..dd77c2db6819 100644 --- a/arch/riscv/include/asm/kvm_host.h +++ b/arch/riscv/include/asm/kvm_host.h @@ -286,7 +286,6 @@ struct kvm_vcpu_arch { }; static inline void kvm_arch_sync_events(struct kvm *kvm) {} -static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} #define KVM_RISCV_GSTAGE_TLB_MIN_ORDER 12 diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 95990461888f..e9fcaf4607a6 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h @@ -1045,7 +1045,6 @@ extern int kvm_s390_gisc_register(struct kvm *kvm, u32 gisc); extern int kvm_s390_gisc_unregister(struct kvm *kvm, u32 gisc); static inline void kvm_arch_sync_events(struct kvm *kvm) {} -static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} static inline void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *slot) {} static inline void kvm_arch_memslots_updated(struct kvm *kvm, u64 gen) {} diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index a593b03c9aed..f9149c9fc275 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -521,9 +521,9 @@ void kvm_pmu_handle_event(struct kvm_vcpu *vcpu) } /* - * Unused perf_events are only released if the corresponding MSRs - * weren't accessed during the last vCPU time slice. kvm_arch_sched_in - * triggers KVM_REQ_PMU if cleanup is needed. + * Release unused perf_events if the corresponding guest MSRs weren't + * accessed during the last vCPU time slice (need_cleanup is set when + * the vCPU is scheduled back in). */ if (unlikely(pmu->need_cleanup)) kvm_pmu_cleanup(vcpu); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e924d1c51e31..59aa772af755 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -12586,11 +12586,6 @@ bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu) return (vcpu->arch.apic_base & MSR_IA32_APICBASE_BSP) != 0; } -void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) -{ - -} - void kvm_arch_free_vm(struct kvm *kvm) { #if IS_ENABLED(CONFIG_HYPERV) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bde69f74b031..c404c428a866 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1495,8 +1495,6 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg); int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu); -void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu); - void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id); diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7ecea573d121..b312d0cbe60b 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -6286,7 +6286,6 @@ static void kvm_sched_in(struct preempt_notifier *pn, int cpu) WRITE_ONCE(vcpu->ready, false); __this_cpu_write(kvm_running_vcpu, vcpu); - kvm_arch_sched_in(vcpu, cpu); kvm_arch_vcpu_load(vcpu, cpu); WRITE_ONCE(vcpu->scheduled_out, false); -- 2.45.0.215.g3402c0e53f-goog