Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2082929ybz; Sun, 26 Apr 2020 10:45:10 -0700 (PDT) X-Google-Smtp-Source: APiQypLdgCvCHOD6DA2OYhMZBLdEGLR1yucaIhdSEB7hP8ZUqakH+49n0bU26yscAWSwpq+KzLQ3 X-Received: by 2002:aa7:ce0f:: with SMTP id d15mr15061824edv.290.1587923109936; Sun, 26 Apr 2020 10:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587923109; cv=none; d=google.com; s=arc-20160816; b=DReK7DfW5t+fQtZHekySr3KBEhHWPvwRxlQtU4yEV4M72mb/83AkRQFSow4AHCBcjq u5zT4nlmIYSz+Fj5r18wTR9IM7B5cBsTtl6ktv9SHBIs6whwLPsLoFJ6XI5PaTqf8Oi+ iFC1OOrz1p/d5Ft7HBfKbGoQjelpQs85yuNKCLjdzA56frwuM1Uzax76sUUfPdlpfCjx 57mP8TJKxXvD/cH8lofXfXjUlp6t2sgA1v72beTS0s5rcQWe8Msa4hwG3GUdPz222wBR asd1J/xbk1DWOCPEojHlOgDu2Vg/iQ11qm3BjCENpA+sTxFD5nbsPDFGJnSZUp+3uK5E eRMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6QZIq0AP3clle+HwQImVjb7n0E6IJuOK04kAA0AUwDM=; b=tkFfkqcnzUhRa5m70B+mD/hFwmTIKO/zJRj1a097ZiVIsWJrFrH2+Sg6YyPr6Ci+Wt csdbF5nQJtsN9fO0C8f9qwmO7khNRfJAk5EwCtPpSb6K0cuxWMKcrjkMv/yOP0LIVhad gN8IA4xOK9lARr6nT4i8shxJcrI+w1akBlmglWB96IgAiM3aVLHANYquol79Y+T+7W1q 4YgJjreSMraxy4q3jUzDcZ2nt202ykh8fjnIrzUFUw+PCx7ibbfoOXVFLf9VZhNfR147 dSWOSOx/4XmSJNOS+nt2G8McfcRQ7aHdI1NHIRf9u5w87Z3Z1iDmBAybVfHv55T3Dw0g N2rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=itNedcZm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s28si6907721eds.186.2020.04.26.10.44.46; Sun, 26 Apr 2020 10:45:09 -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=fail header.i=@flygoat.com header.s=vultr header.b=itNedcZm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbgDZRlM (ORCPT + 99 others); Sun, 26 Apr 2020 13:41:12 -0400 Received: from vultr.net.flygoat.com ([149.28.68.211]:59984 "EHLO vultr.net.flygoat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbgDZRlM (ORCPT ); Sun, 26 Apr 2020 13:41:12 -0400 Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id 3EFD320497; Sun, 26 Apr 2020 17:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1587922872; bh=CFOqPhCNifZKIhPop2Z/lA4KDKrcXNJ4tww+sR6tyHI=; h=From:To:Cc:Subject:Date:From; b=itNedcZm96N+XAGkLKBAbE9PYTNjOgkB74X6QCk0HwYQULEQ96oFQTUiEHO0hKxDM nwAzj9j9Y24JWZ9i10XlfwyY/LkPCDRT6P6HLVIDyD7VHrzS4gjT8m7HVi5rg0eXJe 40TxrUeMwtHpZiZhF9zmeb8GzcAEUTkM+bcH8l7tKuyHaR3ZX0NLpEIE+k05flZUwT wRACBWPXd/aOGEnGgPOfX9vpGo3PvDqNrW2c4OyW4eXSm129FfmlkK18e8iekLhOwb RLIndEhHY0l5d+vtiLTsDtjhSqwTorLfur8z/inhF754BZeZp/D09ybFxAmfpbReQi ZFAjknFXvS/og== From: Jiaxun Yang To: akpm@linux-foundation.org Cc: sunguoyun@loongson.cn, Jiaxun Yang , Thomas Bogendoerfer , Paul Burton , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Daniel Silsby , Dmitry Korotin , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mips/mm: Guard SOFT_DIRTY bit with config option Date: Mon, 27 Apr 2020 01:40:55 +0800 Message-Id: <20200426174058.1181837-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.26.0.rc2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After guarding SOFT_DIRTY with config option, it won't occupy precious page table bit on systems that didn't enable SOFT_DIRTY. It can prevent page btis overflow on MIPS32R2 systems with RIXI enabled. Signed-off-by: Jiaxun Yang Reported-by: Thomas Bogendoerfer --- arch/mips/include/asm/pgtable-bits.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h index d43fb6f8af14..e26dc41a8a68 100644 --- a/arch/mips/include/asm/pgtable-bits.h +++ b/arch/mips/include/asm/pgtable-bits.h @@ -55,7 +55,9 @@ enum pgtable_bits { #if defined(CONFIG_ARCH_HAS_PTE_SPECIAL) _PAGE_SPECIAL_SHIFT, #endif +#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY) _PAGE_SOFT_DIRTY_SHIFT, +#endif }; /* @@ -85,7 +87,9 @@ enum pgtable_bits { #if defined(CONFIG_ARCH_HAS_PTE_SPECIAL) _PAGE_SPECIAL_SHIFT, #endif +#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY) _PAGE_SOFT_DIRTY_SHIFT, +#endif }; #elif defined(CONFIG_CPU_R3K_TLB) @@ -101,7 +105,9 @@ enum pgtable_bits { #if defined(CONFIG_ARCH_HAS_PTE_SPECIAL) _PAGE_SPECIAL_SHIFT, #endif +#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY) _PAGE_SOFT_DIRTY_SHIFT, +#endif /* Used by TLB hardware (placed in EntryLo) */ _PAGE_GLOBAL_SHIFT = 8, @@ -128,7 +134,9 @@ enum pgtable_bits { #if defined(CONFIG_ARCH_HAS_PTE_SPECIAL) _PAGE_SPECIAL_SHIFT, #endif +#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY) _PAGE_SOFT_DIRTY_SHIFT, +#endif /* Used by TLB hardware (placed in EntryLo*) */ #if defined(CONFIG_CPU_HAS_RIXI) _PAGE_NO_EXEC_SHIFT, @@ -155,7 +163,11 @@ enum pgtable_bits { #else # define _PAGE_SPECIAL 0 #endif -#define _PAGE_SOFT_DIRTY (1 << _PAGE_SOFT_DIRTY_SHIFT) +#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY) +# define _PAGE_SOFT_DIRTY (1 << _PAGE_SOFT_DIRTY_SHIFT) +#else +# define _PAGE_SOFT_DIRTY 0 +#endif /* Used by TLB hardware (placed in EntryLo*) */ #if defined(CONFIG_XPA) -- 2.26.0.rc2