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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4E0B9C43334 for ; Thu, 23 Jun 2022 08:24:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E8E9840441; Thu, 23 Jun 2022 08:24:03 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E8E9840441 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y0ehVAeFGAgR; Thu, 23 Jun 2022 08:24:03 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id BA14E404A8; Thu, 23 Jun 2022 08:24:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BA14E404A8 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8F785C0032; Thu, 23 Jun 2022 08:24:02 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id EF9D9C002D for ; Thu, 23 Jun 2022 08:24:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BBE2160E66 for ; Thu, 23 Jun 2022 08:24:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BBE2160E66 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j4bwfoeJXG4j for ; Thu, 23 Jun 2022 08:24:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1AACA60E45 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1AACA60E45 for ; Thu, 23 Jun 2022 08:24:00 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id 4EBD2447; Thu, 23 Jun 2022 10:23:58 +0200 (CEST) Date: Thu, 23 Jun 2022 10:23:57 +0200 From: Joerg Roedel To: Suravee Suthikulpanit Subject: Re: [PATCH v3 7/7] iommu/amd: Do not support IOMMUv2 APIs when SNP is enabled Message-ID: References: <20220622171131.11870-1-suravee.suthikulpanit@amd.com> <20220622171131.11870-8-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220622171131.11870-8-suravee.suthikulpanit@amd.com> Cc: thomas.lendacky@amd.com, ashish.kalra@amd.com, linux-kernel@vger.kernel.org, vasant.hegde@amd.com, iommu@lists.linux-foundation.org, robin.murphy@arm.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Jun 22, 2022 at 12:11:31PM -0500, Suravee Suthikulpanit wrote: > bool amd_iommu_v2_supported(void) > { > - return amd_iommu_v2_present; > + /* > + * Since DTE[Mode]=0 is prohibited on SNP-enabled system > + * (i.e. EFR[SNPSup]=1), IOMMUv2 page table cannot be used without > + * setting up IOMMUv1 page table. > + */ > + return amd_iommu_v2_present && !amd_iommu_snp_en; IOMMU_v2 APIs could actually be supported with GIOV and IOMMUv2 page-tables in-use, no? Regards, Joerg _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17CCEC433EF for ; Thu, 23 Jun 2022 08:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229693AbiFWIYC (ORCPT ); Thu, 23 Jun 2022 04:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbiFWIYA (ORCPT ); Thu, 23 Jun 2022 04:24:00 -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 AF79AC0 for ; Thu, 23 Jun 2022 01:23:59 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 4EBD2447; Thu, 23 Jun 2022 10:23:58 +0200 (CEST) Date: Thu, 23 Jun 2022 10:23:57 +0200 From: Joerg Roedel To: Suravee Suthikulpanit Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, robin.murphy@arm.com, ashish.kalra@amd.com, vasant.hegde@amd.com, thomas.lendacky@amd.com Subject: Re: [PATCH v3 7/7] iommu/amd: Do not support IOMMUv2 APIs when SNP is enabled Message-ID: References: <20220622171131.11870-1-suravee.suthikulpanit@amd.com> <20220622171131.11870-8-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220622171131.11870-8-suravee.suthikulpanit@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 22, 2022 at 12:11:31PM -0500, Suravee Suthikulpanit wrote: > bool amd_iommu_v2_supported(void) > { > - return amd_iommu_v2_present; > + /* > + * Since DTE[Mode]=0 is prohibited on SNP-enabled system > + * (i.e. EFR[SNPSup]=1), IOMMUv2 page table cannot be used without > + * setting up IOMMUv1 page table. > + */ > + return amd_iommu_v2_present && !amd_iommu_snp_en; IOMMU_v2 APIs could actually be supported with GIOV and IOMMUv2 page-tables in-use, no? Regards, Joerg