Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1145022rwb; Sun, 6 Nov 2022 20:18:18 -0800 (PST) X-Google-Smtp-Source: AMsMyM4T4BX1jd/2iMkqKxfZNd4t9aL5VfWa7XwzMs0Wo/aYAzI6DAjbTL97JTC7EepnRnuAWIEJ X-Received: by 2002:a17:906:b08d:b0:782:d526:3e36 with SMTP id x13-20020a170906b08d00b00782d5263e36mr45360812ejy.358.1667794698390; Sun, 06 Nov 2022 20:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667794698; cv=none; d=google.com; s=arc-20160816; b=0kIhXYN/oBj4QHDWZ7Fb+8TmlP/5ZhqbTEtNb8JJqd8zMm33Xuxlhk/MSUgZB6neIZ 2WpyN4s2oYdth2U6I8AhseP97oNnnkaldnZX0nqKBCaKCug7od5Ox4y175Eox1tzwFeH FXHc63YH1lCMK1pwxP5Dzv7iKNxMs5j2o2BL+J3Jza0Q2CrkVWiV/ueOANsif2kYs70m UgkGJoKWrV2lfAGVODBVZtDIMN7bE6M3Kh2swJwOwFFBqPQA4IYbV2oVcOL2Odi9bBaV ikt9I7+Xm5aXytAdkGyRbvlDInaoyKjsm30H7DpLYdHveaM1Zjwm/K4FYoJUXoh2KuF8 GAZg== 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=ZSzSSykdSUMY4z4QifNhRv3KUDv6uVGdlzhODRpQKlU=; b=PsRGMCIsHEASKOtke0+SfawczSLUEjPYBDdojtpDmfnITAc+Yux/lD/Ji5mnOExQ/N KDjEd9vHM+NDxC/VbD8sbyUWUKY4vRdyTvF+2JDqcZwpW4K/BOfRX9eVyvcqG3dia1wE p70zOmy1LXFF2txtT31dKviitDvh7OviHRrfwGL4fncMnW3zDLSIjWJB7ng0Sa6yPtxQ 2juspW4qTLSoQKX/7bNlxkyt2i5cy9FJ7RKTZ8JJsFAW+keYSUnJNgeDJe0dNe8ucqLH tCHN1NtgtMNTi2N7iJ7xGg7DcF6Nq4Gv+HPeSkCUWZytCwyH/YC4ZaJq4F9HJtJnjtf8 yGdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=Q5Al979g; 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 dr14-20020a170907720e00b0073d8830e4c7si8480973ejc.954.2022.11.06.20.17.54; Sun, 06 Nov 2022 20:18:18 -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=Q5Al979g; 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 S231327AbiKGDQI (ORCPT + 95 others); Sun, 6 Nov 2022 22:16:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231260AbiKGDPt (ORCPT ); Sun, 6 Nov 2022 22:15:49 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A749BF58E for ; Sun, 6 Nov 2022 19:13:39 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id y14so26715609ejd.9 for ; Sun, 06 Nov 2022 19:13:39 -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=ZSzSSykdSUMY4z4QifNhRv3KUDv6uVGdlzhODRpQKlU=; b=Q5Al979g3+9Gavat8UlkB2Vleew+RmRbxdo+12K5r30eUrjF3YlGq0gOgvyYiLB3mt xgUU5ersVZgrB7+2jJY/bYXwsyIwwhtdWpcjxIdfzpDR5elbZNcB3K1l5DpUeR+BlciO idhic3khR724h6Kur7YB5I6R8BRlRfSrPOCcVMYpVLmUdl3EmI7WB0tcku7Xie02geae eDiGCrNsXaCEqHNBI+afAsQfH8ga4ziKwv6dMs7TpaKnqLBYnx3mO1Kmkb76PW7I4nHp zTYmmE0IV6+5AUD6cMBbhksIlq29dbZUxDj36O2JK9+DFGax2INM4cuyGR/ddy4VkTs8 0+GQ== 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=ZSzSSykdSUMY4z4QifNhRv3KUDv6uVGdlzhODRpQKlU=; b=e3QKiqhXi/DH4XEZEYgL1tBOdhK1u2jtKjiyV1W1/LjF86yXIxwFyMR8XzvlYtvJvH 2CNG9vMU1tHoapTEk0/4fYo+KYnnYt6awcaATbsnrOz6PHQBNNnu4UXh4M3Pj7N7wGXk c+2SHiB5Esaf2AJX/6X8trjARH2QaDn2+LVtOywxNqJvOknF25CSh3cV5hjoW7KnatAa napcxnMNfE9ELwrjnGpxDwB00LcdTbP+GQVK+xrGqGULnkpR1eFGoWLma/AwsnuUIIg1 hGHOjuyZkn3n20RdOr/q7NZAlWvf9Vlc58ftABHSdR4D9GCocRK4/nW8KqsR/Myq56qt X8NA== X-Gm-Message-State: ACrzQf2QJzTTSG94uSOS2yKib+cfjIx8PqIA/PeXZvIRzgfJpmzv6itn A73i3/yZbjnQFs4s14QnecBUcfgE680Cru2jmjwRNw== X-Received: by 2002:a17:906:dac8:b0:741:545b:796a with SMTP id xi8-20020a170906dac800b00741545b796amr45641186ejb.240.1667790817058; Sun, 06 Nov 2022 19:13:37 -0800 (PST) MIME-Version: 1.0 References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-28-seanjc@google.com> In-Reply-To: <20221102231911.3107438-28-seanjc@google.com> From: Anup Patel Date: Mon, 7 Nov 2022 08:43:25 +0530 Message-ID: Subject: Re: [PATCH 27/44] KVM: Drop kvm_arch_{init,exit}() 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:50 AM Sean Christopherson wrote: > > Drop kvm_arch_init() and kvm_arch_exit() 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/kvm/arm.c | 11 ----------- > arch/mips/kvm/mips.c | 10 ---------- > arch/powerpc/include/asm/kvm_host.h | 1 - > arch/powerpc/kvm/powerpc.c | 5 ----- > arch/riscv/kvm/main.c | 9 --------- > arch/s390/kvm/kvm-s390.c | 10 ---------- > arch/x86/kvm/x86.c | 10 ---------- > include/linux/kvm_host.h | 3 --- > virt/kvm/kvm_main.c | 19 ++----------------- > 9 files changed, 2 insertions(+), 76 deletions(-) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 6e0061eac627..75c5125b0dd3 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -2284,17 +2284,6 @@ static __init int kvm_arm_init(void) > return err; > } > > -int kvm_arch_init(void *opaque) > -{ > - return 0; > -} > - > -/* NOP: Compiling as a module not supported */ > -void kvm_arch_exit(void) > -{ > - > -} > - > static int __init early_kvm_mode_cfg(char *arg) > { > if (!arg) > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c > index ae7a24342fdf..3cade648827a 100644 > --- a/arch/mips/kvm/mips.c > +++ b/arch/mips/kvm/mips.c > @@ -1010,16 +1010,6 @@ long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) > return r; > } > > -int kvm_arch_init(void *opaque) > -{ > - return 0; > -} > - > -void kvm_arch_exit(void) > -{ > - > -} > - > int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, > struct kvm_sregs *sregs) > { > diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h > index 5d2c3a487e73..0a80e80c7b9e 100644 > --- a/arch/powerpc/include/asm/kvm_host.h > +++ b/arch/powerpc/include/asm/kvm_host.h > @@ -881,7 +881,6 @@ 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_exit(void) {} > 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/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 36c27381a769..34278042ad27 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -2525,11 +2525,6 @@ void kvmppc_init_lpid(unsigned long nr_lpids_param) > } > EXPORT_SYMBOL_GPL(kvmppc_init_lpid); > > -int kvm_arch_init(void *opaque) > -{ > - return 0; > -} > - > EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_ppc_instr); > > void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu, struct dentry *debugfs_dentry) > diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c > index cb063b8a9a0f..4710a6751687 100644 > --- a/arch/riscv/kvm/main.c > +++ b/arch/riscv/kvm/main.c > @@ -65,15 +65,6 @@ void kvm_arch_hardware_disable(void) > csr_write(CSR_HIDELEG, 0); > } > > -int kvm_arch_init(void *opaque) > -{ > - return 0; > -} > - > -void kvm_arch_exit(void) > -{ > -} > - > static int __init riscv_kvm_init(void) > { > const char *str; > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index f6ae845bc1c1..7c1c6d81b5d7 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -533,16 +533,6 @@ static void __kvm_s390_exit(void) > debug_unregister(kvm_s390_dbf_uv); > } > > -int kvm_arch_init(void *opaque) > -{ > - return 0; > -} > - > -void kvm_arch_exit(void) > -{ > - > -} > - > /* Section: device related */ > long kvm_arch_dev_ioctl(struct file *filp, > unsigned int ioctl, unsigned long arg) > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 218707597bea..2b4530a33298 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -9271,16 +9271,6 @@ static inline void kvm_ops_update(struct kvm_x86_init_ops *ops) > kvm_pmu_ops_update(ops->pmu_ops); > } > > -int kvm_arch_init(void *opaque) > -{ > - return 0; > -} > - > -void kvm_arch_exit(void) > -{ > - > -} > - > static int __kvm_x86_vendor_init(struct kvm_x86_init_ops *ops) > { > u64 host_pat; > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 9b52bd40be56..6c2a28c4c684 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -1423,9 +1423,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); > > -int kvm_arch_init(void *opaque); > -void kvm_arch_exit(void); > - > void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu); > > void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 27ce263a80e4..17c852cb6842 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -5833,20 +5833,8 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, > int r; > int cpu; > > - /* > - * FIXME: Get rid of kvm_arch_init(), vendor code should call arch code > - * directly. Note, kvm_arch_init() _must_ be called before anything > - * else as x86 relies on checks buried in kvm_arch_init() to guard > - * against multiple calls to kvm_init(). > - */ > - r = kvm_arch_init(opaque); > - if (r) > - return r; > - > - if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) { > - r = -ENOMEM; > - goto err_hw_enabled; > - } > + if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) > + return -ENOMEM; > > c.ret = &r; > c.opaque = opaque; > @@ -5934,8 +5922,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, > cpuhp_remove_state_nocalls(CPUHP_AP_KVM_STARTING); > out_free_2: > free_cpumask_var(cpus_hardware_enabled); > -err_hw_enabled: > - kvm_arch_exit(); > return r; > } > EXPORT_SYMBOL_GPL(kvm_init); > @@ -5963,7 +5949,6 @@ void kvm_exit(void) > on_each_cpu(hardware_disable_nolock, NULL, 1); > kvm_irqfd_exit(); > free_cpumask_var(cpus_hardware_enabled); > - kvm_arch_exit(); > } > EXPORT_SYMBOL_GPL(kvm_exit); > > -- > 2.38.1.431.g37b22c650d-goog >