Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp855791iog; Fri, 24 Jun 2022 16:14:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmJMeqEcB4qwqXOb2FFV8Owkl/Y6FqoTt5AcUL79SJA7GvPsrcyAE+d+zDS+e8AP0bFRhi X-Received: by 2002:a17:906:6a23:b0:722:e1ba:964c with SMTP id qw35-20020a1709066a2300b00722e1ba964cmr1281842ejc.680.1656112490232; Fri, 24 Jun 2022 16:14:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656112490; cv=pass; d=google.com; s=arc-20160816; b=DHu8HTHJNOfzHkzaQbO+i5JPAE0saNAl031IjV9VkT/Ekun8EGojMg8p7Se091OQtw j/TMsPEt1TyH2jBNl2fmFjJ1JXvJOsiLpKSEjvGQbdLfMq1VYu4Gb85zMbAYDDKnw5/8 02BfKRZuPaKtYEugRn24WtNRn8/E812EAS4O49BLa+LRF4NLcZCEe+29o2VS42Gg4uQJ DYIf7MhpPhZ5+6ab50vO7jkr0VE6ym+TsD7mT84BkOE2oen8btnqaA9bM92pm+gLDKZg B1riWb4W5FiOALJ3y3/vAYK6dBNUozWxF9HaPf6lUgGlDG0D0vIZLWf51kYAdI79PUJm DRfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=n2FmnrN5KQD0GJVgRw/tnbjbq6DUxveOfTtd9pG/vQg=; b=qEAbmdxBkghWHzpJVaqtwiJIaQa+kntWR2+fXte2b7i5qovqPRlPsp8/RA//O3sWQ4 8Xrpa6jMO9HDgJxecPa1YPc1vgXsAqTh/csmMV66xdxAU7C1gEqpJFIrVBq9v9BsluDo Qfu2lrurUKE2OqgT/LY1tjxSYgdKCP+kHR+OPnZbbMJ8xvdUjSeZKRH+ewyxEUhQTKJv iODV53Kuox+7SiOJy0ZnSa8qFb76toDgdUurNB2IojTdloM0Ti4Ck2Mykzk/dy/BHFPq tlbeAv6qonp5LZhp2pB0/X7sN8ijQ36HHZOiyxI64oCrmjhEew20AUaE+VY7RYN+SMke M0jQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GMh2G4hM; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js9-20020a17090797c900b006f3d2558d4bsi4606040ejc.496.2022.06.24.16.14.11; Fri, 24 Jun 2022 16:14:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GMh2G4hM; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbiFXWet (ORCPT + 99 others); Fri, 24 Jun 2022 18:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbiFXWer (ORCPT ); Fri, 24 Jun 2022 18:34:47 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2073.outbound.protection.outlook.com [40.107.223.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D63E53A53; Fri, 24 Jun 2022 15:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iscbVgrb57gLPDRAOVRn0QDxb0k9tPl8xR0AxXSCa5MiwdIks04ZlwiXOW/YgsjUZo4vS4WOGF3x4tAvD0gf4l8G/8topqt8IZ9i3d1X7lt195XiwbCYxOpgyEeyY6wjSkekdAKhUV+dBnch3DLQKGkHcOClO0TYZKWUTFPSHRvXRjnFhROHfyxaAs3A3p4FG0h/QIKl/vtlJ8NlSz/zZDrItl2wgeC+v+7VHgIza5F10eKNdfkaApLN3t9+Wf+Ye62dHhlsoK0nOJNT4fC/9kCCDu98lNZsb9UBu5A14VfgTZ3pvinGQQE/RFn7UKNZ82Vqybip+hKppukGTRz9kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=n2FmnrN5KQD0GJVgRw/tnbjbq6DUxveOfTtd9pG/vQg=; b=oaMSFug1wvlvWlZ/Bpc7rkgUYYuVz71cHTpKzFiLUNX4d+MT2/IXIcuoBbURVMdWBBDrkVOx7yq8ORVxhDBqObjkakHlRkiqxXQGn3R5H71dB+j/QqxCTsVWTXLDNzKvLzfPLkcCAKMTzupKo/Dkz5NSZUCoWxVby19dRt0eweexrFgcSH41rshqEYSC3lnxM2fFVzzenE4xDz+8qBmh/VrI3tGVactW9iWbSnN8EgiQsimR/F9wNRSV2xofUS47r5ctnNRPAiJvbVSh3OLNLs9hMl7SooA2s4I90GcZslVrmHnPskUkyiNsKLFeV0vNeYOve3hyZCXhXIvbHELTfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n2FmnrN5KQD0GJVgRw/tnbjbq6DUxveOfTtd9pG/vQg=; b=GMh2G4hMeDPUYez6C2gmpPv8ARjdFCh3aEL8fftFnpQPNWp7tE1ALdFJWvf4WHklLKCynnDzNnsigldhIZCkudtdrxYnsz1nuOF38bsUa1lw9AZNVNkq3t2ka+CEtk7Uy7t65hChIf1sCRmfTN9RSJ+3RDJGlvoRzI3nYg41a6I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB2869.namprd12.prod.outlook.com (2603:10b6:a03:132::30) by DM6PR12MB3884.namprd12.prod.outlook.com (2603:10b6:5:1c7::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.16; Fri, 24 Jun 2022 22:34:44 +0000 Received: from BYAPR12MB2869.namprd12.prod.outlook.com ([fe80::9dbe:b7ea:e0a9:6c08]) by BYAPR12MB2869.namprd12.prod.outlook.com ([fe80::9dbe:b7ea:e0a9:6c08%3]) with mapi id 15.20.5353.021; Fri, 24 Jun 2022 22:34:44 +0000 Message-ID: Date: Fri, 24 Jun 2022 15:34:42 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v5] x86/mce: Check for writes ignored in MCA_STATUS register Content-Language: en-US To: Borislav Petkov Cc: x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Luck , "H . Peter Anvin" , Yazen Ghannam References: <20220610192515.98540-1-Smita.KoralahalliChannabasappa@amd.com> From: Smita Koralahalli In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR05CA0054.namprd05.prod.outlook.com (2603:10b6:a03:74::31) To BYAPR12MB2869.namprd12.prod.outlook.com (2603:10b6:a03:132::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c5cc932-7156-4a13-5308-08da5631bc7e X-MS-TrafficTypeDiagnostic: DM6PR12MB3884:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 479ShtpB517YyQD19aQLEP8x59rf25ENc1cBtCNlYRFO0geBESupgrFYDw5Qdq9lwaLWa39vOixWoE9FnulHfb/1ErEx65v1+OxmrW4zV2HD3BylmP5OofypkwIUVwCXesoYiWsf8I98+aEv2go9W8CDl3VDp+y43tasyLZlzPEm+vUt2isBT2g0u+ubf/79ijur0VQBjQp4UEMzily63FJugPk8rNSHK8fXKt93Wh5OPhENxLeCMcTitf7gfi3o3txBe7iaAJNIMQR3qlU4WrPeai9tkMq5iFMzxluem8mBUoIiv8bgR/T1NBv2EDtHJ/03suQuYQuBeVX29sqTw1XMYa9YxW98EMLV8XxyleLt+0WEFacwFSBpoHwrZgedolHVU7RH+Dn3IwwHGxvuM77SIxCYxyFDtOn5sUqabpJR7rYHmfYzybF4/HV08LhT3Q3ySp81/1NxLauPdaZQvaLwTk4IxkqQsLppaRtXX1q8Y2AP2BLWoO7c0cGY7JEgcAcRsULUiXTtQl1t/Rts3YDmFNhf8WeyXslLRXjJIZk+vYckJsbFgthsC0ISNu5EoJ6rDnr1MV1UEFgFOpLX8osuePcCsPuV48+Lkf4MwO+EicGLzbDdfwYrJP7yMmL5X5KoDD2zXAI7L6FIRLFmkSpCV8Gs6UJ3DuMq7SD2Z9KLVPxZZWgwCgRDcIIvSEOevzUt+0a5X/3pRde+zisxoBmuldeLZnr85dHPGP/FJoznmEKmWYdQ4Nb5zpHnPCDedEpCtKh/Zoys3l6a9BrmtsPrQ8dxaPFO2u8M9a95wfu5Exdbwm0WDH373EsR08qk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(366004)(136003)(396003)(346002)(39860400002)(31696002)(66476007)(6506007)(53546011)(6486002)(86362001)(5660300002)(66556008)(4326008)(66946007)(38100700002)(8676002)(6512007)(41300700001)(6916009)(478600001)(54906003)(316002)(36756003)(2906002)(186003)(83380400001)(8936002)(2616005)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Qm11SXA3MTBsM1ZSYURTdFZFMHpJZTR6U21XU1dHcE55V21rMFVFMlBlU3Jk?= =?utf-8?B?N3ZTT3B0bkpmU1Y2Y0Y0N3UvYVp4U2UzUE81S1RGZnk3SERJZWtHVk5EOGZm?= =?utf-8?B?OWFlSDRYY1hvcTJ1enpmdUR6b1RJdi9ZTnZFWmFVOXlVMUNXZjMvYlA0NStR?= =?utf-8?B?UURvWUZaT3VNQW05RzgrS25sRTJnT3l4NkcxTUV2WGEvMWgvM1VXZDZHM3hx?= =?utf-8?B?ZGk3c2tCeWZyVEU4TWh2MXlJck1wcElXR3BCZUIyY25BaGdFRW5XWDNiQmlX?= =?utf-8?B?YUp6TlpGZXNzcUM4UDFJTG1sc2ZZTXIzeVkxQkExZnJFU0QzQmNVZU4yMHMz?= =?utf-8?B?KzY0aTZiUjZ3UnJFbU5IVnNqN3IzRTduMGdZVGdqbVd1TnlYbnYreXlFWUY1?= =?utf-8?B?V2N1ZkFYV053TDdoZ0lmaWVMSlR0b3VEeWJVaWZKM0NhaU52RUdGc2hCVWw3?= =?utf-8?B?T2F3Y1NQL2NE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5631bc7e X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2022 22:34:44.3221 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K29kp+FGpQrGUT6cPP+N2y/qlbdEbbzacN2Ysppo6lxKHaQNTxJgQxSmALva6PkRFc/KEl3OHh/eVn+rsTM/bA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3884 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, On 6/22/2022 10:29 AM, Borislav Petkov wrote: > On Fri, Jun 10, 2022 at 07:25:15PM +0000, Smita Koralahalli wrote: >> arch/x86/kernel/cpu/mce/inject.c | 50 +++++++++++++++++++++++++++++- >> arch/x86/kernel/cpu/mce/internal.h | 2 +- >> 2 files changed, 50 insertions(+), 2 deletions(-) > I've simplified, improved and removed some stuff. See if that still > works on that platform which ignores writes. I tested out the patch. Its not behaving as expected. The module fails silently again. > + cpu = get_cpu(); > + > + for (bank = 0; bank < MAX_NR_BANKS; ++bank) { > + u64 status = MCI_STATUS_VAL, ipid; > + > + /* Check whether bank is populated */ > + rdmsrl(MSR_AMD64_SMCA_MCx_IPID(bank), ipid); > + if (!ipid) > + continue; > + > + toggle_hw_mce_inject(cpu, true); > + > + if (wrmsrl_safe(mca_msr_reg(bank, MCA_STATUS), status)) { The wrmsrl_safe() doesn't throw an error here. I think we need to read back the written value and check for it whatsoever. What do you think? Thanks, Smita > + hw_injection_possible = false; > + pr_warn("Platform does not allow *hardware* error injection." > + "Try using APEI EINJ instead.\n"); > + } > + > + toggle_hw_mce_inject(cpu, false); > + > + break; > + } > + > + put_cpu(); > +}