From patchwork Sun Feb 4 08:26:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tong Tiangen X-Patchwork-Id: 13544559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EB5AC48286 for ; Sun, 4 Feb 2024 08:26:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98D306B0080; Sun, 4 Feb 2024 03:26:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 940616B0083; Sun, 4 Feb 2024 03:26:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 803116B0081; Sun, 4 Feb 2024 03:26:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7315B6B007E for ; Sun, 4 Feb 2024 03:26:43 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D170D140367 for ; Sun, 4 Feb 2024 08:26:41 +0000 (UTC) X-FDA: 81753440202.12.F45BD2C Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf10.hostedemail.com (Postfix) with ESMTP id 7A314C0010 for ; Sun, 4 Feb 2024 08:26:37 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf10.hostedemail.com: domain of tongtiangen@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=tongtiangen@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707035199; h=from:from:sender: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+InWOawgvS4dFLP9HR/AQagIfV/sCSfeUZLqWbEDPeo=; b=h8TD/vKf+d1mUHxFzZ/1bC7G4pbhBAk020IzCV6d7PqlKTKi1ebXyZbml0zH3211Ners9g x776NPuqbD0F7BXmXNLRyMYRnmmcMbsqGE632MSJaTrbjro/hrPSukxtlL6++hsyWDSUjO gjNfofn0IMirfCSFtaeW+yrDvuxvksk= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf10.hostedemail.com: domain of tongtiangen@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=tongtiangen@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707035199; a=rsa-sha256; cv=none; b=5oh0Q0ahHoycKoWQ9rq2ulxteq2BugfU+5W31rePxeG+CbS7aiStg5hvmBIOg2kPfLLBHv YYMT2rEhhqYG6HW8gU2c2etP4PM6EZdN65FHCdn/fyNYlCuzp1SLNYLIgcG/23DJPt/U/H YgpCYF29ivgpL0A+K+IwY7t8XGbsxZA= Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TSMyd6KVnz1xmyC; Sun, 4 Feb 2024 16:25:29 +0800 (CST) Received: from kwepemm600017.china.huawei.com (unknown [7.193.23.234]) by mail.maildlp.com (Postfix) with ESMTPS id 0FA311A016C; Sun, 4 Feb 2024 16:26:34 +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:32 +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 1/3] x86/mce: remove redundant fixup type EX_TYPE_COPY Date: Sun, 4 Feb 2024 16:26:25 +0800 Message-ID: <20240204082627.3892816-2-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> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600017.china.huawei.com (7.193.23.234) X-Rspamd-Queue-Id: 7A314C0010 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: m3iuix6ktp6kyziddanjxkctxtn4yqbk X-HE-Tag: 1707035197-204603 X-HE-Meta: U2FsdGVkX18w8zFmQxJ01ACM56oWgz7ddiQXVCLh+wgdNOKlEXzl6CPwf9wgpRz7JAnm/wg0hzV19ivdG3ChWNVe9e8Jl/CRYo/5524/EfBck46b3jvK7OaO+kCEtWkl9+cI4g/wXCRC4WovhWafH37Amfx2SgskGP0Vv+YFRsyOIoTsm0bR8OtG/JDitROVfekxs/ChvRgLwsYFGRY+HMaFW6sHSsfFpnpbF+9tG/yZIwgsWgwifjWZGiO1RHjXkopQOXGXu12iMhV1J+rAq5ofoKezUA8TJVUmdq3XA/ORA+WfOdBHxd4F9H/I9S9T9E1t3+xgCYigU9YLzf1284ZwkcF0ZYJxklXAsS0tyzfQ+elhLxyk2QZ7tF9Agy2FqzUwlpFVmythBGjLxaTaQqVREZzScslboYUf0Nhc4sN1ODmlhwaNJPIwFUU27715GkUD7dYucL9EjZBbDnFJNMwHLISPX3JpQ5l/bhfzv1ZkUqBlPHHHqzmQSoAfAX+hOedXPSAyub0zZdrNv0SaN81zT1iCyGvnp+jYE792py/SsCR9L9OslkGNGd3kJdZOE7McuOWaFTo/pKrL7qSpSrbhSOEk8AGksNBX9bSJh8H72v/H1PKT7lvcaGt8LdxL+JTYYPIFb/QjGXqL+5wL8tlhLiDr9LF0p2YsssGPg5nFFbja4QIMf8Yon0EDJF4BSvJot2y/zBsVEzUNBmQgpiptD68ZIoIUfo8r5wLs5ItDLcBn5UwMWuoy+ju/rHD/rfPjDP3hnVquii932FHZwIEL5yhgmrMVYcKrQCmmuARe7WFKYhJEhC9Gj2YulNz7VScPliaOFTx1mnNabUBvGQHi6WPX5YlXvAwHYw9axvukOG16Yn1fWdHZS7EeEP8S04SudJSqg6b37CCTah5d17fz0zUuJHhGGcTM0aQAnRF4QpnT6/Q18ROt37jgxxb5B2Gje4EiGI3JDj4LHDo KuGEt1Yk mWG+msrDbS7vyOi2IyBW/J6+ayVbAmKyoQ4TW2xqj4WXkIpICvBqYJhmpneRxEDOcvruCCZJBWTfFqHAUOgY6fOfCSo7ifk5397v9tGVV7uKsEVNxumDCDma08KtWWDSGD0JYaVEEggsLFnDhZa0x7aGaQMGP1PuBmKpHD07iOIrFg2MXDHVO+PuplXDTjYxivvVd X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Since commit 034ff37d3407 ("x86: rewrite '__copy_user_nocache' function") rewrited __copy_user_nocache() uses EX_TYPE_UACCESS instead of EX_TYPE_COPY, there is no user for EX_TYPE_COPY, so remove it. Signed-off-by: Tong Tiangen --- arch/x86/include/asm/asm.h | 3 --- arch/x86/include/asm/extable_fixup_types.h | 2 +- arch/x86/kernel/cpu/mce/severity.c | 1 - arch/x86/mm/extable.c | 9 --------- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index fbcfec4dc4cc..692409ea0c37 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -215,9 +215,6 @@ register unsigned long current_stack_pointer asm(_ASM_SP); #define _ASM_EXTABLE_UA(from, to) \ _ASM_EXTABLE_TYPE(from, to, EX_TYPE_UACCESS) -#define _ASM_EXTABLE_CPY(from, to) \ - _ASM_EXTABLE_TYPE(from, to, EX_TYPE_COPY) - #define _ASM_EXTABLE_FAULT(from, to) \ _ASM_EXTABLE_TYPE(from, to, EX_TYPE_FAULT) diff --git a/arch/x86/include/asm/extable_fixup_types.h b/arch/x86/include/asm/extable_fixup_types.h index 7acf0383be80..906b0d5541e8 100644 --- a/arch/x86/include/asm/extable_fixup_types.h +++ b/arch/x86/include/asm/extable_fixup_types.h @@ -36,7 +36,7 @@ #define EX_TYPE_DEFAULT 1 #define EX_TYPE_FAULT 2 #define EX_TYPE_UACCESS 3 -#define EX_TYPE_COPY 4 +/* unused, was: #define EX_TYPE_COPY 4 */ #define EX_TYPE_CLEAR_FS 5 #define EX_TYPE_FPU_RESTORE 6 #define EX_TYPE_BPF 7 diff --git a/arch/x86/kernel/cpu/mce/severity.c b/arch/x86/kernel/cpu/mce/severity.c index c4477162c07d..bca780fa5e57 100644 --- a/arch/x86/kernel/cpu/mce/severity.c +++ b/arch/x86/kernel/cpu/mce/severity.c @@ -290,7 +290,6 @@ static noinstr int error_context(struct mce *m, struct pt_regs *regs) switch (fixup_type) { case EX_TYPE_UACCESS: - case EX_TYPE_COPY: if (!copy_user) return IN_KERNEL; m->kflags |= MCE_IN_KERNEL_COPYIN; diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c index b522933bfa56..51986e8a9d35 100644 --- a/arch/x86/mm/extable.c +++ b/arch/x86/mm/extable.c @@ -164,13 +164,6 @@ static bool ex_handler_uaccess(const struct exception_table_entry *fixup, return ex_handler_default(fixup, regs); } -static bool ex_handler_copy(const struct exception_table_entry *fixup, - struct pt_regs *regs, int trapnr) -{ - WARN_ONCE(trapnr == X86_TRAP_GP, "General protection fault in user access. Non-canonical address?"); - return ex_handler_fault(fixup, regs, trapnr); -} - static bool ex_handler_msr(const struct exception_table_entry *fixup, struct pt_regs *regs, bool wrmsr, bool safe, int reg) { @@ -341,8 +334,6 @@ int fixup_exception(struct pt_regs *regs, int trapnr, unsigned long error_code, return ex_handler_fault(e, regs, trapnr); case EX_TYPE_UACCESS: return ex_handler_uaccess(e, regs, trapnr, fault_addr); - case EX_TYPE_COPY: - return ex_handler_copy(e, regs, trapnr); case EX_TYPE_CLEAR_FS: return ex_handler_clear_fs(e, regs); case EX_TYPE_FPU_RESTORE: