From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05EC1C433EF for ; Wed, 30 Mar 2022 08:45:46 +0000 (UTC) Received: from localhost ([::1]:60566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZTxZ-0002wZ-40 for qemu-devel@archiver.kernel.org; Wed, 30 Mar 2022 04:45:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZTp0-0004IZ-2q for qemu-devel@nongnu.org; Wed, 30 Mar 2022 04:36:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZToy-0007Z6-24 for qemu-devel@nongnu.org; Wed, 30 Mar 2022 04:36:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648629411; 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: in-reply-to:in-reply-to:references:references; bh=KObeNLNKrqs/VAgd/IuKiq9VEAYibhSvxyAcuQojKao=; b=ej9C6huQ4RZi9mmz2nrzNm3YIoZ6dkfhzQYZ5UGWgD3eZfT66A1XamqnrlFgX5Rr20wGvW ovFo6Ma3lykJZDbKKZe7QetihotTW1i7rrY1F9rniA6mHbAL3uKdMO5p5E7HrfD6Nw72mT qsSOWGtMrdfaJ2DnsvJZP8MG1m+xWGI= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-402-3AuCFLbZPu6d1AXjTI5ZOw-1; Wed, 30 Mar 2022 04:36:49 -0400 X-MC-Unique: 3AuCFLbZPu6d1AXjTI5ZOw-1 Received: by mail-lf1-f71.google.com with SMTP id b7-20020a056512218700b0044869874779so6244121lft.3 for ; Wed, 30 Mar 2022 01:36:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KObeNLNKrqs/VAgd/IuKiq9VEAYibhSvxyAcuQojKao=; b=xcsZuj0vy66hh+nFFoApw7pq/ZB0bySvy5jPs1AjVC65hhDA1WQOPCoP/+pXKHS6qw EONieFeHuJrGPoVrm9uJCAGGMw/hH+UnOSjgKoQUvCRB6zPHnPztrphScsAg2FIlfPC3 /lfMwtccgcCLUaZzH/3cRYE/XR4wgwkQgQQlHcUbHB0We+o0mUz3+ThjwvGScFqSYllG JxmO6OI7qzE5xZL1H7ymvsfanRRLBDB1a+SefXAOIXfJD28QGtwSM88ouFLTkEwIuFIl x2eOReSuXGu7wJv8d+m1UfPloMysK0292pkPb599vRdWcedj6GU435TDkVtM/CLZ/QWb UGMw== X-Gm-Message-State: AOAM530UizP07KpfsUt5H5GDIRzGgCI4mtBcVP5tqPuQnMrIpKOIMlGR 1pJE/V7lBWotnyigxCUxc+9bnYjISJR6o/g7lKLCkaa311twizKs7ChMwqFOUGjYZqapoYKy2sC eXqWWjT3Q/aCB4jTAouNoymT7fOO7Zmw= X-Received: by 2002:ac2:4189:0:b0:448:bc2b:e762 with SMTP id z9-20020ac24189000000b00448bc2be762mr5973395lfh.471.1648629407936; Wed, 30 Mar 2022 01:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6+UwtUFiXjZr7JLK0QoSj7cEc8xpXavPcikfl+BjyC8kPQ0T4Nw7W7enhjZbgKkYW0kKe0DRKpQ+Rkk5V+g8= X-Received: by 2002:ac2:4189:0:b0:448:bc2b:e762 with SMTP id z9-20020ac24189000000b00448bc2be762mr5973382lfh.471.1648629407727; Wed, 30 Mar 2022 01:36:47 -0700 (PDT) MIME-Version: 1.0 References: <20220321055429.10260-1-jasowang@redhat.com> <20220321055429.10260-2-jasowang@redhat.com> In-Reply-To: From: Jason Wang Date: Wed, 30 Mar 2022 16:36:36 +0800 Message-ID: Subject: Re: [PATCH V2 1/4] intel-iommu: don't warn guest errors when getting rid2pasid entry To: "Tian, Kevin" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=170.10.133.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Liu, Yi L" , "yi.y.sun@linux.intel.com" , "qemu-devel@nongnu.org" , "peterx@redhat.com" , "mst@redhat.com" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Mar 30, 2022 at 4:16 PM Tian, Kevin wrote: > > > From: Jason Wang > > Sent: Tuesday, March 29, 2022 12:52 PM > > > > > >>> > > >>> Currently the implementation of vtd_ce_get_rid2pasid_entry() is also > > >>> problematic. According to VT-d spec, RID2PASID field is effective only > > >>> when ecap.rps is true otherwise PASID#0 is used for RID2PASID. I didn't > > >>> see ecap.rps is set, neither is it checked in that function. It > > >>> works possibly > > >>> just because Linux currently programs 0 to RID2PASID... > > >> > > >> This seems to be another issue since the introduction of scalable mode. > > > > > > yes. this is not introduced in this series. The current scalable mode > > > vIOMMU support was following 3.0 spec, while RPS is added in 3.1. Needs > > > to be fixed. > > > > > > Interesting, so this is more complicated when dealing with migration > > compatibility. So what I suggest is probably something like: > > > > -device intel-iommu,version=$version > > > > Then we can maintain migration compatibility correctly. For 3.0 we can > > go without RPS and 3.1 and above we need to implement RPS. > > This is sensible. Probably a new version number is created only when > it breaks compatibility with an old version, i.e. not necessarily to follow > every release from VT-d spec. In this case we definitely need one from > 3.0 to 3.1+ given RID2PASID working on a 3.0 implementation will > trigger a reserved fault due to RPS not set on a 3.1 implementation. 3.0 should be fine, but I need to check whether there's another difference for PASID mode. It would be helpful if there's a chapter in the spec to describe the difference of behaviours. > > > > > Since most of the advanced features has not been implemented, we may > > probably start just from 3.4 (assuming it's the latest version). And all > > of the following effort should be done for 3.4 in order to productize it. > > > > Agree. btw in your understanding is intel-iommu in a production quality > now? Red Hat supports vIOMMU for the guest DPDK path now. For scalable-mode we need to see some use cases then we can evaluate. virtio SVA could be a possible use case, but it requires more work e.g PRS queue. > If not, do we want to apply this version scheme only when it > reaches the production quality or also in the experimental phase? Yes. E.g if we think scalable mode is mature, we can enable 3.0. Thanks > > Thanks > Kevin