Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp420784pxb; Wed, 22 Sep 2021 05:19:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+53/CsmjTmUZ6Esp79w38iBMDhwxFWuKOTd+q2Jq9IF/in1/B9AZZxBOjKSJORWXisPF6 X-Received: by 2002:a1c:192:: with SMTP id 140mr10062729wmb.186.1632313169680; Wed, 22 Sep 2021 05:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632313169; cv=none; d=google.com; s=arc-20160816; b=ZuggVn0TgFChPmUihClEec3HHSsIuxx+SRlG76RTkvftp+ql3OLmzuN3x9gvpmkP53 COpT0tbrUZAeb9Zhtk5sxzmJgMIeQsLJ/pX2TSl97l/P/rpXtKeEW04VVYwTUdDfkVE6 rJVGJ+hDn1PrqT7iHt1rW2yFQ5+T0WO6/VhSjPaE5gzQ14Sqgl1+WGf9dtCcIUcRPPJG kAaO/4S/M7i1sqFp5U+WcRfkbd60FBFNzHVYTQljE4AlZ5t7j8i5UP2e91BXKdbKX1uU Mx5Z6Y2NLlwqYHIb6SQXdm1mcmwbl7pCoI9ukJJDdQACEmlP2l6WkOYv9Ciywv4p+o7N nXOg== 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=bPqfYE8RZbJ72xbl93j2JzQG8AN+hGnfzeqayWkvLAI=; b=A72+GjhLOgG044kQyHr6f0kTKaoTAtYQ9na595suGhBDqQsp55daqoagWWUTWFFsn3 RZ7rEraXj3nal9tpz9SAbdcN3nbW6AV+RZpSgCXgXVLWKcuC+LU1aE8q2Ohw+rTOFg9p +ONg88MjgbM3MR71ksj2wgyhVLgoyvdO8r4oBHHMKXVrpagK8D0lOmO5jmcPnn6GNDZ6 J8F+s3FzoMce6T9yEGfpK8zgjKi1YOop93BLB1NOlzRdX8M0ms4zBl/tGAA5RfFFyTsU f85SK0mZPDEwPdAxYUsJqht8+qOjWymM91gVigsAa1LKG19BYGpnHleasW9Y2rUJ0IGr D+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ToL9LnoF; 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 i10si3009483ejd.745.2021.09.22.05.19.05; Wed, 22 Sep 2021 05:19:29 -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=ToL9LnoF; 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 S235422AbhIVMSb (ORCPT + 99 others); Wed, 22 Sep 2021 08:18:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234294AbhIVMSa (ORCPT ); Wed, 22 Sep 2021 08:18:30 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F60EC061574 for ; Wed, 22 Sep 2021 05:17:00 -0700 (PDT) Received: from zn.tnic (p200300ec2f0efa00329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:fa00:329c:23ff:fea6:a903]) (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 CC1621EC051F; Wed, 22 Sep 2021 14:16:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1632313014; 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=bPqfYE8RZbJ72xbl93j2JzQG8AN+hGnfzeqayWkvLAI=; b=ToL9LnoF9tRMccxG9lT5nbKCHTUScOQiLGYu2ML6Aq22WQDNACTAvt15Wf8Pcz4CKHAAiN AuxARku8myqmhQFgoovqoE3nLrS47qHP1HwyVGEgMA6pxVEzuC3m7hcldtnOGQAPt1k+Ks WnkMAlR9bOOHEXgmb21JJ3qxMRqjJYY= Date: Wed, 22 Sep 2021 14:16:49 +0200 From: Borislav Petkov To: "Luck, Tony" Cc: Yazen Ghannam , X86 ML , LKML Subject: Re: [PATCH 3/4] x86/mce: Get rid of msr_ops Message-ID: References: <20210917105355.2368-1-bp@alien8.de> <20210917105355.2368-4-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 20, 2021 at 10:32:11AM +0200, Borislav Petkov wrote: > but please don't make me add more helper functions. Those MSR defines > already have "SMCA" and "IA32" in their names so that should be a good > enough differentiation, I'd say. I just had a better idea - it is compact but regular and one can see at a quick glance which block is for which set of MSRs: u32 mca_msr_reg(int bank, enum mca_msr reg) { if (mce_flags.smca) { switch (reg) { case MCA_CTL: return MSR_AMD64_SMCA_MCx_CTL(bank); break; case MCA_ADDR: return MSR_AMD64_SMCA_MCx_ADDR(bank); break; case MCA_MISC: return MSR_AMD64_SMCA_MCx_MISC(bank); break; case MCA_STATUS: return MSR_AMD64_SMCA_MCx_STATUS(bank); break; default: goto out; break; } } switch (reg) { case MCA_CTL: return MSR_IA32_MCx_CTL(bank); break; case MCA_ADDR: return MSR_IA32_MCx_ADDR(bank); break; case MCA_MISC: return MSR_IA32_MCx_MISC(bank); break; case MCA_STATUS: return MSR_IA32_MCx_STATUS(bank); break; default: goto out; break; } out: WARN_ON_ONCE(1); return 0; } -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette