Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4276496pxb; Mon, 27 Sep 2021 13:16:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjSBMkQSXnGMEDW3gBz2e1GTot/j5ah7PSH1xSggpbjY0l8bllJdsd1h0fzFBjsnorF9WL X-Received: by 2002:a05:6a00:130c:b0:444:f9d4:d800 with SMTP id j12-20020a056a00130c00b00444f9d4d800mr1815411pfu.38.1632773793318; Mon, 27 Sep 2021 13:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632773793; cv=none; d=google.com; s=arc-20160816; b=oRKuTY4It+acEhOIpd6L5K21zwC1+X43H9G4z1NQBviowNkUG383NkaDPSw6x4bXLe vdSxwIEbGIk78yQkrsKVdag/RRnIwSTnNNk0ntXhNUsYpyZtstrpgKEe86wig/eSrySb AW24CR7XUg6t/blLQZz+uY8GWO21nvMsZiraztcX7UViRMdezQNsnsEsI13sQd1M1C82 OySphL18TEctKl0K3iFCWF+zYAcY6eXaNoJofdL289kH0IjDKk1Lfo5ftHdfZIR6bnO7 lqRD33BEtNC+hHK+UUarW0PUNxwqUyDHkwKcaO9c5Zu5I8DE5zj0pAMQ5B1dFvwB8oVI 8o7Q== 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=9fgz9ufaSd11gMVgWCc5Z6EQNVl50vlDQQ3NXzL1vqU=; b=TCL0DISjSDpT27wJ889DkcckIyvkAGntGriOXNjRVN5FZhgliF295SXeQfqG77VFR4 jQ6qw5yQewh6ST7Gwddhrx6AwfqGD+8hMrgUsifguJSQdQpWv/jf4kLJCvjoECupN8YD vaAjzrNeqi1tXD8Q72AIDAc2dGHm8eZZ48srmAVNDwPYMvdqAkNszbYlAXyL+NJ1S1CN LxNy/EWDsJoaDxvk+cDRGDLcoO++7dgpB5D0O3iYqMJqq35sVX9xaO3TQvlezjNK098S Zd8eopurXdnC9TWeLigIK4wNZByO/PW1qzJ3JHv5XHiBFRVtvKfyDaamk3I+ATeQPfIb YiuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=JRbmcAKn; 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 r11si19803918plr.438.2021.09.27.13.16.20; Mon, 27 Sep 2021 13:16:33 -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=JRbmcAKn; 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 S236895AbhI0URJ (ORCPT + 99 others); Mon, 27 Sep 2021 16:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236763AbhI0URI (ORCPT ); Mon, 27 Sep 2021 16:17:08 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45395C061575; Mon, 27 Sep 2021 13:15:30 -0700 (PDT) Received: from zn.tnic (p200300ec2f088a0023fd899c9252ef55.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:8a00:23fd:899c:9252:ef55]) (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 997FF1EC069C; Mon, 27 Sep 2021 22:15:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1632773724; 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=9fgz9ufaSd11gMVgWCc5Z6EQNVl50vlDQQ3NXzL1vqU=; b=JRbmcAKna1rdBafGBmbNM70lWbZ2NcFnIoaivEnDoEvjoZRkuMXLQuc7c3zrT2p28o8eux RJWIlpqw25iZJWt8Iwzrbj9azNQfON5k2zI/X+LbsAoaYWdsnu5ilTdvOH06W8PUqrrQ40 xhq6k1P2opqwaPcJxDwHhMhGrENKyeg= Date: Mon, 27 Sep 2021 22:15:18 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <60d4f6be-76f7-e4b6-6fb5-2af78b01d32d@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 02:51:56PM -0500, Smita Koralahalli Channabasappa wrote: > Can you please elaborate on this? I'm not sure if I understood this > right. Should I read the ipid file to verify that the user has input > proper ipid? If ipid file reads zero then do rdmsrl_on_cpu? No, on a write to the ipid file you should do that checking and write if the bank is populated or fail the write otherwise. And you should put all that code in inj_bank_set() - that's why I say "on a write to the ipid file". And instead of boot_cpu_has() you should use cpu_feature_enabled(). Makes sense? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette