Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3197363pxb; Mon, 9 Nov 2020 05:22:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5wyX7qGA6jBmImvtLUT5TzW8b0U49du+OU5xdrDi7v6TcFxEq+zbzVJD6G7JQ4t0lOeIz X-Received: by 2002:a17:906:57cc:: with SMTP id u12mr15236025ejr.163.1604928164395; Mon, 09 Nov 2020 05:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928164; cv=none; d=google.com; s=arc-20160816; b=wrkDECqnsdVOuCgb4UwzfR1E1mvKBJp4wFj6q6WWO7PhcU9lqgxbBRoDKuqOgowwi4 9VAlqBpSEkld/SZmjm9yyGod/iLzjLk/G5TX6e5+XwJhXPfUUhIHxE98DRnax/JGAugk PLjgLsg9WuAhjhPJNUKJr2YDwxykChSquFptMdTx9tzsYEW9GBkiJ/okNsDo3Q9hO+yo tmyZvvkanXbu6K/yirgeocRjdMi+0Gl36NBMx0IAyEMbo/Oi4i1TeaHoF6OX1R4iVGoh GfvLi0+OmAbMWWn7J8yKHmET3fqo5QCgFMaBRtibu/wbWPhG9eZVhf4aXq+B89qFqR48 XYbw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p3oolf7miFXLU4zB9QOnxZlGmgMVz1PFwJWHnbPkHeM=; b=Q+zF/6U7xTdIB5qYln3pbmGQQQcaYwSIOIATTIHQJkMsyGueYpbqUlunj9bAYK9A+d PBKsMouD1vUDMjUONSRpEvKOVQWpLbCfP5UpUspPjlnqHDP+U7IMtpQ4tGiM1j7vZnv5 MCMuOHoIhUleCqw/cwmvA+INflnJqlmIXSCyplqIjlngNX7VEO07sOsfFaxDff8nHcpe 7cx8bGmQogRHi700Wtu/lV5cJdD/9Oh2rNcGsIYoG4jgK0WldgaQqTtG0anuSE+cxeC1 6zjpsOKqbEEW/mcSL7ChMrly5RPNgfH1wfKovIK1KljXKMrStBPRUpMDUi3LNtsokgKN V8DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Uw1AZN4O; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si9327429edk.526.2020.11.09.05.22.20; Mon, 09 Nov 2020 05:22:44 -0800 (PST) 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=default header.b=Uw1AZN4O; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388018AbgKINVG (ORCPT + 99 others); Mon, 9 Nov 2020 08:21:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:48784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388012AbgKINVD (ORCPT ); Mon, 9 Nov 2020 08:21:03 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 031BC206D8; Mon, 9 Nov 2020 13:21:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604928062; bh=8YdJdY382QSEOjK9jFF6B7jhR85Sfy/nDMfGLnlL7Kw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uw1AZN4O6CaLKs2i3doMddrDLMvMyowIsEroXtPP+lmMQqr2EElUIMIjSzI0LfIqB UJiSlZ65UPgmNw8gTWRF0TP36eA+uL24S6t8v/y2vgVj1Q5NdJ+sjBzdiHNx7wxRi0 KxCMJrAZz363Ht4fnubq51qYvEnP2LjUnZ0Lb6jg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Michael Ellerman Subject: [PATCH 5.9 114/133] powerpc/40x: Always fault when _PAGE_ACCESSED is not set Date: Mon, 9 Nov 2020 13:56:16 +0100 Message-Id: <20201109125036.171681591@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125030.706496283@linuxfoundation.org> References: <20201109125030.706496283@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy commit 0540b0d2ce9073fd2a736d636218faa61c99e572 upstream. The kernel expects pte_young() to work regardless of CONFIG_SWAP. Make sure a minor fault is taken to set _PAGE_ACCESSED when it is not already set, regardless of the selection of CONFIG_SWAP. Fixes: 2c74e2586bb9 ("powerpc/40x: Rework 40x PTE access and TLB miss") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b02ca2ed2d3676a096219b48c0f69ec982a75bcf.1602342801.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/head_40x.S | 8 -------- 1 file changed, 8 deletions(-) --- a/arch/powerpc/kernel/head_40x.S +++ b/arch/powerpc/kernel/head_40x.S @@ -285,11 +285,7 @@ _ENTRY(saved_ksp_limit) rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ lwz r11, 0(r11) /* Get Linux PTE */ -#ifdef CONFIG_SWAP li r9, _PAGE_PRESENT | _PAGE_ACCESSED -#else - li r9, _PAGE_PRESENT -#endif andc. r9, r9, r11 /* Check permission */ bne 5f @@ -370,11 +366,7 @@ _ENTRY(saved_ksp_limit) rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ lwz r11, 0(r11) /* Get Linux PTE */ -#ifdef CONFIG_SWAP li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC -#else - li r9, _PAGE_PRESENT | _PAGE_EXEC -#endif andc. r9, r9, r11 /* Check permission */ bne 5f