Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp686213ybb; Wed, 1 Apr 2020 07:51:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt4rQ4X50GbbuoK1D8S8ZhlzwB56+Xwc9o3RoL41z5bTQAAVgUNV27lLPSGOhTL5yIhee2+ X-Received: by 2002:a9d:b8c:: with SMTP id 12mr5731583oth.205.1585752716590; Wed, 01 Apr 2020 07:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585752716; cv=none; d=google.com; s=arc-20160816; b=zxiB5Oj/F9JnFOlR69gClUVBL7xBnhXzJGp51oM1ci80lgJ1EHm+M5lecNYqDb1PYP 9jtt53XPbUUMx60dyow8lllSAMKR/DBtWnSmVtTW5Y31NdlQ6TrPpeaUBQnZfzBNUOlv ppMB1R4ka/aQCDGR3xKfJoqistuxTsx4iTNuf8hI85H2DUlX+EeiorItstrt5EV7XQ0W 2jFz08R30p/CFct0xR4gubsi08Yg1S6eKoj5+POnoTTtgbNxZxTvsGoVi3Ye2RheQZQM 9EEQkRmpgWfZWWyha/tZPIw2q/sE+Ju1/P9hTQ6g+/7eGwnz3Jr+LDY6KLIV6rib0iZB POfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=5n1TpAtrCmO/OxJ7W2yFz2Sp/6yT7ouLorwkqMfl51s=; b=r77f6C3tz+jbB5iSRs+AQZC5DcXjkKOBm8nBEXf9TEUM9hDrixIzRmiP0iiwGtcaXo GMZeu/kcPw8Kvmt5GNP9BKt+F2WTxIhgzYa/ToMl6Xy6oLAtEcPY3+o7+7RaK4282048 8a9lhJdC4KwGJrMoloidlpTUYCqRXhJTShw8p8+px4lwNIO//c7XCkvVHuR7uxgRiGT8 gzB2wFV0bYZ9t7CscivD6Ut+bOjK3h9pmejdZboYco0w+qT89h0DFMPQNNMmhuqB4SIh Src15fgQtnMrCCTL9iZXSquaMqe5jf0BQ2WXQAm7+VEYIFmfgpA+IDnXotXn6HbuJxqS nv+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MRg8CRJS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si994748oti.128.2020.04.01.07.51.43; Wed, 01 Apr 2020 07:51:56 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MRg8CRJS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733092AbgDAOvT (ORCPT + 99 others); Wed, 1 Apr 2020 10:51:19 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59747 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732749AbgDAOvS (ORCPT ); Wed, 1 Apr 2020 10:51:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585752677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5n1TpAtrCmO/OxJ7W2yFz2Sp/6yT7ouLorwkqMfl51s=; b=MRg8CRJSs4I8fbkqRyxquoqzOBwOsThTyQe0tjMxuGSmgd9joxTV1cX9nf3uPN1uL6aas1 gO6ZZs/Mo/g8my2z3WZvofxhWJSUCxSwbs+pJioo+8yPAGMooAPmDCfWTRO1UAS7ff2H89 uniOa+TxmX2rUfznKVOx9G/ecDANo+s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-6pRfZq5iMh24YqoQc1E2ag-1; Wed, 01 Apr 2020 10:51:14 -0400 X-MC-Unique: 6pRfZq5iMh24YqoQc1E2ag-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20A95477; Wed, 1 Apr 2020 14:51:11 +0000 (UTC) Received: from [10.72.12.139] (ovpn-12-139.pek2.redhat.com [10.72.12.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC87D98A53; Wed, 1 Apr 2020 14:50:52 +0000 (UTC) Subject: Re: [PATCH V9 1/9] vhost: refine vhost and vringh kconfig To: "Michael S. Tsirkin" Cc: Christian Borntraeger , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, jgg@mellanox.com, maxime.coquelin@redhat.com, cunming.liang@intel.com, zhihong.wang@intel.com, rob.miller@broadcom.com, xiao.w.wang@intel.com, lingshan.zhu@intel.com, eperezma@redhat.com, lulu@redhat.com, parav@mellanox.com, kevin.tian@intel.com, stefanha@redhat.com, rdunlap@infradead.org, hch@infradead.org, aadam@redhat.com, jiri@mellanox.com, shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com, gdawar@xilinx.com, saugatm@xilinx.com, vmireyno@marvell.com, zhangweining@ruijie.com.cn References: <20200326140125.19794-1-jasowang@redhat.com> <20200326140125.19794-2-jasowang@redhat.com> <41ee1f6a-3124-d44b-bf34-0f26604f9514@redhat.com> <4726da4c-11ec-3b6e-1218-6d6d365d5038@de.ibm.com> <39b96e3a-9f4e-6e1d-e988-8c4bcfb55879@de.ibm.com> <20200401102631-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <5e409bb4-2b06-5193-20c3-a9ddaafacf5a@redhat.com> Date: Wed, 1 Apr 2020 22:50:50 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200401102631-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/1 =E4=B8=8B=E5=8D=8810:27, Michael S. Tsirkin wrote: > On Wed, Apr 01, 2020 at 10:13:29PM +0800, Jason Wang wrote: >> On 2020/4/1 =E4=B8=8B=E5=8D=889:02, Christian Borntraeger wrote: >>> On 01.04.20 14:56, Christian Borntraeger wrote: >>>> On 01.04.20 14:50, Jason Wang wrote: >>>>> On 2020/4/1 =E4=B8=8B=E5=8D=887:21, Christian Borntraeger wrote: >>>>>> On 26.03.20 15:01, Jason Wang wrote: >>>>>>> Currently, CONFIG_VHOST depends on CONFIG_VIRTUALIZATION. But vho= st is >>>>>>> not necessarily for VM since it's a generic userspace and kernel >>>>>>> communication protocol. Such dependency may prevent archs without >>>>>>> virtualization support from using vhost. >>>>>>> >>>>>>> To solve this, a dedicated vhost menu is created under drivers so >>>>>>> CONIFG_VHOST can be decoupled out of CONFIG_VIRTUALIZATION. >>>>>> FWIW, this now results in vhost not being build with defconfig ker= nels (in todays >>>>>> linux-next). >>>>>> >>>>> Hi Christian: >>>>> >>>>> Did you meet it even with this commit=C2=A0https://git.kernel.org/p= ub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3Da4be40cbcedba9b5= b714f3c95182e8a45176e42d? >>>> I simply used linux-next. The defconfig does NOT contain CONFIG_VHOS= T and therefore CONFIG_VHOST_NET and friends >>>> can not be selected. >>>> >>>> $ git checkout next-20200401 >>>> $ make defconfig >>>> HOSTCC scripts/basic/fixdep >>>> HOSTCC scripts/kconfig/conf.o >>>> HOSTCC scripts/kconfig/confdata.o >>>> HOSTCC scripts/kconfig/expr.o >>>> LEX scripts/kconfig/lexer.lex.c >>>> YACC scripts/kconfig/parser.tab.[ch] >>>> HOSTCC scripts/kconfig/lexer.lex.o >>>> HOSTCC scripts/kconfig/parser.tab.o >>>> HOSTCC scripts/kconfig/preprocess.o >>>> HOSTCC scripts/kconfig/symbol.o >>>> HOSTCC scripts/kconfig/util.o >>>> HOSTLD scripts/kconfig/conf >>>> *** Default configuration is based on 'x86_64_defconfig' >>>> # >>>> # configuration written to .config >>>> # >>>> >>>> $ grep VHOST .config >>>> # CONFIG_VHOST is not set >>>> >>>>> If yes, what's your build config looks like? >>>>> >>>>> Thanks >>> This was x86. Not sure if that did work before. >>> On s390 this is definitely a regression as the defconfig files >>> for s390 do select VHOST_NET >>> >>> grep VHOST arch/s390/configs/* >>> arch/s390/configs/debug_defconfig:CONFIG_VHOST_NET=3Dm >>> arch/s390/configs/debug_defconfig:CONFIG_VHOST_VSOCK=3Dm >>> arch/s390/configs/defconfig:CONFIG_VHOST_NET=3Dm >>> arch/s390/configs/defconfig:CONFIG_VHOST_VSOCK=3Dm >>> >>> and this worked with 5.6, but does not work with next. Just adding >>> CONFIG_VHOST=3Dm to the defconfig solves the issue, something like >> >> Right, I think we probably need >> >> 1) add CONFIG_VHOST=3Dm to all defconfigs that enables >> CONFIG_VHOST_NET/VSOCK/SCSI. >> >> or >> >> 2) don't use menuconfig for CONFIG_VHOST, let NET/SCSI/VDPA just selec= t it. >> >> Thanks > OK I tried this: > > diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig > index 2523a1d4290a..a314b900d479 100644 > --- a/drivers/vhost/Kconfig > +++ b/drivers/vhost/Kconfig > @@ -19,11 +19,10 @@ menuconfig VHOST > This option is selected by any driver which needs to access > the core of vhost. > =20 > -if VHOST > - > config VHOST_NET > tristate "Host kernel accelerator for virtio net" > depends on NET && EVENTFD && (TUN || !TUN) && (TAP || !TAP) > + select VHOST > ---help--- > This kernel module can be loaded in host kernel to accelerate > guest networking with virtio_net. Not to be confused with virtio_n= et > @@ -35,6 +34,7 @@ config VHOST_NET > config VHOST_SCSI > tristate "VHOST_SCSI TCM fabric driver" > depends on TARGET_CORE && EVENTFD > + select VHOST > default n > ---help--- > Say M here to enable the vhost_scsi TCM fabric module > @@ -44,6 +44,7 @@ config VHOST_VSOCK > tristate "vhost virtio-vsock driver" > depends on VSOCKETS && EVENTFD > select VIRTIO_VSOCKETS_COMMON > + select VHOST > default n > ---help--- > This kernel module can be loaded in the host kernel to provide AF_VS= OCK > @@ -57,6 +58,7 @@ config VHOST_VDPA > tristate "Vhost driver for vDPA-based backend" > depends on EVENTFD > select VDPA > + select VHOST > help > This kernel module can be loaded in host kernel to accelerate > guest virtio devices with the vDPA-based backends. > @@ -78,5 +80,3 @@ config VHOST_CROSS_ENDIAN_LEGACY > adds some overhead, it is disabled by default. > =20 > If unsure, say "N". > - > -endif > > > But now CONFIG_VHOST is always "y", never "m". > Which I think will make it a built-in. > Didn't figure out why yet. Is it because the dependency of EVENTFD for CONFIG_VHOST? Remove that one for this patch, I can get CONFIG_VHOST=3Dm. But according to documentation/kbuild/kconfig.rst, select is used for=20 option without prompt. Thanks >