From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (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 7C0B54A21; Fri, 7 Mar 2025 05:47:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741326472; cv=none; b=JAxPbmxo8L/4OHYBNb5uQDxPWjbf3kq/XGx8i7O1dACJRehSBSMs4EAy2+oAUMdsG56KaPA+GsaiRFPeiNr8Z1zElMlh0xmJI79BUlawpqkDEytzT8C7pBI04kMhe+1KCOUE9UIf4L0FREhelLaqYvZzPD5Cv0zirVuL/+k3Od0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741326472; c=relaxed/simple; bh=cSgU8cHvWbc37Lebk+pboqkr3rsJ4iGhMVkicICKTH8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bIK0iipSVxgxCapfybU7NbkJTRykqHnnyvY2Ejq7qiDKZxIF28YNztVD97gNzs0yEiXFIw0hFaKrdjeBJVqeSn7JMBTVFZOpb2TclU/VZN3QMCEuHx+x+UAtrD5ls+g568wm1pcKF6voHBvnAMNsFbfwsBjv1SX7y+FtCun8tWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=fV3dDslj; arc=none smtp.client-ip=115.124.30.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="fV3dDslj" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1741326462; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=i8hBVXXenNjxx3BHyz1WHioxLNd57++2diGf/KDJPqY=; b=fV3dDsljtwze2lM5gpPGfuuXq2fZEPi81Zwg8VOSwFAGBkz6H7jo2X3fawTTfP/kG0sNKhIxwYIqnmmRkFUgBzLGrpfNiK8hLI66Rcj1J8fNdhRa3KOnKLUL6YDMQkg1IhoyP+8aFx8oCgpriyUkJeFEqAXWS8BkGAtGeho6d+E= Received: from 30.246.161.128(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0WQqyKli_1741326459 cluster:ay36) by smtp.aliyun-inc.com; Fri, 07 Mar 2025 13:47:40 +0800 Message-ID: Date: Fri, 7 Mar 2025 13:47:38 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/3] x86/mce: Use is_copy_from_user() to determine copy-from-user context To: "Luck, Tony" , "bp@alien8.de" , "peterz@infradead.org" , "catalin.marinas@arm.com" , "yazen.ghannam@amd.com" , "akpm@linux-foundation.org" , "linmiaohe@huawei.com" , "nao.horiguchi@gmail.com" Cc: "tglx@linutronix.de" , "mingo@redhat.com" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "jpoimboe@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "baolin.wang@linux.alibaba.com" , "tianruidong@linux.alibaba.com" References: <20250306021031.5538-1-xueshuai@linux.alibaba.com> <20250306021031.5538-2-xueshuai@linux.alibaba.com> From: Shuai Xue In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2025/3/7 02:15, Luck, Tony 写道: >> diff --git a/arch/x86/kernel/cpu/mce/severity.c b/arch/x86/kernel/cpu/mce/severity.c >> index dac4d64dfb2a..cb021058165f 100644 >> --- a/arch/x86/kernel/cpu/mce/severity.c >> +++ b/arch/x86/kernel/cpu/mce/severity.c >> @@ -300,13 +300,12 @@ static noinstr int error_context(struct mce *m, struct pt_regs *regs) >> copy_user = is_copy_from_user(regs); >> instrumentation_end(); >> >> - switch (fixup_type) { >> - case EX_TYPE_UACCESS: >> - if (!copy_user) >> - return IN_KERNEL; >> - m->kflags |= MCE_IN_KERNEL_COPYIN; >> - fallthrough; >> + if (copy_user) { >> + m->kflags |= MCE_IN_KERNEL_COPYIN | MCE_IN_KERNEL_COPYIN; > > You have " MCE_IN_KERNEL_COPYIN" twice here. Sorry for this noise, please ignore this version, I resend a new ready version, please see: https://lore.kernel.org/linux-mm/20250307054404.73877-1-xueshuai@linux.alibaba.com/ Thanks Shuai