Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp49512ioo; Fri, 20 May 2022 13:38:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIX6UgJIo9BO2htPfur60ZO5AxEs0v/7owDRwLlgCwh8g1pG4IlYyzmqccmtS5VctVBIri X-Received: by 2002:a17:90b:1b4d:b0:1df:ce69:77b9 with SMTP id nv13-20020a17090b1b4d00b001dfce6977b9mr12374256pjb.179.1653079098326; Fri, 20 May 2022 13:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653079098; cv=none; d=google.com; s=arc-20160816; b=ABJB+2gMHbNZxu90RLqCQMVdQAaIK3y0tAu7EXtP1JX7p+XctcrnI8E8FCkzglu++H LvYaKC6cMEqipXIYhCwsxoy6A/DLoM9gEa9Yh8nO2JdmpLGUSyYGFh615G7mLfh5Ie5E kgcXvVX0/RoSsSv3PuUo8PrbhPVyEHPITvhZy19Ah9QGfTSrzOwm3zNwfxKYB7lwh+4r AJvVBuKNQeNnHCBH8kQnEk1SLiBB8kd5yOK5cTLbRwSFCYrltGoQYBEeoUOxfSIFjSkD rcKczcXF/OVZgylzFVTCErJ/7IYZZgSK7LXEACpVfTCuud00+nDxIzadyjzz1Zrztipk /J2w== 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=rPitQd/v6dg81yrfILXnCpI3r3UWjFHvfXC0IAjaNrM=; b=Q+pgLpZS/MUrnzpqxJM9kaWcXq9eiHYEYzuFWQ4GftVc1Ma1SY2QY6Doz9nvFi56Oy nJQVKyMWHtwbsZ4FTp02otrywwCZW4wkov2JvodFNAR6SEEBTXqtkuBoofsQP/XuwFYi ZiARek9SBGGbzoyLpdjvsXzNnJE6EjERFMl8YrKdyhSp4ZoQXPyB0EZoOTXG9arif6vT FmxiULRCTia9vpdaZB58H/TR4+8uFRjzhvrkt39+cNWtawiQ5tQN+KZIQf0UAl5Hb/FE V0MI4/qw1GGCAIzxSVFPZ0m+/tF0NBZrkSgI2TaRSwdNKvZouwLSMKcnVXpAHYyeQKL0 5How== 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 i74-20020a639d4d000000b003ab35377352si575466pgd.662.2022.05.20.13.38.06; Fri, 20 May 2022 13:38:18 -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 S1347466AbiETI67 (ORCPT + 99 others); Fri, 20 May 2022 04:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238692AbiETI64 (ORCPT ); Fri, 20 May 2022 04:58:56 -0400 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2425D029D for ; Fri, 20 May 2022 01:58:55 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 1B98A1E9; Fri, 20 May 2022 10:58:54 +0200 (CEST) Date: Fri, 20 May 2022 10:58:53 +0200 From: Joerg Roedel To: Robin Murphy Cc: Suravee Suthikulpanit , iommu@lists.linux-foundation.org, jon.grimm@amd.com, linux-kernel@vger.kernel.org, vasant.hegde@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> <794e13dd-8eae-481d-711d-b5462fdbfb18@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <794e13dd-8eae-481d-711d-b5462fdbfb18@arm.com> 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 Fri, May 20, 2022 at 09:54:51AM +0100, Robin Murphy wrote: > The .def_domain type op already allows drivers to do exactly this sort of > override. You could also conditionally reject IOMMU_DOMAIN_PASSTHROUGH in > .domain_alloc for good measure, provided that (for now at least*) SNP is a > global thing rather than per-instance. Yeah, that could work. I am just not sure the IOMMU core behaves well in all situations when allocation IOMMU_DOMAIN_PASSTHROUGH suddenly starts to fail. I would feel better if this is checked and tested :) Regards, Joerg