Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4348149pxb; Mon, 27 Sep 2021 15:10:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn13ERv2YRZqI/FFV6rHGEkl1s0xwtK3QDUxOAfG892P7W7T8bBR+i/nylzXrnowftfeFf X-Received: by 2002:a62:8896:0:b0:437:701c:43d4 with SMTP id l144-20020a628896000000b00437701c43d4mr2293519pfd.21.1632780651362; Mon, 27 Sep 2021 15:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632780651; cv=none; d=google.com; s=arc-20160816; b=b4FyjD2YeQKgCwgwuAajMJAEkluGPQ8Ew/2mt+OwI1r50L9mXtL570pHyDgGf+x/4R ZoWRuf8OrwhbK3qJgZyBV3t0DE96RE1A6hGUcnPhd8T3d3xuoTgF5jLw+YKE/Fb7o+s4 2mpyLzcq0EFH3V+G9AJm1DC4S1x0VwlDVMZOD7irLASQcsWCrrmPtwnfvjcBx0habRLA h7Iij83u96PDyxUtEQ5iAKpciyDjTcBWEOhAnvEZ3aBSv41mzyr3wiVcisWF+Qq/IXZw 5W5COOs8Wg+c91IyuiyQZLeq9yN1UM8Yat8eNMsq/M1UtfOFNnHJSyTxCiBvrcBdVZcl D+WQ== 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=AlsOtt1HkU9FHs1jkzkGfXAXEYqguAUFS1q2I7ksodo=; b=rwZDYRW54kQ1D/GF/6EOV+aAar3WHXyOtj0wTV2LvQlaG4W/RpO8ypqS1gahc/a/Yt z/zgaZ/QfyGhGdi5fQKKTRvkew9Ga34Z/TUyifYLRcrfdVesjdUjgnysb1Sf1Y9748Tw Y6vIRCcPnXvkdug0avEFPYhPBQi/Fepgxm9RNAzk6a1cIp9CvL2Htlm50p5K+S4v4I74 MhsVdzd+tzOb3FUUJ/sJzG73wnQbH62FtRR/6Idgmo+i9RZLZDcn/0rBOE+8/BMeoP22 9MnXonL1VogpzxGUWJk19J0BlD5lk7CV5LmOh0TMmFnzOCjMSpyvayvlb7OV6D5BKNQ7 RMTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Knfz4Ihn; 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 x15si10845754pla.340.2021.09.27.15.10.39; Mon, 27 Sep 2021 15:10:51 -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=Knfz4Ihn; 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 S237697AbhI0WJ4 (ORCPT + 99 others); Mon, 27 Sep 2021 18:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237871AbhI0WJx (ORCPT ); Mon, 27 Sep 2021 18:09:53 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7C66C05174B; Mon, 27 Sep 2021 15:05:37 -0700 (PDT) Received: from zn.tnic (p200300ec2f088a00839935e3d35582f9.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:8a00:8399:35e3:d355:82f9]) (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 34CAA1EC04E4; Tue, 28 Sep 2021 00:05:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1632780332; 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=AlsOtt1HkU9FHs1jkzkGfXAXEYqguAUFS1q2I7ksodo=; b=Knfz4Ihnj3SPawJGXShW+AkVXIiVjF2HujWe+6V6Or/F6oYI4kxme0OQlShLrctpOKMLAX aVJai24kdEs8+l44exepufmGN8bkgxmmtxJnHieNaoLAXjYZUj+GDOW9Bf0j0PeVwHXBhF UFK1BYvepeFHbN/9S3rjd4VHLYKy9b8= Date: Tue, 28 Sep 2021 00:05:22 +0200 From: Borislav Petkov To: Smita Koralahalli Channabasappa Cc: Smita Koralahalli , x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Luck , "H . Peter Anvin" , yazen.ghannam@amd.com Subject: Re: [PATCH 1/5] x86/mce/inject: Check if a bank is unpopulated before error simulation Message-ID: References: <20210915232739.6367-1-Smita.KoralahalliChannabasappa@amd.com> <20210915232739.6367-2-Smita.KoralahalliChannabasappa@amd.com> <60d4f6be-76f7-e4b6-6fb5-2af78b01d32d@amd.com> <7e790ba1-0b31-690c-7bd3-d8361109cef5@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7e790ba1-0b31-690c-7bd3-d8361109cef5@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 04:56:17PM -0500, Smita Koralahalli Channabasappa wrote: > Yes, this makes sense to me now. But you meant to say inj_ipid_set() > instead of inj_bank_set()..? Yeah, I had it correct before: "This whole thing belongs into inj_ipid_set() where you should verify... " > > Something like this: > > -MCE_INJECT_SET(ipid) > > +static int inj_ipid_set(void *data, u64 val) > +{ > + struct mce *m = (struct mce*)data; > > + if cpu_feature_enabled(X86_FEATURE_SMCA)) { > > + rdmsrl_on_cpu(.. > .. > .. > + m->ipid = val; > + .. > +} Yes, and return proper error codes. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette