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 7F17CC43334 for ; Tue, 21 Jun 2022 17:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350323AbiFURvP (ORCPT ); Tue, 21 Jun 2022 13:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232708AbiFURvO (ORCPT ); Tue, 21 Jun 2022 13:51:14 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D6841EC41 for ; Tue, 21 Jun 2022 10:51:13 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id e4so16356186ljl.1 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=bClxJKzJBMiw9bx5BVSjl91Cb2zshLpMDk9RvAJ3TF7mj1HVSLd/C8TzcgRLH8134V iRRk3B7ov0VoYhFfDLnDtD803wJ6amBlPhdNIe/o9XNk0tvQaQIHtpP6tZpYaAuBLvsx oZxzg2ue89ExSpDT3QHfUKwOmfu7yOrbeDFUQnVxeH6WcDUXXbQD0JKpCSaXHneSQKcu OQc2wG0IqmKG+fweHoopxkMlaSCC6KGnZtg9K865pZFMs6F63UXXydBq5W4cDx9O2me6 o9i+VgFnweD/3OD+k1lIlltapzaqYv6cLW5ilXuvSj2UYqP59ZRo9hESnhFnCOXpopRS 1uTA== X-Gm-Message-State: AJIora9qzh3AQ4YSS6rVR42TPC7ByCvCSL6aPdjXmyO1dvWZE96Da2cR s0koF+nH0ONNgrXGUtdXbXbZDhuWuL71Droo6plIGA== 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" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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".