Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1907658rwe; Sat, 27 Aug 2022 21:54:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR5tZFVAkhgDAo3Cd//ZRJseQ4/HdIiVtucVNcMcIT9lY9IfywHvCm5Xx7tJ9PX52Fxa7E4G X-Received: by 2002:a63:d617:0:b0:422:4d27:5817 with SMTP id q23-20020a63d617000000b004224d275817mr9370666pgg.412.1661662484094; Sat, 27 Aug 2022 21:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661662484; cv=none; d=google.com; s=arc-20160816; b=bWzQN+dFTECWX7GgH10janfaoxgUUWQokRaXHIFmdlR5FVnaFTs7TP1MCyqWvqIHFD tb4lx0Lx7i83UdKrjNPCFdGo2+41S40Eg/oYXGxYRgT6GOKKfoo/L3AV4gWAlB7rw6kC I6Iq+pCcLlpxhmfII0tBXaFgFYlSDBGv8/6JEqUr32vbi1RBhTzf6stHLB0vZeuSyUhi JVgNuugFkFYSf9zHggEJfyexrYdEnRaNabiU994sm90yp5uJk4pwSo+OKl9A+BtRyv+4 iKr655JVmMLBXafFe8CRK/DsXlS+xlH8A4AP1M4Mf5PXoAtDJDZPVPb3A2iaT0yk+7WG ZXXQ== 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:dkim-signature; bh=sDusgdszL4Qm0/Ljdwpyndtmn5xT2pd5nrQ3d84P+Ss=; b=wiFxezTUwN4iTRITND1HQXRVBywaatX5mXOFe7LBHhuvN0XvnbETs/609jLWooVPfB vSNkIfNcuAirW5SjhEYMelYJe6RfV+AKirpULtURUt95Nc5358pccr/72lz37DY2RGZy Ex+F/blLaTTw3VUtoWMNxtD9ZeKjUwgZ6tfevsGk+3tb/tezh2W8TVrAYBdnxCO3HD90 yUUMlOmLhU2wiWlhUHZhp3huvmn5w/GbL762AUHRAT0/1PWhqcGQRBh3mt5uTKfjKI9X RVRuO2lj3OJrJONQNAGwyW/TdHfxU/ZwFJLY0J6PUzhFTDRhe+GYrnzrquML0NIioo4q e3TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nmqpvICa; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a17090341c100b001746cd9e69esi3386538ple.361.2022.08.27.21.54.13; Sat, 27 Aug 2022 21:54:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nmqpvICa; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbiH1ESO (ORCPT + 99 others); Sun, 28 Aug 2022 00:18:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiH1ESN (ORCPT ); Sun, 28 Aug 2022 00:18:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C4643CBE0; Sat, 27 Aug 2022 21:18:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 14947B80AB0; Sun, 28 Aug 2022 04:18:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A00DC433D6; Sun, 28 Aug 2022 04:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661660289; bh=b1DxuemUuHqOzbSQHotO5yGNBJEyQ9fNAcJWznoBnHo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nmqpvICagbOYzuUK7zRSHuKWYR4Q6wHz8Z9BkMNnSLOBbT3S9p5jf0P52D7k/ZA34 bP6vV99xNBskD3SnyAx9kgBAXl7RZWs0v8z8zyi4DZ49GSquJa1D52Nop6T5IsWn9b 50PJkZjDYXCr5OT1/m3MiZSXOT4WN1QSb+9RZEawAlQPjul2E9aPJSWl0qAp/0zVP0 TLRINEII6KF7d2AcAPgWVRhqFhnirzGoVeJ73gOpnN7pybKLs78LO5I1El23pKyXGq jPA+f4DkI4LJcocNVCzvyeTM7yQdnYM+rQTA8bHrXCWMPlN69lDOPDJAvOETpgzis/ 8N8bc3zBd4WMw== Date: Sun, 28 Aug 2022 07:18:02 +0300 From: Jarkko Sakkinen To: "Kalra, Ashish" Cc: Peter Gonda , 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" Subject: Re: [PATCH Part2 v6 02/49] iommu/amd: Introduce function to check SEV-SNP support Message-ID: References: <12df64394b1788156c8a3c2ee8dfd62b51ab3a81.1655761627.git.ashish.kalra@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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-crypto@vger.kernel.org On Fri, Aug 26, 2022 at 06:54:16PM +0000, Kalra, Ashish wrote: > [AMD Official Use Only - General] > > Hello Jarkko, > > >> > >> It really should be, in order to have any practical use: > >> > >> if (no_iommu) { > >> pr_err("SEV-SNP: IOMMU is disabled.\n"); > >> return false; > >> } > >> > >> if (iommu_default_passthrough()) { > >> pr_err("SEV-SNP: IOMMU is configured in passthrough mode.\n"); > >> return false; > >> } > >> > >> The comment is *completely* redundant, it absolutely does not serve > >> any sane purpose. It just tells what the code already clearly stating. > >> > >> The combo error message on the other hand leaves you to the question > >> "which one was it", and for that reason combining the checks leaves > >> you to a louse debugging experience. > > >Also, are those really *errors*? That implies that there is something wrong. > > >Since you can have a legit configuration, IMHO they should be either warn or info. What do you think? > > >They are definitely not errors > > Yes, they can be warn or info, but as I mentioned above this patch is now part of IOMMU + SNP series, > so these comments are now relevant for that. Yeah, warn/info/error is less relevant than the second point I was making. It's a good idea to spit out two instead of one to make best of spitting out anything in the first place :-) That way you make no mistake interpreting what does the log message connect to, which can sometimes make a difference while debugging a kernel issue. BR, Jarkko