From patchwork Tue Mar 16 09:58:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Ivanov X-Patchwork-Id: 1453778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=f4CF3Nv9; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F07zV6WFrz9sRf for ; Tue, 16 Mar 2021 20:59:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=SdGihTFe/FRubtVD4RiBmEY2ABqOxBFQmccyi+JLkrk=; b=f4CF3Nv9qTmfmDSzc36eBma8ws x/Xpd5Mjba89/P7ga9V4Z577nZvWamo035Qm6YE8t58sQqqsMLqJeY3ndIFWRFwk32GKK17pQUjF8 s+Hv0JVpVaizJCm2YX0YokuBGkDDv0ZQ47o5dl1cwC7D3hSxmZFuXsyjcyy4ci605+SSLPXirlK/x QdU5iz1Ahpuxd8jo1V1zbM/5yb1mfVFp4c9y6P8q9g6V/3SkHQZwcdlVdkItpi/q+SXYfOmKlM5Bg +8F12K1kF8CelWRErBkV82kfVUvzL38Wpve6yxmfQcUL/PYN/+L3LzIQenRhXjO7BCgpqGE+Iy5BD CxzM5HVQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lM6TT-000L5f-Tr; Tue, 16 Mar 2021 09:58:51 +0000 Received: from ivanoab7.miniserver.com ([37.128.132.42] helo=www.kot-begemot.co.uk) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lM6TQ-000L5G-W7 for linux-um@lists.infradead.org; Tue, 16 Mar 2021 09:58:50 +0000 Received: from tun252.jain.kot-begemot.co.uk ([192.168.18.6] helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lM6TP-00005t-Fn; Tue, 16 Mar 2021 09:58:47 +0000 Received: from jain.kot-begemot.co.uk ([192.168.3.3]) by jain.kot-begemot.co.uk with esmtp (Exim 4.92) (envelope-from ) id 1lM6TM-0001Wy-Sq; Tue, 16 Mar 2021 09:58:46 +0000 From: anton.ivanov@cambridgegreys.com To: linux-um@lists.infradead.org Cc: johannes@sipsolutions.net, Anton Ivanov Subject: [PATCH] um: implement arch_sync_kernel_mappings Date: Tue, 16 Mar 2021 09:58:41 +0000 Message-Id: <20210316095841.5837-1-anton.ivanov@cambridgegreys.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Score: -1.0 X-Clacks-Overhead: GNU Terry Pratchett X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210316_095849_064054_664ACDA9 X-CRM114-Status: UNSURE ( 6.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Anton Ivanov This improves the tlb flushing behavior by syncing modified ranges out of map_kernel_range_noflush in a way which is similar to x86. Signed-off-by: Anton Ivanov --- arch/um/include/asm/page.h | 2 ++ arch/um/kernel/tlb.c | 5 +++++ 2 files changed, 7 insertions(+) Content analysis details: (0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Anton Ivanov This improves the tlb flushing behavior by syncing modified ranges out of map_kernel_range_noflush in a way which is similar to x86. Signed-off-by: Anton Ivanov --- arch/um/include/asm/page.h | 2 ++ arch/um/kernel/tlb.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h index 95af12e82a32..f4c66689f039 100644 --- a/arch/um/include/asm/page.h +++ b/arch/um/include/asm/page.h @@ -9,6 +9,8 @@ #include +#define ARCH_PAGE_TABLE_SYNC_MASK PGTBL_PMD_MODIFIED + /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index bc38f79ca3a3..b27c4457cc72 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c @@ -602,3 +602,8 @@ void force_flush_all(void) vma = vma->vm_next; } } + +void arch_sync_kernel_mappings(unsigned long start, unsigned long end) +{ + flush_tlb_kernel_range_common(start, end); +}