From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 330FF7C for ; Sun, 28 Aug 2022 04:18:10 +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> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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