Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5105594pxb; Thu, 14 Oct 2021 19:35:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuI5nrT9nn8/5ZWasntqeqdBrE9JaEtQD8GIhZ4dMJvcRNKAA3pLtaN8dwvy+a0XHJh/jN X-Received: by 2002:aa7:dc4f:: with SMTP id g15mr14174043edu.76.1634265340615; Thu, 14 Oct 2021 19:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634265340; cv=none; d=google.com; s=arc-20160816; b=hG1K7i+6AYJKqZOU9OphF+LJRgU0r9iLRVIkb5oRfhJntbfayqwjdM73NcPEvN1C0S GC+XcHUbkDsd8lYFVI2TV7ckk77RfbXe0vo7URlMhF9jq6zqHYO+4VpJNug4Zkvc4Coz H91MAk9T/CnJ0j+UYFUdcg8LBEQc+lNprgUzqCQMTeL9//pfVbkwxJ5rJG5GLc/l8oeE NH/W7Pd72fGkF4aQE6NkiqMwX8RtLRtaQWMELddsddFJZxQoCXdMhs3VAwfKJQnvrXxu w178n2C0WPrG8suNpCZsBHgn2rRu+liDV9bf/ckEB7Wr0imt4zeN4OF6DaRgmxstZ05M MR7w== 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=K5jVYDYpo2SuHDXGnI+KSEFfIqZ+k70o6c+m/JWkA14=; b=kQVnEGrfZ3B+8HM/5x2N80ZY4U8lU1HJjSWqX5x4fdG7WhRThm9qU5jOz5nc1xl29x rpCKXR1ltpRXtrnEYPtqe92iNHexFTv1lShLnXFPzE80yDe3o/bsto6wbi52Wdwizpml rW0kzyMnknEmHUIumG4jzVNv4MqGWmaXHJcxe/KLbRyo8lp471BYWI2MbDWfsa6FrEJF PzFVYNZvYWPjWlTNTxjfN7IoihhuknR8fzemmGVaauS7qcakUWVyrSOdR8ofiVHPfZZp vwag+fhkBdNVPpuGNajULulqz8jEkkjy3Qf7zhWyQff1poMhC2iGcEOZr5/zbo+EJnXG vn8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Y0Ef0wi1; 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 qf19si8395792ejc.226.2021.10.14.19.35.07; Thu, 14 Oct 2021 19:35:40 -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=Y0Ef0wi1; 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 S232571AbhJNU7X (ORCPT + 99 others); Thu, 14 Oct 2021 16:59:23 -0400 Received: from mail.skyhub.de ([5.9.137.197]:41160 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232537AbhJNU7V (ORCPT ); Thu, 14 Oct 2021 16:59:21 -0400 Received: from zn.tnic (p200300ec2f0c720083d5cb613c3a152b.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:7200:83d5:cb61:3c3a:152b]) (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 791FE1EC0136; Thu, 14 Oct 2021 22:57:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1634245034; 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=K5jVYDYpo2SuHDXGnI+KSEFfIqZ+k70o6c+m/JWkA14=; b=Y0Ef0wi1zvwUrReVx98MNbStY/zKGPpguytZTdgX3bj1INStDwX2F67djlbYHZlJpG40VF 1RjVjynrElPOHeR+0SNp2bu28zbZAXjFNNPiq0+xbZp/w4wVmi5rQjB+BZlFtoYhVa4mid ivhnoSqFPNUFZZMHcQxNEX7zl2UdLbs= Date: Thu, 14 Oct 2021 22:57:10 +0200 From: Borislav Petkov To: "Koralahalli Channabasappa, Smita" 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> <78bec0e8-a64a-466c-4245-2386de7db5c9@amd.com> 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 Thu, Oct 14, 2021 at 03:26:13PM -0500, Koralahalli Channabasappa, Smita wrote: > My concern was, we need to determine whether the bank is unpopulated or > populated before trying to inject the errors on a hw injection, for which > we need to read the IPID MSR of that bank. Ah, that. Look at the smca_banks[] array in .../mce/amd.c and how smca_configure() prepares all banks in there. You could use that array to query which SMCA bank on which CPU is initialized, before injecting into it. > should be retained inside inj_bank_set() ? And yes, I guess you'll have to do it there because then you know which bank and which CPU the hw injection is supposed to happen on. > And inj_ipid_set() should just set m->ipid = val on a SW_INJ as you mentioned > above? Yap. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette