Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1775836rdb; Sun, 4 Feb 2024 00:27:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeG7dWXaFJdPSd/bY6k5HGgBK5IDtylAVKi/VB+Gd+TqSfj3JhJ6YMWaT/vztU6w8cCAf9 X-Received: by 2002:a17:906:2455:b0:a35:9ebd:f6b with SMTP id a21-20020a170906245500b00a359ebd0f6bmr6505543ejb.58.1707035225731; Sun, 04 Feb 2024 00:27:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707035225; cv=pass; d=google.com; s=arc-20160816; b=leFz6oI9cGskfmR3Ro6cNToZwCNSgkw5GHJVCZbSah9kIkZpeRW9OkJyh1OGM66Kfn HIZMgLIbJ3gpKH2fcACe+h8jdJsoh6VZKpv6La/7kPO0isbf7xJZmSx/+2yt4tfjFSpL QmbJtsAGmIux6ohpBAnCI5EzlOmOJoEaAvqRNvRt4Iz1Co31oASzHI1Pwy9TgxPakBwy eHs9GsJVPp+LKwjvEPNU0fyFatHLawamG8SWzX4s7BUmijcpLF5tsoYx22YZ1mB0xvUL tGr0C/tbotuQAsUmdHfF7chVzYGLEDviWy0VfrkRl9APUuL4qGYd4ivQEKPDSy4pc6Ak i+uQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=JIhTmCKp1JPvrDf4Nft0zYZgK3+6jgIK0+TowYYY4xU=; fh=YLgi3vdBpgeVVR0moTvjJjxRrgd4oBm3R9rbxGVnSsc=; b=U17xv13z9jFhSWN0dTNOx8N97uIfnbl6Db6NPOdSd0kQBzAxygObNcZuRu1YH0ikaI hktNXt8c/8aLsfOgWQDs9HrOZ1Sxk9iYYAcwEGHYxWhzdFjx986YKeWBGyT6eNXOEKD0 FkYcoqaUE33KLI2ZRjhTAEWT1StygI2WGzsPBBUMhDFfH2Ept1dzV7oQOsRzB9HG5nWB u8OTHlI47kVAjG1/CWiexPnpKyk6WQXp93W0QfXqFzlIk1LJUIgsrY99hFwjOCUg6QBo 6m41CxQM8huN/GXWmQpjk+R+8SdpnBg1RYyLlxdcNgQxuQQQEMxlxbOHnkyHm87BgELp SYjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-51522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com X-Forwarded-Encrypted: i=1; AJvYcCVYpdo2Pn+1mtj2/HtsNYPd/IgpZ01CdyP5BjtbN6tvgpACihfWRbT1j66yBAf3wO+o0N25+fKGj0q9e0xgK7qKBDkX67WYOEns89Wa6g== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id rv23-20020a17090710d700b00a367bddd8f0si2742553ejb.957.2024.02.04.00.27.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 00:27:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-51522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7CBA61F23D5D for ; Sun, 4 Feb 2024 08:27:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A9AD12E63; Sun, 4 Feb 2024 08:26:41 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B068A12B69; Sun, 4 Feb 2024 08:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707035200; cv=none; b=skJEYcVmLABtAd2JoZ47L+yNweRmJ9/hMzWjlIXJ1O7RmA2gIhVPeYnJidDcHWbyMV8Kyx5dBup/qRyqZaBnaWI+hRTGIZ2m7Kh1p/nzOfx6laAE1LTHgqSBBXN27zBmOT1lgrBipPBeBuilhCvNUCnukIx0S+JHDkfRCpOpkds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707035200; c=relaxed/simple; bh=p/f7riMkZxcC6ClGf9vpDtgKU0i1cmddSajVqTGwbYI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a6MclFVXZl6Y48bPFk/rQIs8x5X2GypSjbIGaW4POs4733tl6tK3JxG+Z1dFMarNG/TEl1el/GrhXYmk6xjjDtv0WGL7lNTHRJbaUrpXURK9Qi3czlVHs33QIIvvUXiJzkI/3umwE+dPTPoLVQFPuHrPKvg+xPvlRCWbSavJ3Xg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TSMyh23QKz1xnCm; Sun, 4 Feb 2024 16:25:32 +0800 (CST) Received: from kwepemm600017.china.huawei.com (unknown [7.193.23.234]) by mail.maildlp.com (Postfix) with ESMTPS id 71B6814013B; Sun, 4 Feb 2024 16:26:36 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 4 Feb 2024 16:26:35 +0800 From: Tong Tiangen To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , , Dave Hansen , , "H. Peter Anvin" , Tony Luck , Andy Lutomirski , Peter Zijlstra , Andrew Morton , Naoya Horiguchi CC: , , , Tong Tiangen , Guohanjun Subject: [PATCH -next v5 3/3] x86/mce: rename MCE_IN_KERNEL_COPYIN to MCE_IN_KERNEL_COPY_MC Date: Sun, 4 Feb 2024 16:26:27 +0800 Message-ID: <20240204082627.3892816-4-tongtiangen@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240204082627.3892816-1-tongtiangen@huawei.com> References: <20240204082627.3892816-1-tongtiangen@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600017.china.huawei.com (7.193.23.234) In the x86 mce processing, error_context() use MCE_IN_KERNEL_COPYIN for user-to-kernel copy(EX_TYPE_UACCESS) and kernel-to-kernel copy (EX_TYPE_DEFAULT_MCE_SAFE). "COPYIN" only stands for user-to-kernel copy and can't stands for kernel-to-kernel copy, this can cause some misunderstandings. So rename MCE_IN_KERNEL_COPYIN to MCE_IN_KERNEL_COPY_MC. Signed-off-by: Tong Tiangen --- arch/x86/include/asm/mce.h | 8 ++++---- arch/x86/kernel/cpu/mce/core.c | 2 +- arch/x86/kernel/cpu/mce/severity.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index de3118305838..cb628ab2f32f 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -151,11 +151,11 @@ /* * Indicates an MCE that happened in kernel space while copying data - * from user. In this case fixup_exception() gets the kernel to the - * error exit for the copy function. Machine check handler can then - * treat it like a fault taken in user mode. + * from user or kernel. In this case fixup_exception() gets the kernel + * to the error exit for the copy function. Machine check handler can + * then treat it like a fault taken in user or kernel mode. */ -#define MCE_IN_KERNEL_COPYIN BIT_ULL(7) +#define MCE_IN_KERNEL_COPY_MC BIT_ULL(7) /* * This structure contains all data related to the MCE log. Also diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 04acdc3534c8..644748a5d98e 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1608,7 +1608,7 @@ noinstr void do_machine_check(struct pt_regs *regs) mce_panic("Failed kernel mode recovery", &m, msg); } - if (m.kflags & MCE_IN_KERNEL_COPYIN) + if (m.kflags & MCE_IN_KERNEL_COPY_MC) queue_task_work(&m, msg, kill_me_never); } diff --git a/arch/x86/kernel/cpu/mce/severity.c b/arch/x86/kernel/cpu/mce/severity.c index b2cce1b6c96d..b4b1d028cbb3 100644 --- a/arch/x86/kernel/cpu/mce/severity.c +++ b/arch/x86/kernel/cpu/mce/severity.c @@ -294,7 +294,7 @@ static noinstr int error_context(struct mce *m, struct pt_regs *regs) return IN_KERNEL; fallthrough; case EX_TYPE_DEFAULT_MCE_SAFE: - m->kflags |= MCE_IN_KERNEL_COPYIN; + m->kflags |= MCE_IN_KERNEL_COPY_MC; fallthrough; case EX_TYPE_FAULT_MCE_SAFE: m->kflags |= MCE_IN_KERNEL_RECOV; -- 2.25.1