Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1087846rwb; Sun, 6 Nov 2022 19:14:09 -0800 (PST) X-Google-Smtp-Source: AMsMyM7ZO69wKPk0Oaz5xkJVRwO+oFIrLs+xckk92vj2F3NglNADmR6HYdhpHeWvGp/NtQw3H380 X-Received: by 2002:a05:6402:428f:b0:454:c988:4bb1 with SMTP id g15-20020a056402428f00b00454c9884bb1mr47219512edc.196.1667790848841; Sun, 06 Nov 2022 19:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667790848; cv=none; d=google.com; s=arc-20160816; b=gitLFa+1ZUiEUTHKBhmGCj0V5z+RE9NKRuksZmRY5uX9At0V2QI3G7NSE89Ba+9BJM blGBgEnXPwFAbmJfbd8sDjG7Ftgv2Yxxhmi0r5jwKFbvM1vQ4ISpfOIzEHYIqXGyKNH/ XuwrHiUthMsQUobdV3ifMAhFaftBLMIauwXFru/k5WjttARUpqMh9nIoxjLUP/A8Gxe8 bWv+/xiFkcZ/Kq2TEBC6UyBbx7BxD1zEyPH5kKr9G/d9pozDqadPPZtyPEz2ZeWJf6ps CE9G9d6Fu32XiBBIUHtKExNH0GPZ3curkdy1xZXt0IrF9x4LYJf8aJM+As+3+tbYKAKQ KOXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JlY2OstXwROXIDpT6VsXnJfzUqv1irH1Acsts2GGjpg=; b=bxXYPdfMm5THh4XoeHkC0Wnl1FYcUGAYrfKy16GwOiTcVLF7GwuQCVfXseEqdlfCWd 8bgi1A4jJJrgTfPAP5g4fR7r2ZkFVihooJ63hqVcRDGe5WPmFeNGrlYArasOOx+uNpci DjzPbT2/pI5ec/JkpIsm0cCjTjJhBc1EcX8KHoVvANVqmreoi6amkMXSZHAmNX5wKp9f UHcbp6ZZD7UaYVkAL5wr2L38OCJa5RcE4ImKkzbtfoFjhhm79SLDqUk7+K0CN/XjB1jA eV+Rcp7ibnAfaJg6xWGI/I57ai+TvTylzji5UpMjHT4khg3tiGtfWQxVSbWoUnNOjl8l THBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=wH7KmpU7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw30-20020a1709066a1e00b00787abcb1ce0si8793037ejc.679.2022.11.06.19.13.46; Sun, 06 Nov 2022 19:14:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=wH7KmpU7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbiKGDBT (ORCPT + 95 others); Sun, 6 Nov 2022 22:01:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbiKGDBS (ORCPT ); Sun, 6 Nov 2022 22:01:18 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15210DF66 for ; Sun, 6 Nov 2022 19:01:15 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id ud5so26736467ejc.4 for ; Sun, 06 Nov 2022 19:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JlY2OstXwROXIDpT6VsXnJfzUqv1irH1Acsts2GGjpg=; b=wH7KmpU7jVwmAquM9Wvk3ttImj9+lvZI8Rxq1i6YYsElC8cWksh48ZwROArAULlZ7C tWe8M8ahyJHdHwo2Ck68YVw1aHJ/MLoYcQlrnfABVok8QpmzXxG1ffcBMZXcH6h5LAvm 0tBbIsqoRxCX/KnzpT+CYyHXfKhw4foQW6+Ax6UY2aF+XO4GKByYk/PtdVxGB2RT0Fbu ysRYJ78VJd30TMAFhUzwFf/xZ7AJ2g1baQLCe9iqAVhA1Yqqkk67FLLNxduytkqwDB7v JP5zJ/Gyoc7JfJxpc+R8WHDqVMk2NzGLLCgzvKh3qN6XuvMHVMMnDXEN4atLvrkjLInL jZnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JlY2OstXwROXIDpT6VsXnJfzUqv1irH1Acsts2GGjpg=; b=t4AEdHWRuQ/5ne9M1NSVYoMnrCumWCqRDAzmebUSqlfrVxQYFsqfZwj3glvY9a4Yl8 R5pK61HaOLB1Ql5UZLOQn9pwoo8gqLdurb4eKEHGONAFlfPcIKuJ8/10BEEQV/D/vb3n iar+oyq4+RFqtrTU/Ot44aSvE2BIoJIx8x2jrPtKnOo6HYQC5NekJt17wUaRq55b9lqT FpRataHiq0j3Xbp4O4IV/YTC129dTu6iXIchxWln0pD9zxowgigcuCsDx7bufFvdKk8n AV7EH/lEkN2CSifEkbAqpdRh/YnFNflr+TeiIExfyzXCwTtAIIaKPx3ThAVRNaw4rA7Y Rn3Q== X-Gm-Message-State: ACrzQf2QRyPVcskvLfxbIIusWwE9KQjKAvhgn7XVywswzLKfRhB5ZwG3 c+wa7+aMGLTBndkG4LQIWB097189LT/3dw08z2Xbgw== X-Received: by 2002:a17:906:dac8:b0:741:545b:796a with SMTP id xi8-20020a170906dac800b00741545b796amr45605430ejb.240.1667790073283; Sun, 06 Nov 2022 19:01:13 -0800 (PST) MIME-Version: 1.0 References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-10-seanjc@google.com> In-Reply-To: <20221102231911.3107438-10-seanjc@google.com> From: Anup Patel Date: Mon, 7 Nov 2022 08:31:01 +0530 Message-ID: Subject: Re: [PATCH 09/44] KVM: Drop arch hardware (un)setup hooks To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Vitaly Kuznetsov , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Isaku Yamahata , Fabiano Rosas , Michael Ellerman , Chao Gao , Thomas Gleixner , Yuan Yao Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 3, 2022 at 4:49 AM Sean Christopherson wrote: > > Drop kvm_arch_hardware_setup() and kvm_arch_hardware_unsetup() now that > all implementations are nops. > > No functional change intended. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel Thanks, Anup > --- > arch/arm64/include/asm/kvm_host.h | 1 - > arch/arm64/kvm/arm.c | 5 ----- > arch/mips/include/asm/kvm_host.h | 1 - > arch/mips/kvm/mips.c | 5 ----- > arch/powerpc/include/asm/kvm_host.h | 1 - > arch/powerpc/kvm/powerpc.c | 5 ----- > arch/riscv/include/asm/kvm_host.h | 1 - > arch/riscv/kvm/main.c | 5 ----- > arch/s390/kvm/kvm-s390.c | 10 ---------- > arch/x86/kvm/x86.c | 10 ---------- > include/linux/kvm_host.h | 2 -- > virt/kvm/kvm_main.c | 7 ------- > 12 files changed, 53 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index 45e2136322ba..5d5a887e63a5 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -859,7 +859,6 @@ static inline bool kvm_system_needs_idmapped_vectors(void) > > void kvm_arm_vcpu_ptrauth_trap(struct kvm_vcpu *vcpu); > > -static inline void kvm_arch_hardware_unsetup(void) {} > static inline void kvm_arch_sync_events(struct kvm *kvm) {} > static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 94d33e296e10..2ee729f54ce0 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -63,11 +63,6 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu) > return kvm_vcpu_exiting_guest_mode(vcpu) == IN_GUEST_MODE; > } > > -int kvm_arch_hardware_setup(void *opaque) > -{ > - return 0; > -} > - > int kvm_arch_check_processor_compat(void *opaque) > { > return 0; > diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h > index 5cedb28e8a40..28f0ba97db71 100644 > --- a/arch/mips/include/asm/kvm_host.h > +++ b/arch/mips/include/asm/kvm_host.h > @@ -888,7 +888,6 @@ extern unsigned long kvm_mips_get_ramsize(struct kvm *kvm); > extern int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, > struct kvm_mips_interrupt *irq); > > -static inline void kvm_arch_hardware_unsetup(void) {} > 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) {} > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c > index a25e0b73ee70..af29490d9740 100644 > --- a/arch/mips/kvm/mips.c > +++ b/arch/mips/kvm/mips.c > @@ -135,11 +135,6 @@ void kvm_arch_hardware_disable(void) > kvm_mips_callbacks->hardware_disable(); > } > > -int kvm_arch_hardware_setup(void *opaque) > -{ > - return 0; > -} > - > int kvm_arch_check_processor_compat(void *opaque) > { > return 0; > diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h > index caea15dcb91d..5d2c3a487e73 100644 > --- a/arch/powerpc/include/asm/kvm_host.h > +++ b/arch/powerpc/include/asm/kvm_host.h > @@ -877,7 +877,6 @@ struct kvm_vcpu_arch { > #define __KVM_HAVE_CREATE_DEVICE > > static inline void kvm_arch_hardware_disable(void) {} > -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_flush_shadow_all(struct kvm *kvm) {} > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index b850b0efa201..74ea5687ecbc 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -441,11 +441,6 @@ int kvm_arch_hardware_enable(void) > return 0; > } > > -int kvm_arch_hardware_setup(void *opaque) > -{ > - return 0; > -} > - > int kvm_arch_check_processor_compat(void *opaque) > { > return kvmppc_core_check_processor_compat(); > diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h > index dbbf43d52623..8c771fc4f5d2 100644 > --- a/arch/riscv/include/asm/kvm_host.h > +++ b/arch/riscv/include/asm/kvm_host.h > @@ -229,7 +229,6 @@ struct kvm_vcpu_arch { > bool pause; > }; > > -static inline void kvm_arch_hardware_unsetup(void) {} > static inline void kvm_arch_sync_events(struct kvm *kvm) {} > static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} > > diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c > index df2d8716851f..a146fa0ce4d2 100644 > --- a/arch/riscv/kvm/main.c > +++ b/arch/riscv/kvm/main.c > @@ -25,11 +25,6 @@ int kvm_arch_check_processor_compat(void *opaque) > return 0; > } > > -int kvm_arch_hardware_setup(void *opaque) > -{ > - return 0; > -} > - > int kvm_arch_hardware_enable(void) > { > unsigned long hideleg, hedeleg; > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 1aaee15211f2..7fcd2d3b3558 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -321,16 +321,6 @@ static struct notifier_block kvm_clock_notifier = { > .notifier_call = kvm_clock_sync, > }; > > -int kvm_arch_hardware_setup(void *opaque) > -{ > - return 0; > -} > - > -void kvm_arch_hardware_unsetup(void) > -{ > - > -} > - > static void allow_cpu_feat(unsigned long nr) > { > set_bit_inv(nr, kvm_s390_available_cpu_feat); > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 80ee580a9cd4..40d4bfaa17a4 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -11985,16 +11985,6 @@ void kvm_arch_hardware_disable(void) > drop_user_return_notifiers(); > } > > -int kvm_arch_hardware_setup(void *opaque) > -{ > - return 0; > -} > - > -void kvm_arch_hardware_unsetup(void) > -{ > - > -} > - > int kvm_arch_check_processor_compat(void *opaque) > { > struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 18592bdf4c1b..9b52bd40be56 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -1447,8 +1447,6 @@ static inline void kvm_create_vcpu_debugfs(struct kvm_vcpu *vcpu) {} > > int kvm_arch_hardware_enable(void); > void kvm_arch_hardware_disable(void); > -int kvm_arch_hardware_setup(void *opaque); > -void kvm_arch_hardware_unsetup(void); > int kvm_arch_check_processor_compat(void *opaque); > int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); > bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu); > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index f592dd4ce8f2..27ce263a80e4 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -5843,10 +5843,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, > if (r) > return r; > > - r = kvm_arch_hardware_setup(opaque); > - if (r < 0) > - goto err_hw_setup; > - > if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) { > r = -ENOMEM; > goto err_hw_enabled; > @@ -5939,8 +5935,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, > out_free_2: > free_cpumask_var(cpus_hardware_enabled); > err_hw_enabled: > - kvm_arch_hardware_unsetup(); > -err_hw_setup: > kvm_arch_exit(); > return r; > } > @@ -5969,7 +5963,6 @@ void kvm_exit(void) > on_each_cpu(hardware_disable_nolock, NULL, 1); > kvm_irqfd_exit(); > free_cpumask_var(cpus_hardware_enabled); > - kvm_arch_hardware_unsetup(); > kvm_arch_exit(); > } > EXPORT_SYMBOL_GPL(kvm_exit); > -- > 2.38.1.431.g37b22c650d-goog >