Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1370661ybh; Thu, 12 Mar 2020 23:35:08 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuT4oDcyL5buWxLL3fL2yH4bcltHr89o2EUzRYKu4lkLGx1MhZgxu5B1J8HDB8R/uJOYOW6 X-Received: by 2002:a9d:2208:: with SMTP id o8mr9507682ota.208.1584081308071; Thu, 12 Mar 2020 23:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584081308; cv=none; d=google.com; s=arc-20160816; b=pmCGQD5+SpAndgVwZYw1liTylr6ARzCmKqtAc3OtN9bnwnfwsUvoRIpPVNBvqlV8LG udcLXt2MxQGNcRJZMabDU7Vd1p9fcnXlOht0eKablu/bmpUK5KXiqdTwAmAvjoR4YwX9 bzpQOBG3tqPiWI8ATTDSVN8xftTWtsZU7Cpf60HQp/Ade9D52MHJ0IlEXe7rnHfQURYn pGkA3xgLuIy7ns4Om3jxDL3P1nQcUARsOU0WX9Gqjib/VI5/RvW+KMUZIyZc6vigAyId OlmVBIx6GlOUld1ack6rHSjsHLgYi2xeXQ70QUMZn7UdMWNwMoBUBDBCZXYGnW4RooEe Qjzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=gwo18I+qhDyK0f9CRK6fxLCdLThMsDTks/uef8gm4kY=; b=oKuaIgm0V1Bh1M+EtnVGgli7dbNf9SGlGfrquHl7L2mo7n/Pd2vbCxxoQ+nTKhmMEM uwCJcY/icusTKhAW/G7iOy5AS0FvxdYvcqXE20tJOLvaeXh+YiSaUPJRrUBTfvQS5HpE inAPArLZZZGiB9tioEuz/zJHkwbKwhG6jZQBCCfP20CTUhwK57332zuKfTS7Ic3Yg935 6+/T6ucpDipY4kFhHsnW4aWNaHo8/wfiwodNMMuZtL00Mmq0ylIN7OUtlqbzGz/xgb3X iXuTmK1x8ijGtiVAX/oN6lhlT616NtUbo0xHZgHvZcAW/joPd9T3LdzS3z1lkdlOkZB9 Pi3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u199si4150207oif.110.2020.03.12.23.34.55; Thu, 12 Mar 2020 23:35:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbgCMGby (ORCPT + 99 others); Fri, 13 Mar 2020 02:31:54 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:36323 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726364AbgCMGby (ORCPT ); Fri, 13 Mar 2020 02:31:54 -0400 Received: by mail-io1-f67.google.com with SMTP id d15so8261697iog.3; Thu, 12 Mar 2020 23:31:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gwo18I+qhDyK0f9CRK6fxLCdLThMsDTks/uef8gm4kY=; b=arC548UFw58zPiZMTGpKSTA6C6cShe4/2dw/ERpegDkNqAfCg04TZN4DNuXAGiPlWr wpIlPtGJ8GPVxD37ww0/w34k112uvnTr9PsHbgyAiKqDeKaTewKk4XNcZL3L1tLv/2Ty zhQaCGOfFI4vhmKGlFgoFBweHPRg9V4g50Cg4rmKpBG1oULr/u58nB5rowQucqVdBFDC taW9/oROrxRrnjSpEKQiok8fJOJ9zvNbuhGz9A+i/aAJOr4VSfxZSZb2aS4P5uMEe/F6 9Q/rIiQfE5+nL17Egz0+euMGpKMeuYP5t2KK/XV6aDHDZVyI+pT+jdTTsK+Bl2C+vh78 JTHA== X-Gm-Message-State: ANhLgQ0vLxbb7Qf1CtK3POF+QhCCMG9wEy8KvB0KkXthXDXKSdlgNBJf kmxekXZfdla1cQouxOd53WTgJoMlPyH+Z8GESaAVT+cW X-Received: by 2002:a6b:8ec2:: with SMTP id q185mr10907291iod.180.1584081112766; Thu, 12 Mar 2020 23:31:52 -0700 (PDT) MIME-Version: 1.0 References: <1584069257-30896-1-git-send-email-lixing@loongson.cn> <1584069257-30896-3-git-send-email-lixing@loongson.cn> In-Reply-To: <1584069257-30896-3-git-send-email-lixing@loongson.cn> From: Huacai Chen Date: Fri, 13 Mar 2020 14:38:20 +0800 Message-ID: Subject: Re: [PATCH v2 Resend 3/3] KVM: MIPS: Support kvm modules autoprobed when startup system To: Xing Li Cc: Thomas Bogendoerfer , "open list:MIPS" , kvm@vger.kernel.org, LKML , maobibo@loongson.cn, Jiaxun Yang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Lixing, On Fri, Mar 13, 2020 at 11:14 AM Xing Li wrote: > > Currently, the module_init of kvm_mips_init cannot force the kvm > modules insmod when startup system. > > Add new feature CPU_MIPS_VZ in elf_hwcap to support KVM auto probe > when hardware virtualization supported. I think this patch is not suitable, because: 1, KVM has VZ mode and TE mode, you only consider VZ mode? 2, As X86 does, you can use udev or modprobe.conf to autoprobe kvm module. Regards, Huacai > > Signed-off-by: Xing Li > --- > arch/mips/include/uapi/asm/hwcap.h | 1 + > arch/mips/kernel/cpu-probe.c | 4 +++- > arch/mips/kvm/mips.c | 3 ++- > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/include/uapi/asm/hwcap.h b/arch/mips/include/uapi/asm/hwcap.h > index 1ade1da..9e66509 100644 > --- a/arch/mips/include/uapi/asm/hwcap.h > +++ b/arch/mips/include/uapi/asm/hwcap.h > @@ -17,5 +17,6 @@ > #define HWCAP_LOONGSON_MMI (1 << 11) > #define HWCAP_LOONGSON_EXT (1 << 12) > #define HWCAP_LOONGSON_EXT2 (1 << 13) > +#define HWCAP_MIPS_VZ (1 << 14) > > #endif /* _UAPI_ASM_HWCAP_H */ > diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c > index c543326..b305269 100644 > --- a/arch/mips/kernel/cpu-probe.c > +++ b/arch/mips/kernel/cpu-probe.c > @@ -2242,8 +2242,10 @@ void cpu_probe(void) > if (cpu_has_loongson_ext2) > elf_hwcap |= HWCAP_LOONGSON_EXT2; > > - if (cpu_has_vz) > + if (cpu_has_vz) { > cpu_probe_vz(c); > + elf_hwcap |= HWCAP_MIPS_VZ; > + } > > cpu_probe_vmbits(c); > > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c > index 1109924..1da5df3 100644 > --- a/arch/mips/kvm/mips.c > +++ b/arch/mips/kvm/mips.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -1742,7 +1743,7 @@ static void __exit kvm_mips_exit(void) > unregister_die_notifier(&kvm_mips_csr_die_notifier); > } > > -module_init(kvm_mips_init); > +module_cpu_feature_match(MIPS_VZ, kvm_mips_init); > module_exit(kvm_mips_exit); > > EXPORT_TRACEPOINT_SYMBOL(kvm_exit); > -- > 2.1.0 >