Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1391292iof; Tue, 7 Jun 2022 04:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpDPqZUl4Nv7aYYAdY9X6TT1AkKvhQ+DgnqQs2hxLTLEKENFKyGBY7LQhIhqC3MZamfLwi X-Received: by 2002:a63:2246:0:b0:3fb:b992:f3d2 with SMTP id t6-20020a632246000000b003fbb992f3d2mr25259073pgm.82.1654602725173; Tue, 07 Jun 2022 04:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654602725; cv=none; d=google.com; s=arc-20160816; b=CMFhnS7nGPyOrTd/IkgjT9iVcZIz/6nDpmXN1QmaY+/o2FIHqsgh+3yvwK8YrK81pO XAGhlvXYYTOz20mFjtTqsvmLwBgB6xcB+HFWyOij4tHZLOSZGwkNr2F7FZcw0y1hqxel gr/n6tbHbDWQj27EkluHwlixT1gkFIXTJrHEfvLMI1FUADLZ+SQeCxxjx6zoKmE9oE3m SdWllxai0xmuVCx78I7mskiJr5YGj6ljjpqk8MUp/eaKyNd3PjwokJGlUTJa9n1TIajG r4HF7qGIACqm7sDpJ+fO5jUrl0p9CbmI90Ygij+KZAfpHwXndi8AyW+dkdHZLnxlPQPE jAeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+m0IpQ+/MxagTZPFNTpt+OQv4iHOFmCMgnX00Yggbk0=; b=zu/Dnv6YmQNMdLQk5Es9lEfVV7/cZDHZ0klkqtWrikBB9imB76d6r4LJZUPOVYWhLB r+hdRB6rXkh7DnISeFk39+YY1TfpI7V/TQ6FBhS4NtQNb53sMawZg/dkQRf/K+pis1dG XClRyXLwF6PDEzaqJ1Hu0ntP4rfUhI90GKSJrrhSSRUgDMT6UmIRt/IZYl2hCmPXVLGb CpyecwM3VLE/jeR7a8qxMbZapJk/ZjNNwSFkAdreXBtXf2x/0KVCVRmbiWzkDzcRy/sx i1DjvjFnlgzf21PgjAmg28TA+NsFstFXTnHo+fvI2n57oxTthG1EoCM43FRro0uByF32 hsFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a170902e88200b00163655cc8e9si25590662plg.203.2022.06.07.04.51.50; Tue, 07 Jun 2022 04:52:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237781AbiFGIAs (ORCPT + 99 others); Tue, 7 Jun 2022 04:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231506AbiFGIAq (ORCPT ); Tue, 7 Jun 2022 04:00:46 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB63CC148 for ; Tue, 7 Jun 2022 01:00:45 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 487BF423; Tue, 7 Jun 2022 10:00:43 +0200 (CEST) Date: Tue, 7 Jun 2022 10:00:38 +0200 From: Joerg Roedel To: Suravee Suthikulpanit Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, vasant.hegde@amd.com, jon.grimm@amd.com Subject: Re: [PATCH v2] iommu/amd: Set translation valid bit only when IO page tables are in used Message-ID: References: <20220509074815.11881-1-suravee.suthikulpanit@amd.com> <1dfaf07e-040e-848b-db7c-86a107fd5cb3@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 26, 2022 at 10:29:09AM +0700, Suravee Suthikulpanit wrote: > Actually, I am referring to when user uses the IOMMU v2 table for shared virtual address > in current iommu_v2 driver (e.g. amd_iommu_init_device(), amd_iommu_bind_pasid). From what I can see this is not handled yet and needs an additional check. I think the best solution is to set iommu->iommu_v2 to false when the SNP feature bit is set. But that is probably not enough, all functions that are called from the IOMMUv2 driver need to fail. Regards, Joerg