Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3502984pxj; Tue, 15 Jun 2021 02:18:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn52zh+VBTiPlRZyIxt8pURU6NcSDicPHEcFRGLEyGnK5vG4hPA+4uIFHXp+Ee4mFwWtxL X-Received: by 2002:a05:6638:634:: with SMTP id h20mr21061516jar.14.1623748701796; Tue, 15 Jun 2021 02:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623748701; cv=none; d=google.com; s=arc-20160816; b=nntLOCFcvf3DWBSUwk1lijISYdbvy1FqzyGlfc2/BIq19dkBl3DlAm6DKe1NRYYav9 gXiBiM2QEpY3PF83d3UuR8PyCEVpvLIE65kynCQsmg1QDMzNSE5UZgslY8jqfLkeiOv4 qkcIG/eDdUXKR13H4betA0GamRiW1K67HJ2mY5As8byC8pf0AnQC3q4m3bBBiUgyTYDA ZZ1yPCKHqy3NzzneafbB1r8Eh7m4jfQTwCG1tMSpPZiFrYyEnwjweNQMg3FXIZSS5Rz7 BdBtlL4LJcAmnvQVJSSUE8sZUXzNBVYOXdmHudXzz4WOHovqNyqmJ3kPgWRnbPmWrmYx MW2g== 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=hqIYPsMwV7tG6Ke4inrHNWrKVe2HcOY1FBNTW2EP1K8=; b=Q6C3CzoIG0B7H+FM1lIuVfZoyl52LGgwdK5v0hzlWvVmgl27ezwFk9qMM0XVFlDFvy 4gAQLVzhJFc23YVtG+UVOKN0aCvsE6blbedHfWLQBn135JnYZM5cPEtnO67e6f5dhjXV WPLeByts6TERcw18TrvAdDk7wwsSa/kC2AVIGYY56BhzDpzBWPQlEpWTDy6FarcWExLg 6/PyG/EAw3cb1nreLebEMBZ6F+c0anL6xebuKtV5UhrxCxN5uU4/bk2ja9xa48FIf4qS rEfVcUmFWU8xFw5OCx0m30bF3fVHjPyjr9ChmqJTZ3MjVUmTneRe0AyufElEFEtG55ka +2Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=MYGKSP2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si19902985jat.118.2021.06.15.02.18.08; Tue, 15 Jun 2021 02:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=MYGKSP2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231287AbhFOJTF (ORCPT + 99 others); Tue, 15 Jun 2021 05:19:05 -0400 Received: from mail.skyhub.de ([5.9.137.197]:33944 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231280AbhFOJTF (ORCPT ); Tue, 15 Jun 2021 05:19:05 -0400 Received: from zn.tnic (p200300ec2f0f2700c2d40b448c69f909.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:2700:c2d4:b44:8c69:f909]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C4DB61EC04CC; Tue, 15 Jun 2021 11:16:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1623748619; h=from:from: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; bh=hqIYPsMwV7tG6Ke4inrHNWrKVe2HcOY1FBNTW2EP1K8=; b=MYGKSP2mEXE480lkbMjFysAOLu325KtlnsVqcDX1+2Xy4APTwDlG4IC5hyO0jaW9GaLSvc xIz/ftNhxNKi4cvMi1DQHoRU1lxaB94iyHNT0XBrnp0ZiDdXzlT3Cf6tI6Ovu3NqyIhMxQ C2JLW5g8oK5noF6ikjPxooEd1Zi5VyY= Date: Tue, 15 Jun 2021 11:16:49 +0200 From: Borislav Petkov To: "Luck, Tony" Cc: Smita Koralahalli , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" , Mauro Carvalho Chehab , James Morse , "yazen.ghannam@amd.com" , Robert Richter Subject: Re: [PATCH] EDAC/mce_amd: Reduce unnecessary spew in dmesg if SMCA feature bit is not exposed Message-ID: References: <20210614212129.227698-1-Smita.KoralahalliChannabasappa@amd.com> <16a34b6834f94f139444c2ff172645e9@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <16a34b6834f94f139444c2ff172645e9@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 14, 2021 at 10:25:36PM +0000, Luck, Tony wrote: > I expect all the Intel EDAC drivers that load based on CPU model have similar > issues. Maybe they aren't whining as loudly about not being able to find the > memory controller devices? Right. > Though perhaps this is an issue outside of EDAC and x86_match_cpu() > could do the HYPERVISOR check and return no match. The few callers > who want to believe the fictional CPU model number passed in by the > VMM would need to use some new variant of the call? Yeah, we could do X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_NOT_FEATURE notice the "NOT" and have a x86_cpu_id.not_feature which to match X86_FEATURE_HYPERVISOR. I'm not sure it is worth it, though, for a handful of drivers. The whole thing is a meh, why bother, but I got tired of this particular intent of people wanting to shut this error message up just because they should not load that driver in a VM in the first place. But what happens is they boot a guest with -cpu host and in that case that's a new CPU - family 0x19 - so it doesn't have a case 0x19 for the pr_warn_once() there. And instead of keep adding adding families there, I'd simply check X86_FEATURE_HYPERVISOR. Oh and that thing - mce_amd.c - doesn't use x86_match_cpu() so it has to be an explicit check on function entry. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette