Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1256091ybl; Thu, 22 Aug 2019 11:41:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqypxgCpGLuIpgn7O6w6F3hjkx0xSHd3BCcYMuGbfj7G1Mpz9kaKgbRBu713hS2vbkVCKur/ X-Received: by 2002:a17:90a:8b94:: with SMTP id z20mr1083175pjn.109.1566499286281; Thu, 22 Aug 2019 11:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566499286; cv=none; d=google.com; s=arc-20160816; b=bxgj/1yMVaL6ql3CX6H7MnZY+9MDS3H2cSrJb/6ehHi/fTf2ZTcz9R5WkzMAk7NfuQ 14CEmZnde+0inKuaUIhg3fMgW4X3qxSM6ILxv3ruXVR4dcY0iMOcTjzaWAaMuL9owycj Aw0iprvpQQfMI0/rQlUi2BRIKPWn6AlQcpaR+7u10h7Xt/UYBBDUPSzNFm6vmw2idDnm HYY+57QZ31723GpOekzHLVQJ2haIzEkMORHT4mSsBCT9MSgukBI3cS2beoZtYtRB7eo+ JQ1kjVAXKmWbFkl49k11wZbr9z9MTGrJ884LzPOcjVe/vg0EkxO7M6zYNTL9B+ogY06B 7wbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to; bh=ZjCYDoVUGT1W+rkpAnrbKY8AwfjOY5Z+JR7Po4MQPUA=; b=hl2/eScLw5b2g+Ey/LyWeGQvt/msOFCBFukx5rkv6KSZi3/RmMew1qzHwxzt/nC/k3 7vMI7Ad8GCHMbsVyDvAjOBuKNG9k8FI3eNpmmXVHdChe0Gw3pbUOzOLcndoJR4KHjKji xnHiQbBQA2d3SuPfnvrN4we1rZj7gSOUfiOrd+Gd+ksmAW9EEfDTVkp/UUNCNyIsEz39 tzDEFNUNc0lSADh1H1mY9bvGHsYL2ftoUHePTsVetj7jlw0oDDCYgCI5yriDsnUNbbfx lF3KQheCe8YDLGDX2mNwBxkRy4xDTUr3KSdmBEFi/fR4X5TxSkoAbfqNhAEFSzWFb52A 94YA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3si241034pld.197.2019.08.22.11.41.06; Thu, 22 Aug 2019 11:41:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388999AbfHVNJT (ORCPT + 99 others); Thu, 22 Aug 2019 09:09:19 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:53435 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388969AbfHVNJO (ORCPT ); Thu, 22 Aug 2019 09:09:14 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 46DlGv5YRdz9sPl; Thu, 22 Aug 2019 23:09:11 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 415480dce2ef03bb8335deebd2f402f475443ce0 In-Reply-To: <80432f71194d7ee75b2f5043ecf1501cf1cca1f3.1566196646.git.christophe.leroy@c-s.fr> To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Doug Crawford From: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/603: fix handling of the DIRTY flag Message-Id: <46DlGv5YRdz9sPl@ozlabs.org> Date: Thu, 22 Aug 2019 23:09:11 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-08-19 at 06:40:25 UTC, Christophe Leroy wrote: > If a page is already mapped RW without the DIRTY flag, the DIRTY > flag is never set and a TLB store miss exception is taken forever. > > This is easily reproduced with the following app: > > void main(void) > { > volatile char *ptr = mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); > > *ptr = *ptr; > } > > When DIRTY flag is not set, bail out of TLB miss handler and take > a minor page fault which will set the DIRTY flag. > > Fixes: f8b58c64eaef ("powerpc/603: let's handle PAGE_DIRTY directly") > Cc: stable@vger.kernel.org > Reported-by: Doug Crawford > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/415480dce2ef03bb8335deebd2f402f475443ce0 cheers