Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2944341ybz; Mon, 27 Apr 2020 07:22:31 -0700 (PDT) X-Google-Smtp-Source: APiQypKr2iixE7Z56DGWLobQ1OaCaWLcROKNjJPI5dy1YFZhOFjx6ZRk8o8fZTuZy5JfMy3eh1P6 X-Received: by 2002:aa7:d30c:: with SMTP id p12mr12720532edq.19.1587997351269; Mon, 27 Apr 2020 07:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587997351; cv=none; d=google.com; s=arc-20160816; b=QbN1AMZ6GtWHQ1eubfp0cC8yAOYwgeWlrCgc8QCgUaO5/mCmqsz5Xdv/t1O0yoIM2R 3zfdwWaTOOcn9VJdqHmQRxEBdrSWjuWQLh/zpoK2aQaCn/6fcjUCY4m0igBR38nLZmzm q6P6I4yiSzitc/o4Yb9/PhdIpYwphJLfPHBLFoYKrP4/WPoNJWw1XX/OJ47F8/kQNY8h Le86fCKeQrqHDzpqqNcJlv1viUsGVpAPXkuY1n+CAGYNH6xuc1rSUOVcaMheB+6mN/Oj 2cwpXoX190W/LhBU5Dqnt4jbiOSfsDGFADtaXMATCzui2I9wESUoIwQSgRer9tzHfloI Hupg== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=//IIDXbV7XRjpK24m7Wh2m8pTq6hYTKHqfhZLqX4Iik=; b=bAfnTwE9MN/3YH4vJkTMrojLazguIxJSbHq7EfCSnnbCxNHlxmCYsykJDR4DZ29ysC S0L1PeYgBspl/nNhgeNkaXhV3pwbuWHKByreWCA4ILgdK24tQwG1YknF8qSwGc3hdI/2 2pG7X99K8JSHCpBtWPX2KuW53Rqh+WNUZiJwVNyUzZrFwolYSqikGRddJalOHIABhIPW jyMozD0VVl7KUFOVAyyM5SvoBFIGwI8b6D1p3G+0RjKmYsLGozkYYrdkfEx8IerEk09p ge9AkRvIv4y3rKywJwx9znn5YhxEin1S+OaT2nVcokEFCJfKPVwMlJkCmJ2rxCzXQxkw 0Oew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g8Uwg6Wf; 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 cb14si8202791edb.529.2020.04.27.07.22.06; Mon, 27 Apr 2020 07:22:31 -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=g8Uwg6Wf; 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 S1728055AbgD0OTE (ORCPT + 99 others); Mon, 27 Apr 2020 10:19:04 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23675 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728023AbgD0OTD (ORCPT ); Mon, 27 Apr 2020 10:19:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587997142; 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=//IIDXbV7XRjpK24m7Wh2m8pTq6hYTKHqfhZLqX4Iik=; b=g8Uwg6WfE9yUric8ZwxaMAVJ9ppcQvYRH10QVxKfYtsd7ANsWVByy1hSSVgfCvROO7wUcr xoZosvZ0qYcWiiJCog43KMw5vmeewF6baFy6id4UZkqauDKUEQ9oS4GJ9nsTLrwqBozvqr AlAXQ4LUdnpJCjc1OZ8WVeczFDH/unU= 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-358-Zad7BFGDMceHE1Cw8nJ5Ag-1; Mon, 27 Apr 2020 10:18:58 -0400 X-MC-Unique: Zad7BFGDMceHE1Cw8nJ5Ag-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81BE8928E37; Mon, 27 Apr 2020 14:18:46 +0000 (UTC) Received: from x1.home (ovpn-112-162.phx2.redhat.com [10.3.112.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id E06E31002388; Mon, 27 Apr 2020 14:18:41 +0000 (UTC) Date: Mon, 27 Apr 2020 08:18:41 -0600 From: Alex Williamson To: Jason Gunthorpe Cc: "Tian, Kevin" , "Raj, Ashok" , "Jiang, Dave" , "vkoul@kernel.org" , "megha.dey@linux.intel.com" , "maz@kernel.org" , "bhelgaas@google.com" , "rafael@kernel.org" , "gregkh@linuxfoundation.org" , "tglx@linutronix.de" , "hpa@zytor.com" , "Pan, Jacob jun" , "Liu, Yi L" , "Lu, Baolu" , "Kumar, Sanjay K" , "Luck, Tony" , "Lin, Jing" , "Williams, Dan J" , "kwankhede@nvidia.com" , "eric.auger@redhat.com" , "parav@mellanox.com" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-pci@vger.kernel.org" , "kvm@vger.kernel.org" Subject: Re: [PATCH RFC 00/15] Add VFIO mediated device support and IMS support for the idxd driver. Message-ID: <20200427081841.18c4a994@x1.home> In-Reply-To: <20200427132218.GG13640@mellanox.com> References: <20200423191217.GD13640@mellanox.com> <20200424124444.GJ13640@mellanox.com> <20200424181203.GU13640@mellanox.com> <20200426191357.GB13640@mellanox.com> <20200426214355.29e19d33@x1.home> <20200427115818.GE13640@mellanox.com> <20200427071939.06aa300e@x1.home> <20200427132218.GG13640@mellanox.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Apr 2020 10:22:18 -0300 Jason Gunthorpe wrote: > On Mon, Apr 27, 2020 at 07:19:39AM -0600, Alex Williamson wrote: > > > > It is not trivial masking. It is a 2000 line patch doing comprehensive > > > emulation. > > > > Not sure what you're referring to, I see about 30 lines of code in > > vdcm_vidxd_cfg_write() that specifically handle writes to the 4 BARs in > > config space and maybe a couple hundred lines of code in total handling > > config space emulation. Thanks, > > Look around vidxd_do_command() > > If I understand this flow properly.. I've only glanced at it, but that's called in response to a write to MMIO space on the device, so it's implementing a device specific register. Are you asking that PCI config space be done in userspace or any sort of device emulation? The assumption with mdev is that we need emulation in the host kernel because we need a trusted entity to mediate device access and interact with privileged portion of the device control. Thanks, Alex