Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2183359pxb; Thu, 4 Nov 2021 15:38:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl0qJ3ioYDMCKtfU+E7mXn5Co38FabFBO0+x9lWoF+9kh5yvShYbCiuiuy7Tlp6TLKE226 X-Received: by 2002:a05:6402:5113:: with SMTP id m19mr15059187edd.312.1636065486323; Thu, 04 Nov 2021 15:38:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1636065486; cv=pass; d=google.com; s=arc-20160816; b=jIUU/ef2qlYtGOB2t/uziajY/N17fJEKLfKEc4mFNIwdwQo9NWum2JTxR/4DJ38Aeq /Fs5b71/yA0/VP0mzZk84969OJCOmH8eqtx+jWYtCoim/ChSIX8+k+L0ocMJI/2IdAun GUXq7oL/B2k4a8EmCfWZdUxaZ70rdAYBLw4ZCxbS/129HEdjUCsHaEOgsgr2LTULBil8 yjcyhLDpSdBbAoJeZ3P5gePBoS6taNh/CnsuUPSRxi6MdlNjhBJrBHbl5qQkJYu/XWi/ Jv/jWGKkc9OvAQ/Q+CFAMxRB6h5YXq2GdZLZA8SfZ1LNlgpZ8+xOgoG0BDMmhTQUD177 FDQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=uFxWfPPorOy9WhNmZlhKG+noZvCsbGIWUNZmO9zoH3g=; b=UBodstnun6bIJvJxGhLxEpCCLk2zVRAmiqB2cnrmRkrKhuuAVGfcKHNvi0u1eX1oCx LJ+afb9Vl52SpuW3og4R8Rx0PgPuzOc7zSEh5JYpP2jH+AuQ39zuzKUzyooS/nPKMTjq KMHIFd0KmVDMWyGR+GqddGGifbuniaptr+FlyzzPXAOHkIgocoWjcvOvw5YxwNHmeh1Z XS+ZrQjP6pagzqS3zboqH9vxVOOkIPmuOUkEVzc5TEqyWRrSiWumiKDzKqDDDgi9hESS n+YVYj6UkDTPw7vUKVrPtkcntNCrhBRlWA7QWX7rO0JWpYf6syMmUnjPYO9eLSQv652F FmIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Q3LJES4+; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qb36si7678551ejc.388.2021.11.04.15.37.42; Thu, 04 Nov 2021 15:38:06 -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=@amd.com header.s=selector1 header.b=Q3LJES4+; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232167AbhKDWBp (ORCPT + 99 others); Thu, 4 Nov 2021 18:01:45 -0400 Received: from mail-sn1anam02on2042.outbound.protection.outlook.com ([40.107.96.42]:43297 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232119AbhKDWBo (ORCPT ); Thu, 4 Nov 2021 18:01:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uslsj6eBqH07+rpdtJphmDXB/pNmhhTViTccZlHycF8MwDZz3ggkvYBk6fNC++u6PYLRBlqC470U9fOTpJl3NcpOojU1Iuf6lyL63IblkbdPhxEcuFXVyPq4kK1/LBMdQqpp5xYpdbnZCmEGSVaEEFHN3JVzfMVnMAYv9WZHe1ozCmXLGQ79mqIX/BzSiW3nYhBG2m1qxAFVH7UwASL8OP7E/dBdzspdhWs6BIPfGRkCyEyS8vGyJMeASCCT2Eb68EbAioPBEshrCxli359Z7xq5GCZVOs4CmwQX2wSaNflV5y3KcUz/3uDY+7RzwEkYVe/OvmJSqiWTAXzAgZ+9KA== 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=uFxWfPPorOy9WhNmZlhKG+noZvCsbGIWUNZmO9zoH3g=; b=FxttzkrKtvh+QAkF7MHkn9p3G83DR99t0PZvUFi+Zul5b075LtHcz6es9qjYeIosb9KK1F0m9ycXs7pKDyzP6VaQEtSGIl4MlXDiFTBO65Agb874DGrE/zOG4YsI2k4NprNV2X/6+RwN6J1/rHERArqSjjUj6sfsmf5oOq/Z9ynJIgvYvv7zEnPHiuJ4Wo1snJterda3SMdePLaWc1bcabjzEAML9MddnhrV7+BqKNdnLgxPeL8DCjiIy7x3F6q0ueIqEVQZO7Q0JLITeZjQq0FgGwnW9mmlMYSH6d70jibtgr58F/f1pfULUIwSL3niSblC2I5pRUWOWuJKwjwiLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=uFxWfPPorOy9WhNmZlhKG+noZvCsbGIWUNZmO9zoH3g=; b=Q3LJES4+3fxfaesUqKFI8cw8IDdom02Q3hPaegA+u3QhjlVVOF44BDGtGoUXTt7hOoYjhu1oAQoLges4eKyOFJYZ8rk1XpioWhqmkU66PYKmE/lL9oE5/VxIvomuo9plIUhzR+UFzl1uNcIRGux92OOb1gM2qP+Vgm9FF7PxNTA= Received: from MWHPR22CA0005.namprd22.prod.outlook.com (2603:10b6:300:ef::15) by MW2PR12MB2539.namprd12.prod.outlook.com (2603:10b6:907:9::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Thu, 4 Nov 2021 21:59:03 +0000 Received: from CO1NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ef:cafe::56) by MWHPR22CA0005.outlook.office365.com (2603:10b6:300:ef::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Thu, 4 Nov 2021 21:59:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT023.mail.protection.outlook.com (10.13.175.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4669.10 via Frontend Transport; Thu, 4 Nov 2021 21:59:03 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 4 Nov 2021 16:59:02 -0500 From: Smita Koralahalli To: , , CC: Tony Luck , "H . Peter Anvin" , , Subject: [PATCH v3 0/6] x86/mce: Handle error injection failures in mce-inject module Date: Thu, 4 Nov 2021 16:58:40 -0500 Message-ID: <20211104215846.254012-1-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 072a6a4f-f026-4085-3cbe-08d99fde50af X-MS-TrafficTypeDiagnostic: MW2PR12MB2539: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /xy+/t8aV5pbsPZJrozAGBTaTRk8e7zUtAqc+D7lQNH+v2I4PGPFA11VXldVAceBzGC6czH2asXznNGBGOC2+6D/24tnXnRjdwDV9AxakdRrzjD3qkHO8KDggZR6ItzJqfj6V+XObFBR1DeCsczitGMeJ/ztLqlmRQ8M1illxL/j2CtufQIBNpxEmalFdtNmnMH0RMwTpQSrIOHIDCPSZZGD2mCadpKs0Z/B2vO8evH2zfBOP7bVNT9TmUQPLVDmGhw0/ZmCGM9qCB8UQxrFVciqVfnU6049LmYP6l2lEm+9zoNi3o24vIpTmRLkUtMyDJp1PuDHUFqOvG9qn889JGIdljdWsclC2c4j2Ww/yxwFB/zbV+9jznvUyGJzHwnevYiYTIWvtOg+QjR7Lyd2/s4GApiaqOh5Z872RFFv5F463Fy+STFpCSbgbKNzQrIwUhJ5m60wIwtF52ZS7hpjNChmsqgVBhpJotYuMJ2aPrvBpcaB0GYEQCiKCdwMDvJWhKz+G31ssJiym+gqQeHV0+HPEdpeNc7hNbctRBz7oCuJ9j5eLwSRTf+/I+f2RMAJr7E4NGUpN3kbrjpC6SgKqQF6uRyrcVt9fyNfDTuI0b286BWTqTwwtyK5DTbztT44TINlh9vg2qL+7p2i86VVruVfJqGjQFYOhuqoBMFGWJORuEhJuu7xwWv43c33VxfCE3NnBRTcU5JEszMUToFFTC0mOlHucvf5+mJLUIoZKm4= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(7696005)(426003)(36860700001)(8676002)(6666004)(83380400001)(8936002)(5660300002)(70206006)(336012)(2906002)(110136005)(36756003)(70586007)(16526019)(86362001)(356005)(26005)(47076005)(82310400003)(4326008)(186003)(54906003)(508600001)(81166007)(316002)(2616005)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2021 21:59:03.3074 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 072a6a4f-f026-4085-3cbe-08d99fde50af X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2539 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series of patches handles the scenarios where error injection fails silently on mce-inject module. It also sets the valid bit in MCA_STATUS register unconditionally to correct Val=0 injection made by the user and finally returns error code to userspace on failures injecting the module. Error injection fails if the bank is unpopulated (MCA_IPID register reads zero) or if the platform enforces write ignored behavior on status registers. The first patch checks for an unpopulated bank by reading the value out from MCA_IPID register and the third patch checks for writes ignored from MCA_STATUS and MCA_DESTAT. The second patch sets valid bit before doing error injection. The fourth and fifth patch does some cleanup in prepare_msrs(). No functional changes in these two patches. The final patch returns error code to userspace from mce-inject module. Smita Koralahalli (6): x86/mce/inject: Check if a bank is unpopulated before error injection x86/mce/inject: Set the valid bit in MCA_STATUS before error injection x86/mce/inject: Check for writes ignored in status registers x86/mce/inject: Simplify evaluation of writes ignored in status registers x86/mce/inject: Restructure prepare_msrs() x86/mce/mce-inject: Return error code to userspace from mce-inject module arch/x86/kernel/cpu/mce/inject.c | 106 ++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 16 deletions(-) -- 2.17.1