From patchwork Wed Aug 30 18:49:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13370630 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 8DA2AC83F17 for ; Wed, 30 Aug 2023 18:50:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 85D6A440174; Wed, 30 Aug 2023 14:50:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 74DA3440179; Wed, 30 Aug 2023 14:50:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AF4C440170; Wed, 30 Aug 2023 14:50:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1D515440173 for ; Wed, 30 Aug 2023 14:50:37 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E70E81A01C1 for ; Wed, 30 Aug 2023 18:50:36 +0000 (UTC) X-FDA: 81181662072.01.DA12BA5 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf10.hostedemail.com (Postfix) with ESMTP id 7972FC001C for ; Wed, 30 Aug 2023 18:50:33 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=utW3nYS2; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=szWPjUYG; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf10.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693421433; 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:dkim-signature; bh=nJloHB0zDu8LwgV39mz1tQFxCkCRoHiIuVP6I6CUHrM=; b=0QLBmhF+ST5wwb8AsW2V/JQoDYcnuxcmDn7PNVfBxoZYRT4l2KkiyC4aNlPTPk/Xd+Xr6a 0qNRVBaMuX981x6RLTYR7ZmMu3A5C0/VM7dlGUK3KVH30D0wJPo6U3B8S5+0HS+mXFyvxw FRfbnpWrzRH88oBBz4Kl4VIy7+GJtnM= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=utW3nYS2; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=szWPjUYG; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf10.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1693421433; a=rsa-sha256; cv=pass; b=doc+0XiZfD3hHQOzBseSUd2gZYXwtZ0ycD9RMnmt81XJWeHiFlOhpEoCqxeFtpCnR2XYok 96bEhnPdnS70levWzCSZLcvWJU9o1pSmQuwUWkI5MbTtcGnYcy/qZlBvR+nbIF9VidaEWw uDUS7jsLm9i3EFn2H/jJTp0wx+l0MfU= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37UInrRw018041; Wed, 30 Aug 2023 18:50:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=nJloHB0zDu8LwgV39mz1tQFxCkCRoHiIuVP6I6CUHrM=; b=utW3nYS2w74/gf46FinDK3cutipHI2RgnpVqYOY+yr9oyWS5FMr4lLHsqCmAc/+jz2Pi 4Lk7psHGTVwrbJgKre76kWpUybe30K4hCZAxjMDp9lwozd9OOdpSYc/FhSLD5sIDqx0V 2Xebu6m255owgerAEkspCV2NO+V/r8Zoyb9YMqtbwYkZNZK1D4CDtru3+gi6yynVOC4F AGH742rkLmiSABi1k7fS2geLM3ThcxjvBj0ERZb5myB8NU900CtULRnJsJb3mmQCntAK xxTIzxSx56NB458CEqQDt2c3eVRqxSpaG0r79SOqlZG5+PRYLmeSRHPRUq+EZBnqoACX ew== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3sq9j4g75r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Aug 2023 18:50:17 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 37UI0boG000447; Wed, 30 Aug 2023 18:50:16 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3sr6gcyw3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Aug 2023 18:50:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RhFpn+d6a/o/HZX341TRrp8HGqXTvGbnMX7Tix2aLT49CleuzbDxvyptntIJo9bZJ/2lVAthMG0VZ30XWAeukOC2UeC6HzL5KmGjDlmPqhphuSgL/S+n3Y9BI/pfffrsaee8XN7f9gc6mo2hTLTIxDXreuFPm3pYNsCh5b/U4Z/4/3rJUS34CaFk+wc4f34etrPHQpLNNK+/gCa14aQ4lhp+aIO8+2F3yFIoGjDwz33FgcnMNgcpepJ5bUrGiyRUfYF9Of95rbujode8admDR3l4i2Blk1dVzuHVdq7V8stIN/FBY3mCfObWjgK8PdT96ucQyNeY2aGbRjlEjbxwWA== 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=nJloHB0zDu8LwgV39mz1tQFxCkCRoHiIuVP6I6CUHrM=; b=dvL1cBjpMoD/WdCK20r/ZBrBQXj200DfwuxgYXMBttrNeWbOLQ3liFDlsxTWe1Qv9DjLYytcC94WP7BiTtLVZOd6RZsdjC0OGeWw9YFbDU+KXZ0SP1f+givpeUFmLN0/o5MlLG6gZoAX/ntXyrqi5SccPe/LCKm0wwOScQ/kkF5nR0USnO4IKvHlUQ0+Xmy/adW3fHESlEmpUGNjgl2aQmJFBQcOqw+0gS+r9CMAUwWyG8XXitZi9e3RPyJ8KscTItQ+2+Yh0AOqGfe1gXC1NZM6UkitJDQE0IG0N2Dl1AH65dsqucGygPTVA4sNvP/me/JRekT3IwEHDb+N7QoTrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nJloHB0zDu8LwgV39mz1tQFxCkCRoHiIuVP6I6CUHrM=; b=szWPjUYGjkD7KLZalDmBB/CiCIeU6aR5dw+f3SGPm4c0CWssdaDcM9h7Gwy44jrDbr5qgt9+7LmqOMH+KXplbguy+AKta2bEM7VzEvyREHYTAXp78qrm1XmehHSOJ9lQE5BfKkYsNQSUZA/EkSuGJhgp8WuiTmSOoFbIdThInjo= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CYXPR10MB7897.namprd10.prod.outlook.com (2603:10b6:930:da::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Wed, 30 Aug 2023 18:50:13 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::238e:5e86:cbd0:7415]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::238e:5e86:cbd0:7415%4]) with mapi id 15.20.6699.035; Wed, 30 Aug 2023 18:50:13 +0000 From: Ankur Arora To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Cc: akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, peterz@infradead.org, rostedt@goodmis.org, tglx@linutronix.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, Ankur Arora Subject: [PATCH v2 4/9] x86/clear_page: extend clear_page*() for multi-page clearing Date: Wed, 30 Aug 2023 11:49:53 -0700 Message-Id: <20230830184958.2333078-5-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230830184958.2333078-1-ankur.a.arora@oracle.com> References: <20230830184958.2333078-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0025.namprd03.prod.outlook.com (2603:10b6:303:8f::30) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CYXPR10MB7897:EE_ X-MS-Office365-Filtering-Correlation-Id: f0d48c7a-c6ca-4080-3991-08dba989f190 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tWHw1Bzleq3VLt57kDBz6HOlx1Yj+hbmhix/327oZvg6ojP4A1BjeS90W+0IU+SmBdf4fRl29Who9GnxkL0oQDPEDSbAaOtvrjO6eY3195797WawwAk35zbAPVGCGtRJIZmbcqyPYtI0xpJwgVfISDF3oefcOE+MmgJmxJH9y7o2lGKfvI9i9oOCCBz83Gr/AgWftGolZQDv7ls9FhWmX74FFRiOnQ7f3cZhY5GR9q0+kjgkQ9xrmE90oCcSwAd+XjmJIe4ZRlaXHTBtbIbT8zriqgCKGkCDL4R+KxKThSXrxT7Q+qQrP2I8fEl/dt7kcvufTPIOPse+tpztACqvlvjJIcetj7T3xTwNMfnjbDLH2pyn3tbOZ1EAJByRlMClDFHSGNmdO+zpK/xXRmoBAAAjcRjI/kxKrUgxLhJ6YxWKo5iZCch/abKPm7YxQ1wew9uEmYyAmKB7bpErdTu19+jgppPXlFTHTiyf/BfvTdxNHjLLG0yq239CLfq6QtjTlT91hIbjZYQq8CKmOd3TGYhg7YocNbzNN2mvdmuQ/Lu6trhxWjlx8+cxQOh+FRM6 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(376002)(396003)(136003)(366004)(451199024)(186009)(1800799009)(478600001)(38100700002)(26005)(1076003)(36756003)(66946007)(41300700001)(6512007)(83380400001)(2616005)(107886003)(66476007)(66556008)(6486002)(6506007)(316002)(6666004)(7416002)(5660300002)(4326008)(8676002)(103116003)(8936002)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MNGn0hz5IREwEpfgI5QtLSKwZJgZ7WZbc6CtXAeKh9zn7jqpoLbCzXvxJIQuhEIGnSgKGNuK+fzoSUWVSipnV2OTX6GDVSdYbPjKmpJp/E0g+KJAgb/8rOxhNq5uxQehaGqDkmzPFy8y7/louzlS0NUFensDAE86xU1bmnhn1Qq7C4SxBfZOCuuofGmYzz35GQlYTrV101KvR/DN19o/CbHLroAeu5TDh2z+XmtbQNxbPpxL5o4cAPqZz15BRxEK7dnkbfk2UgrIJ3HxzkvbuGWPOOwbeydJtqXNBxFQ+orNOMISW9fv5X81lFsGX5BObpmjbHU3BNtAL8VFTCCXuMGwVbzQFH7rKroKSPtgMICJgI+2i3hnRPK+1ide2ChCorb5eY/+W/HaoOV6Q3jeflmtw++W9CBKyEKmNY4FXLwCeKSvHmi9VQ+/32eofGYGeZtjYMgKkIug0kADbYpEPQUUutKwZ2zGLkUvWL7AThKxV8vtTfhIr6GEXI1oztUkQBoGJCKmP1FFmtOwkx5AGLukbS1JM5bCe4Z62qcAhyfwAyWo76abt1zqp7fL0L2eCVvZj0LUBX6sajKL+XFEHt/B7zkOxzTA9MP6tN4/ycumffGpTsr1jg/GrZUARtLCMDOImqBuLVYOUIm2RnsgHnN76OmcYasda8XICYbiXdj/n0oNbIJwTxps2wmMRWbc/8WFBwgcc5DzwTGPNUygLYfi8ssSWp6canJgNGMK35Tkclf2NMevWgPnBW9cuXCqOjNpjF9/7/I+WmtaQLhkrMF5bQTC2XMJtxZHH23eW2cdsgUkwuB6RGunWg0v5sryb1rIabgQA1ggI19bBPYqbFQ8GXMg9WD4T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TG0c0MLsh1S8T9Y4XOi/sezU/loHkEWNfthcd2zao4SLcekzXxJqlmVuRBVQVBoNgMGFa2FsDI725WrNUE40C21uc4AAlUzzkEFReQE8rTvl6DjgHm7rYxZ3AdLfVQxP5iZGMhdoN+fVJMmHglXmSokOJyEFGgcwyaFh1tyfEZ6CezIXSk+8qdDrEtHaDIKnDWW67TO/feAbbuJdconfA86Hrklzc5t9vhenox+zDhUzdo0qLlF7AW6JIUwrGAetxhuxVFn5BmYsGJpXrzhb1QVQ/n+DxepRgB5jWZwuvbnQ7SDSulvfBNcfLkjr9rHmh6SxojM4oTpql6bQ/VmFO2Q63ezG3GfQx3pIUQviZ9x1UNIrGOYz9Yh9vQTr5FCcEQEpcIudTJdsQWyDyW7r8cTAhjVsd0X72nAgsJUlLlYy6/sxUNQktNuNJbXwqtWJ/sbWLqL0Q/+zv1ve7R7P3QZ46vAgTRccZ75CjzMd6OXrxayp8PD455xWcvN3kGIqTsKidlz2MA85I5yAEY/eslCFA3Mi8BYfif3IaI61Yp0zyuwR+NbfhG7dI96X5iTRRsdt9Az/MAdp7HfwzMU/PdgpR8WeLKeJK9k2uA1WZoKsTO5TtprYgcD9mOX9rIjz93t+5LhuPRXcxze8UhyC5fA9FGk2WxfAaAYaLiEKLXX6xkXrQJUzNheXA6dqwb00PZtQrM/x7ojhVoDb5DtNWJ0T2QscCncXELyhhdw1vJnPGR+x69Gzg8oljzp0TUml2axrtZqyc1SXwC3GJ4CGtdGRx7tT8XoxCAk7V8uB8L8/VZHt7Ynocji4X0dkyRTqLv7hR/8SZSrDqNK4ir7PhquK9KneVSLyBHSz1th5tpQaFhFKF60PHpqo7QrsKc5z/mFOA9KagO50rV1EScxcWLCKtVEM0b7UKqg1r1jGREf2mo7BitqXzRqt0tYhkhLbkQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0d48c7a-c6ca-4080-3991-08dba989f190 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 18:50:13.4385 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XCjLtkeS/3muNw6Sgm8Uy4PcauxCtioNilkUhMP9Ko0i24T1BXzGpDp5nxREY8oamPHbjZ5QZBLuvuMBZYAJNjJSirzMupFXjhcaC4YrHMI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR10MB7897 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-30_15,2023-08-29_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308300170 X-Proofpoint-GUID: CPje_lIh5Rw1YeWA3jtGvcbAznD8HBQm X-Proofpoint-ORIG-GUID: CPje_lIh5Rw1YeWA3jtGvcbAznD8HBQm X-Rspamd-Queue-Id: 7972FC001C X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: c48ua7ccepciiepa6saqrmoyqeodx1uu X-HE-Tag: 1693421433-950059 X-HE-Meta: U2FsdGVkX1+11KhsuXwPHu/AyijZJGjln8Yy9q7eSU1JSYkulJmmKpK5/GGdONPEmWSu9IATr6SVohvdY0QpRShTga53S7VRBT31WPsiMkGdMj8sKrqjU0RUrOuzFbjHMI3Ouh9fBejr8ibYhdV1k9lNTOUaxaaeFEqUlK/xRyvKqptrnKl8uvk5XDNHYCF/L41cKnN0JIx+s/VMawrh1jgQPPwbAan1jg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EJ+khHa86f4+8bV/pBMjoN91w+dMvj89k6+bFBBuFRqrw1ISz575cTV+vNAJo8oWmjXejrHI8qgrUPrbMbLM+/mlryJIqD9StCQxzDoEY3TTGnR+JezVjTNuvT5CxM6JOX3tuREBFheFj+ggdHHnpocK8Az9Ac+G4Z2J1SEP91TT2uOESEP2P94hW2CIYa7hSyCbNFv5ci3f7t3cLLr1Yk9eDBRf+0V/21h5mtrBDV6XemcY2idIU= 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: clear_page*() variants now take a page-aligned length parameter and clear the whole region. Rename to clear_pages*(). Signed-off-by: Ankur Arora --- arch/x86/include/asm/page_64.h | 20 +++++++------ arch/x86/lib/clear_page_64.S | 52 +++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h index cc6b8e087192..56f9adf0e892 100644 --- a/arch/x86/include/asm/page_64.h +++ b/arch/x86/include/asm/page_64.h @@ -39,22 +39,24 @@ extern unsigned long __phys_addr_symbol(unsigned long); #define __phys_reloc_hide(x) (x) -void clear_page_orig(void *page); -void clear_page_rep(void *page); -void clear_page_erms(void *page); +void clear_pages_orig(void *page, unsigned int length); +void clear_pages_rep(void *page, unsigned int length); +void clear_pages_erms(void *page, unsigned int length); static inline void clear_page(void *page) { + unsigned int length = PAGE_SIZE; /* - * Clean up KMSAN metadata for the page being cleared. The assembly call + * Clean up KMSAN metadata for the pages being cleared. The assembly call * below clobbers @page, so we perform unpoisoning before it. */ - kmsan_unpoison_memory(page, PAGE_SIZE); - alternative_call_2(clear_page_orig, - clear_page_rep, X86_FEATURE_REP_GOOD, - clear_page_erms, X86_FEATURE_ERMS, + kmsan_unpoison_memory(page, length); + + alternative_call_2(clear_pages_orig, + clear_pages_rep, X86_FEATURE_REP_GOOD, + clear_pages_erms, X86_FEATURE_ERMS, "=D" (page), - "0" (page) + "0" (page), "S" (length) : "cc", "memory", "rax", "rcx"); } diff --git a/arch/x86/lib/clear_page_64.S b/arch/x86/lib/clear_page_64.S index f74a3e704a1c..58cb1d6355a7 100644 --- a/arch/x86/lib/clear_page_64.S +++ b/arch/x86/lib/clear_page_64.S @@ -11,20 +11,35 @@ */ /* - * Zero a page. - * %rdi - page + * Zero kernel page aligned region. + * + * Input: + * %rdi - destination + * %esi - length + * + * Clobbers: %rax, %rcx */ -SYM_FUNC_START(clear_page_rep) - movl $4096/8,%ecx +SYM_FUNC_START(clear_pages_rep) + movl %esi, %ecx xorl %eax,%eax + shrl $3,%ecx rep stosq RET -SYM_FUNC_END(clear_page_rep) -EXPORT_SYMBOL_GPL(clear_page_rep) +SYM_FUNC_END(clear_pages_rep) +EXPORT_SYMBOL_GPL(clear_pages_rep) -SYM_FUNC_START(clear_page_orig) +/* + * Original page zeroing loop. + * Input: + * %rdi - destination + * %esi - length + * + * Clobbers: %rax, %rcx, %rflags + */ +SYM_FUNC_START(clear_pages_orig) + movl %esi, %ecx xorl %eax,%eax - movl $4096/64,%ecx + shrl $6,%ecx .p2align 4 .Lloop: decl %ecx @@ -41,16 +56,25 @@ SYM_FUNC_START(clear_page_orig) jnz .Lloop nop RET -SYM_FUNC_END(clear_page_orig) -EXPORT_SYMBOL_GPL(clear_page_orig) +SYM_FUNC_END(clear_pages_orig) +EXPORT_SYMBOL_GPL(clear_pages_orig) -SYM_FUNC_START(clear_page_erms) - movl $4096,%ecx +/* + * Zero kernel page aligned region. + * + * Input: + * %rdi - destination + * %esi - length + * + * Clobbers: %rax, %rcx + */ +SYM_FUNC_START(clear_pages_erms) + movl %esi, %ecx xorl %eax,%eax rep stosb RET -SYM_FUNC_END(clear_page_erms) -EXPORT_SYMBOL_GPL(clear_page_erms) +SYM_FUNC_END(clear_pages_erms) +EXPORT_SYMBOL_GPL(clear_pages_erms) /* * Default clear user-space.