Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp264503ybg; Tue, 2 Jun 2020 23:40:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziPD5nyvGHD/Qxj8tuKPz4/6QbE522XhEPAG6cBOxW5SY6JXuByM+niGNhzk2TUSlptTsY X-Received: by 2002:a17:906:2e81:: with SMTP id o1mr20630609eji.362.1591166414809; Tue, 02 Jun 2020 23:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591166414; cv=none; d=google.com; s=arc-20160816; b=S/lFrRPCg3nL5ACkVBy07X+vxdfJwZaCMTr6hbUKDulN/g4CaXL9UIzSBWG8ftTSSP cMyXS7eY2vjUJAQzC4BF/VKltvLoajmfbSdUcSv8pUNbYtABR3ijNnyYrUMsOdWOsGNX f0qfjIMcpKwrWLF/Zf3qsBRV/SLX4f2H1EksI3aEXxWlGnVPf5q22zBYdbkVjjD5te5S Cm4NO8E9OKeLFF1lUd5yIihbrrHo9VOJJLMnhK9dNEBmwlSX0ZflCpzi1Ks9peYpDZSs mp4XtbbFCg8APIViKgaQBnhEVUjZu0KFoQz8UpGrjmQzI1S7QjqdNlzAMebgw4ZeFn34 8V4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=9YIEZphT4WQWpLHR5u5cJhoz+kzmhXmqU3aAWshGKzY=; b=YESFlF4edbJi5JqdP7J3EhVsS8Z/IwWTrTCJTjcROKuw62Zwl8/Z8Z4dwrRUAe8xsu PdC6QJCMTAg3/2HdmDAuIrSy2MW8PXhCI0RYsBxQZVnynVevhiXZkk6bG+xZv0n16CbY lGld/BgYHjizYrW0S3XE/t2dP4pKqRyDYpUrPAo1Wx3b6tkE+vm04vIOFpaaXPoejqUJ aPhfRtqDzON0eAniVwT+ZO/a2XcMQnX/UsnveiNs0rUewzg4NFpNx/bgpf0bVkJR6tEU ELL/p+92Qk5/x5p9ef8xdTZ/wiXd4UXukbOeXwznWYE3fdaord4g4XEy80ckhgLlFGAd F8aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YOXBuK+U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id lh7si644076ejb.106.2020.06.02.23.39.47; Tue, 02 Jun 2020 23:40:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YOXBuK+U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726080AbgFCGiF (ORCPT + 99 others); Wed, 3 Jun 2020 02:38:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:60759 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725876AbgFCGiE (ORCPT ); Wed, 3 Jun 2020 02:38:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591166283; 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=9YIEZphT4WQWpLHR5u5cJhoz+kzmhXmqU3aAWshGKzY=; b=YOXBuK+UmeWuKoDuuSW6sPMjKUiWmry64iCd0DsUoktlfG7wpcAuuTUewe4rnCV3Fz1eCp q0Yqo0ggTqVR0f1JnaLhdV7C/V5wg1rCXAE04DKM9sSG4Rwk89K5nwuvfPviDdyFtG03OV hZCxTLmPdzDa/+nocuke0hmk3jQm2UY= 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-128-s9_v9VnYMJaEfh0m8hUAHw-1; Wed, 03 Jun 2020 02:38:01 -0400 X-MC-Unique: s9_v9VnYMJaEfh0m8hUAHw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DAC0C7441; Wed, 3 Jun 2020 06:37:59 +0000 (UTC) Received: from [10.72.12.214] (ovpn-12-214.pek2.redhat.com [10.72.12.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 121E35D9CD; Wed, 3 Jun 2020 06:37:52 +0000 (UTC) Subject: Re: [PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap To: "Michael S. Tsirkin" Cc: kbuild test robot , kbuild-all@lists.01.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rob.miller@broadcom.com, lingshan.zhu@intel.com, eperezma@redhat.com, lulu@redhat.com References: <20200529080303.15449-5-jasowang@redhat.com> <202006020308.kLXTHt4n%lkp@intel.com> <20200602005007-mutt-send-email-mst@kernel.org> <20200602093025-mutt-send-email-mst@kernel.org> <5db6b413-cb6c-a566-2f2d-ad580d8e165b@redhat.com> <20200603023429-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <3c4ed3de-00e9-2e3d-854e-4bd47063820b@redhat.com> Date: Wed, 3 Jun 2020 14:37:51 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200603023429-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/6/3 下午2:34, Michael S. Tsirkin wrote: > On Wed, Jun 03, 2020 at 12:18:44PM +0800, Jason Wang wrote: >> On 2020/6/2 下午9:31, Michael S. Tsirkin wrote: >>> On Tue, Jun 02, 2020 at 02:49:38PM +0800, Jason Wang wrote: >>>> On 2020/6/2 下午12:56, Michael S. Tsirkin wrote: >>>>> On Tue, Jun 02, 2020 at 03:22:49AM +0800, kbuild test robot wrote: >>>>>> Hi Jason, >>>>>> >>>>>> I love your patch! Yet something to improve: >>>>>> >>>>>> [auto build test ERROR on vhost/linux-next] >>>>>> [also build test ERROR on linus/master v5.7 next-20200529] >>>>>> [if your patch is applied to the wrong git tree, please drop us a note to help >>>>>> improve the system. BTW, we also suggest to use '--base' option to specify the >>>>>> base tree in git format-patch, please seehttps://stackoverflow.com/a/37406982] >>>>>> >>>>>> url:https://github.com/0day-ci/linux/commits/Jason-Wang/vDPA-doorbell-mapping/20200531-070834 >>>>>> base:https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next >>>>>> config: m68k-randconfig-r011-20200601 (attached as .config) >>>>>> compiler: m68k-linux-gcc (GCC) 9.3.0 >>>>>> reproduce (this is a W=1 build): >>>>>> wgethttps://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross >>>>>> chmod +x ~/bin/make.cross >>>>>> # save the attached .config to linux build tree >>>>>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k >>>>>> >>>>>> If you fix the issue, kindly add following tag as appropriate >>>>>> Reported-by: kbuild test robot >>>>>> >>>>>> All errors (new ones prefixed by >>, old ones prefixed by <<): >>>>>> >>>>>> drivers/vhost/vdpa.c: In function 'vhost_vdpa_fault': >>>>>>>> drivers/vhost/vdpa.c:754:22: error: implicit declaration of function 'pgprot_noncached' [-Werror=implicit-function-declaration] >>>>>> 754 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); >>>>>> | ^~~~~~~~~~~~~~~~ >>>>>>>> drivers/vhost/vdpa.c:754:22: error: incompatible types when assigning to type 'pgprot_t' {aka 'struct '} from type 'int' >>>>>> cc1: some warnings being treated as errors >>>>>> >>>>>> vim +/pgprot_noncached +754 drivers/vhost/vdpa.c >>>>>> >>>>>> 742 >>>>>> 743 static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf) >>>>>> 744 { >>>>>> 745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data; >>>>>> 746 struct vdpa_device *vdpa = v->vdpa; >>>>>> 747 const struct vdpa_config_ops *ops = vdpa->config; >>>>>> 748 struct vdpa_notification_area notify; >>>>>> 749 struct vm_area_struct *vma = vmf->vma; >>>>>> 750 u16 index = vma->vm_pgoff; >>>>>> 751 >>>>>> 752 notify = ops->get_vq_notification(vdpa, index); >>>>>> 753 >>>>>> > 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); >>>>>> 755 if (remap_pfn_range(vma, vmf->address & PAGE_MASK, >>>>>> 756 notify.addr >> PAGE_SHIFT, PAGE_SIZE, >>>>>> 757 vma->vm_page_prot)) >>>>>> 758 return VM_FAULT_SIGBUS; >>>>>> 759 >>>>>> 760 return VM_FAULT_NOPAGE; >>>>>> 761 } >>>>>> 762 >>>>> Yes well, all this remapping clearly has no chance to work >>>>> on systems without CONFIG_MMU. >>>> It looks to me mmap can work according to Documentation/nommu-mmap.txt. But >>>> I'm not sure it's worth to bother. >>>> >>>> Thanks >>> Well >>> >>> int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, >>> unsigned long pfn, unsigned long size, pgprot_t prot) >>> { >>> if (addr != (pfn << PAGE_SHIFT)) >>> return -EINVAL; >>> >>> vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; >>> return 0; >>> } >>> EXPORT_SYMBOL(remap_pfn_range); >>> >>> >>> So things aren't going to work if you have a fixed PFN >>> which is the case of the hardware device. >> Looking at the implementation of some drivers e.g mtd_char. If I read the >> code correctly, we can do this by providing get_unmapped_area method and use >> physical address directly. >> >> But start form CONFIG_MMU should be fine.  Do you prefer making vhost_vdpa >> depends on CONFIG_MMU or just fail mmap when CONFIG_MMU is not configured? >> >> Thanks > I'd just not specify the mmap callback at all. Ok, will do. Thanks >