Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1651046pxj; Sat, 29 May 2021 22:37:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIHSwLjOtj/wMf4sQu99UnjdhqOGSyGf+zcKdt3yPf+IqDTv403oGLoIFzG2Ix4tHdKJRn X-Received: by 2002:a17:906:76c6:: with SMTP id q6mr16828890ejn.387.1622353042359; Sat, 29 May 2021 22:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622353042; cv=none; d=google.com; s=arc-20160816; b=i5kbO7GIqREy4RQ+1CdhQD1u69oY6rtC3jR8rxFoR7nEB5qwDHX151bFksa3zGpRQT qkZCFwE4hihE4NB2KcX+kk5QD9f73S2aBuiFOzE4HxB+a4yv5kZthfqDBTxdtxzGdMQw xqLkHkfvZ4CjmeSWaeXLiBbb4MDG0kEvENZ2wf+YLLRu1MmQeBWPA+9vxoMO3ojqLciP uEh2n9SUXR0flgn8RGhMwzTRhWwsbb+K5kL9eC/0aDw7SZ7zqf1BaZ1WflnbKSh/3y08 WQ4/OjCTAOGuw9FwlylzSA822g5by7l3hkdp7v+hhCzc+QDpQPAztBA8SV+VnHcpW/UR lD4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pthGxzeTt6qzaEjnBNdMzit0BBdZa9W9G6cpgXcofd4=; b=0MmwrSkpVvs1REjn19qeZfepqVjcdN0ju+/OCs3+VfdzoZRAhcIBmIbhAe9jbRdOAA bU5Hb8SSdAB3zWYRMWQ+JyA3N+UyYR8Fql5BKaD6jDiKhGCe0/CaCmVx8lNh+Ml/UxDq yNY6kiq+3MKqDQHaaPg7p+mWG8uguwU3fIaRH6IXC/kld5sRfOCxQ+pXgGiSK/YOB0U8 8GBmisK2mKlnJg5hAoNVRh4TEMa9Ufr6+dcacYJHgdvvNiSexmG5P3JOM9vkhfPZ9axG umbAq7p3liA/3Era4fSSAl6LZjqcnbJRb1V1ZOFi4brpQKfIJmng2h3M3LduJAdUtR7g pZEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tu01rQTe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si4980497edq.40.2021.05.29.22.36.36; Sat, 29 May 2021 22:37:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tu01rQTe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbhE3Ffn (ORCPT + 99 others); Sun, 30 May 2021 01:35:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:45204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbhE3Ffm (ORCPT ); Sun, 30 May 2021 01:35:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 64CD961108; Sun, 30 May 2021 05:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622352845; bh=FLn/9f8WMsIdmFnvrDv3Mglo+h1LSWEE4NFwYI9qejQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tu01rQTeK9Bh/v4eCo7w+Ip4ogwfvKVV8jD3yJSlSdusQjNnog2wrv9NoNWhfl7A5 iF4kO2WVxan3vNWMmI3CNm3SGZDE+SKF81ZbAN2OKSneoYp2iYykoI1wK9577fzZAQ B3zp7YbEkujEn7vC0oZd6z2NLpDb4Mefa5D5aF/2GmKggt7oItNCMZ21JF2qwVdecM ZgiLMxDXXAINrydlVUZhboc92qKALqnlaNd42I/FfhwssZBv8Ppf7DqLat+9cRKu/M +tW7wifOivCSaShs2EuwlIIJui4Xm22K0nBxI0KKFrw7YclJGEMliQmZEh1+wV1w7S kkG5lBDKJ2F/A== Received: by mail-lf1-f43.google.com with SMTP id b18so7654571lfv.11; Sat, 29 May 2021 22:34:05 -0700 (PDT) X-Gm-Message-State: AOAM532Bdl/KjJ/cXHWYGaiNfZbS8SPXtv4uXlOjU+dpfo3Br6YozQMT lZ1HP3YZ6LNqD0/x0Gik5HDUKaJM2704TasCCCA= X-Received: by 2002:a05:6512:36c5:: with SMTP id e5mr10864663lfs.41.1622352843723; Sat, 29 May 2021 22:34:03 -0700 (PDT) MIME-Version: 1.0 References: <1622008161-41451-2-git-send-email-guoren@kernel.org> In-Reply-To: From: Guo Ren Date: Sun, 30 May 2021 13:33:52 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V4 1/2] riscv: Fixup _PAGE_GLOBAL in _PAGE_KERNEL To: Palmer Dabbelt Cc: Anup Patel , Arnd Bergmann , Christoph Hellwig , linux-riscv , Linux Kernel Mailing List , linux-arch , linux-sunxi@lists.linux.dev, Guo Ren Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 30, 2021 at 7:42 AM wrote: > > On Tue, 25 May 2021 22:49:20 PDT (-0700), guoren@kernel.org wrote: > > From: Guo Ren > > > > Kernel virtual address translation should avoid to use ASIDs or it'll > > cause more TLB-miss and TLB-refill. Because the current ASID in satp > > belongs to the current process, but the target kernel va TLB entry's > > ASID still belongs to the previous process. > > Sorry, I still can't quite figure out what this is trying to say. I > went ahead and re-wrote the commit text to > > riscv: Use global mappings for kernel pages > > We map kernel pages into all addresses spages, so they can be marked as > global. This allows hardware to avoid flushing the kernel mappings when > moving between address spaces. Okay > > LMK if I'm misunderstanding something here, it's on for-next. > > > > > Signed-off-by: Guo Ren > > Reviewed-by: Anup Patel > > Reviewed-by: Christoph Hellwig > > Cc: Palmer Dabbelt > > --- > > arch/riscv/include/asm/pgtable.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h > > index 9469f46..346a3c6 100644 > > --- a/arch/riscv/include/asm/pgtable.h > > +++ b/arch/riscv/include/asm/pgtable.h > > @@ -134,7 +134,8 @@ > > | _PAGE_WRITE \ > > | _PAGE_PRESENT \ > > | _PAGE_ACCESSED \ > > - | _PAGE_DIRTY) > > + | _PAGE_DIRTY \ > > + | _PAGE_GLOBAL) > > > > #define PAGE_KERNEL __pgprot(_PAGE_KERNEL) > > #define PAGE_KERNEL_READ __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE) -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/