From patchwork Mon Aug 7 08:23:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Jhong X-Patchwork-Id: 13221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1310590vqr; Mon, 7 Aug 2023 01:49:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4Y7w6ayL4KWbv1lHErAyoVaWgDza5IftnS9Y8dGiXtb/lPz7YdrlxLTAAOkmTpNRUj5Oo X-Received: by 2002:a17:902:7446:b0:1b8:76ce:9dab with SMTP id e6-20020a170902744600b001b876ce9dabmr8151266plt.41.1691398181119; Mon, 07 Aug 2023 01:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691398181; cv=none; d=google.com; s=arc-20160816; b=n1lHqiOiNeUxdZDvukysZO+rmqc6ED2bj9ngdG9OanzTWvOY9O9pMC0M1oEnd9c63e HJM1EKwOnhSvvslTKP+VJ//aE42Z6pYEwdEvRBd6gYOZxaJUnGMn4rqQzlJusFLDGz6/ Mmq0oNqMSb5zJbh6jdfjWo32DhAOh27zKaFFdnt4Vr8YH/Lx6xkm5x0bQSF/bJR+HRaV UQb0dPTfOdEDoTVqi5L3iCVam025TtfByrFNXAngPcxuNX5Y9JZWpV0TAaWCS8uXKFUr aSbmoVX0ivt6NkPcfm5NfU+5++pzx/ofYuNijAd+XgDBDAJxyd82KnGT+e5nT7VMs62z 8XVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3D9f45pFFUiIUHkvI7K+6SvpFXiBgq806a3dCEKRlDc=; fh=ZYlRn2g767F43XtOdyo3SRNTefo0p1j7iXRdr3U7KxE=; b=t9oozUSsALyIzW/vT0TZT6jCd4I3wchQXoznUEvF/0VghbIH5o+gKalVMTpcmqV2eX ea4Kgk9/wusL1W5Xtnid9vY7G6R7FSVS5J9EsQfigmEtb1ITQ1IwA9wUgB+fFTPjic8f lwXdzcN0Uj+yoBV5aR/Qk+k4ZL/LiL8Tjohxfvz6jUAEmsEDjZNW7jgeSPImzwt+L0Mo PTMtxpD+89UCAVhHgVW2yJYmKtJKGHRY/wa0uGv8QA9wf7uXO+pUTppw+3d6nnoaHMff v7RVF/wVv9SpNiGMyI2dIuCJhSm70Lrwb/3HrC/xuWXzIByYTHni9NusGHT8VLNOilg3 bXSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ja4-20020a170902efc400b001bbd586d29esi5334179plb.34.2023.08.07.01.49.26; Mon, 07 Aug 2023 01:49:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230472AbjHGIXY (ORCPT + 99 others); Mon, 7 Aug 2023 04:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjHGIXW (ORCPT ); Mon, 7 Aug 2023 04:23:22 -0400 Received: from Atcsqr.andestech.com (60-248-80-70.hinet-ip.hinet.net [60.248.80.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C64C10EF for ; Mon, 7 Aug 2023 01:23:18 -0700 (PDT) Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 3778N83c098807; Mon, 7 Aug 2023 16:23:08 +0800 (+08) (envelope-from dylan@andestech.com) Received: from atctrx.andestech.com (10.0.15.173) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Mon, 7 Aug 2023 16:23:07 +0800 From: Dylan Jhong To: , , , , , , , , , , , , , CC: , , , Dylan Jhong Subject: [PATCH 0/1] Enhanced TLB flushing for vmap/vmalloc() Date: Mon, 7 Aug 2023 16:23:04 +0800 Message-ID: <20230807082305.198784-1-dylan@andestech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.0.15.173] X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 3778N83c098807 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PDS_RDNS_DYNAMIC_FP, RCVD_IN_DNSWL_BLOCKED,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773559539205017900 X-GMAIL-MSGID: 1773559539205017900 This patch is actually the v2 version of the this patch[1]. In the v1 version, Alexandre suggested that I should make the patch more general, so I even changed the title accordingly. Many thanks to Alexandre. And Alexandre also submitted a similar patch[2] recently, in which he implemented TLB flushing via flush_cache_vmap() instead. However, it seems that flush_cache_vmap() does not cover every place where arch_sync_kernel_mappings() performs TLB flushing. IMHO, arch_sync_kernel_mappings() cannot be replaced by flush_cache_vmap(). Please correct me if I'm wrong! [1]: [PATCH] riscv: Flush stale TLB entry with VMAP_STACK enabled http://lists.infradead.org/pipermail/linux-riscv/2023-August/037503.html [2]: [PATCH -fixes] riscv: Implement flush_cache_vmap() https://www.spinics.net/lists/kernel/msg4873712.html Dylan Jhong (1): riscv: Implement arch_sync_kernel_mappings() for "preventive" TLB flush arch/riscv/include/asm/page.h | 2 ++ arch/riscv/mm/tlbflush.c | 12 ++++++++++++ 2 files changed, 14 insertions(+)