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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91000C433EF for ; Tue, 21 Jun 2022 17:51:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA63A8E000D; Tue, 21 Jun 2022 13:51:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E55A18E0003; Tue, 21 Jun 2022 13:51:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1D9B8E000D; Tue, 21 Jun 2022 13:51:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C23B18E0003 for ; Tue, 21 Jun 2022 13:51:13 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9361634A31 for ; Tue, 21 Jun 2022 17:51:13 +0000 (UTC) X-FDA: 79602984426.28.917111A Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by imf14.hostedemail.com (Postfix) with ESMTP id 14AA3100086 for ; Tue, 21 Jun 2022 17:51:12 +0000 (UTC) Received: by mail-lj1-f174.google.com with SMTP id s14so9597097ljs.3 for ; Tue, 21 Jun 2022 10:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/sWmRxaBB/7Gvydpg8oN2fyGVNJ3tXVZl0R1M5vQ/Us=; b=SIUQ2bfTgtqyKzjQXnVabWR9Z3n/VgrhU2riRxw0AgmXz5H2i9bjCSpp+euFcuWuLr btapNTHSb4sb6Dlc8c5EtrlKyvn9xrjsaMXEm7aPioRHs8rBMY+uZERTAzQmLVQnK1vN yKhxZkZUR82fcxHyRRqxyWHUHzDwy9sB8NRvzJ+vl/OwnzuaafTUAnsbscxCWGwt7jMB 59esRMJI0H8QHYn6id6vBjd3uYPVHJcFcswVldGJo9tbKjNdP2YqadzjvdVZprf72/is jTh2NPUKW0DrIwZ3k8Ui1RzbVJGEGC+pQhncUSl4DSXTSJGsx66cmG7eT/EtfXyb3aRj zdMg== 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=/sWmRxaBB/7Gvydpg8oN2fyGVNJ3tXVZl0R1M5vQ/Us=; b=QV9Xxrb0HgizpBt9MlCdb+RTsegWwo36eqyn+9leTCwGPcvVlCiLPx+kRW/QMO40Uj 86Zdrg/l4A1TcXGIJycN4cUidldg981Hjqra+ioVgbfu6ukDfSAoYap8TIr8pTcWCu4x Q6jc20wwlve1X8XWREzjHLJn3mfpgTn6xjl/02D2tnjR7eJkxAkX7ku21Bp3leQczofI oid5wHAVd0HPBrksVHH8YFcAZLreFWfmNdi+vc+dRw9HEE2srHz2WzNeRt4VzooRK5zj pYHclCiVppt9XveQN/gR+/FEjqZOPrQA6w18fAjSg5UQP5yM6dc135I/GlBt1pcjdxA2 0jlA== X-Gm-Message-State: AJIora8F/VPP/ygPMtzdNrStXvRJNXFbGeJLvuIbOzrq+ufGpnq0YAm3 T5Uu/wYXqm3JhH83UYztbin8bMN4OYbMXvSG8+qf9zn4EgP3ad4e X-Google-Smtp-Source: AGRyM1u/rxKy61/kcfa19O8kX+IARHxZ6GtcuY38CjxLPfM7sYm5YakXgDPAfoWdCippLLsbDohcmMAiLcyZQHFOTn4= X-Received: by 2002:a2e:2a43:0:b0:25a:84a9:921c with SMTP id q64-20020a2e2a43000000b0025a84a9921cmr375799ljq.83.1655833871147; Tue, 21 Jun 2022 10:51:11 -0700 (PDT) MIME-Version: 1.0 References: <12df64394b1788156c8a3c2ee8dfd62b51ab3a81.1655761627.git.ashish.kalra@amd.com> In-Reply-To: From: Peter Gonda Date: Tue, 21 Jun 2022 11:50:59 -0600 Message-ID: Subject: Re: [PATCH Part2 v6 02/49] iommu/amd: Introduce function to check SEV-SNP support To: "Kalra, Ashish" Cc: "the arch/x86 maintainers" , LKML , kvm list , "linux-coco@lists.linux.dev" , "linux-mm@kvack.org" , Linux Crypto Mailing List , Thomas Gleixner , Ingo Molnar , Joerg Roedel , "Lendacky, Thomas" , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Borislav Petkov , "Roth, Michael" , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , Tony Luck , Marc Orr , Sathyanarayanan Kuppuswamy , Alper Gun , "Dr. David Alan Gilbert" , "jarkko@kernel.org" Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655833873; a=rsa-sha256; cv=none; b=v6DxvtuxUKijLAjLphsJmuHfR74fNjGFA0vDxruCVxpiifvSmKfNcUJIW0T5l99gBcO1ST H+nTrXnjqs0KaKLWITPhWoNv1fAMoDtRXKEEK+3kpQ+UlYwwkb2siM3788tNAlIaSsMJJL XpuYoVCpyFWfUhyeNlDq/+Kunnjp3KM= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=SIUQ2bfT; spf=pass (imf14.hostedemail.com: domain of pgonda@google.com designates 209.85.208.174 as permitted sender) smtp.mailfrom=pgonda@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655833873; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/sWmRxaBB/7Gvydpg8oN2fyGVNJ3tXVZl0R1M5vQ/Us=; b=f3kTYzXnl2BdfQF3Nj+wPrPiWTlfJSSaD2Og+Zg8TyyDJ4Ah7XB5W7p0QTXQkU+ETSq06F sxerWz6plo87pXDWeF3hDrsZ8QTdtF/pzzqAmRDnLMU3Kw5YnbKl/pJLV1ybZ+0PWYf9EY w3z9w5HpKDJZ6sgkyGbhULfm5+gZjME= X-Stat-Signature: 8kmkn4agqt6hcz5tttugsodb8pyhgkg7 X-Rspamd-Queue-Id: 14AA3100086 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=SIUQ2bfT; spf=pass (imf14.hostedemail.com: domain of pgonda@google.com designates 209.85.208.174 as permitted sender) smtp.mailfrom=pgonda@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam07 X-Rspam-User: X-HE-Tag: 1655833872-297373 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jun 21, 2022 at 11:45 AM Kalra, Ashish wrote: > > [AMD Official Use Only - General] > > Hello Peter, > > >> +bool iommu_sev_snp_supported(void) > >> +{ > >> + struct amd_iommu *iommu; > >> + > >> + /* > >> + * The SEV-SNP support requires that IOMMU must be enabled, and is > >> + * not configured in the passthrough mode. > >> + */ > >> + if (no_iommu || iommu_default_passthrough()) { > >> + pr_err("SEV-SNP: IOMMU is either disabled or > >> + configured in passthrough mode.\n"); > > > Like below could this say something like snp support is disabled because of iommu settings. > > Here we may need to be more precise with the error information indicating why SNP is not enabled. > Please note that this patch may actually become part of the IOMMU + SNP patch series, where > additional checks are done, for example, not enabling SNP if IOMMU v2 page tables are enabled, > so precise error information will be useful here. I agree we should be more precise. I just thought we should explicitly state something like: "SEV-SNP: IOMMU is either disabled or configured in passthrough mode, SNP cannot be supported".