From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E7F5C43381 for ; Thu, 21 Feb 2019 13:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 462742080F for ; Thu, 21 Feb 2019 13:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726077AbfBUNrl (ORCPT ); Thu, 21 Feb 2019 08:47:41 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39960 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725385AbfBUNrl (ORCPT ); Thu, 21 Feb 2019 08:47:41 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1LDanHn107530 for ; Thu, 21 Feb 2019 08:47:40 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2qsuq3bujm-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 21 Feb 2019 08:47:39 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Feb 2019 13:47:38 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 21 Feb 2019 13:47:35 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1LDlY9a51773546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 Feb 2019 13:47:34 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 274EDAE053; Thu, 21 Feb 2019 13:47:34 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE69BAE04D; Thu, 21 Feb 2019 13:47:29 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.199.55.4]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 21 Feb 2019 13:47:28 +0000 (GMT) X-Mailer: emacs 26.1 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: Jan Kara Cc: Chandan Rajendra , mpe@ellerman.id.au, Dan Williams , linux-fsdevel@vger.kernel.org Subject: Re: write fault on dax mapping and usage of set_pte_at. In-Reply-To: References: <871s41a9mo.fsf@linux.ibm.com> <20190221121238.GB21533@quack2.suse.cz> Date: Thu, 21 Feb 2019 19:17:27 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 19022113-0028-0000-0000-0000034B508B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19022113-0029-0000-0000-000024099555 Message-Id: <87y3698d8w.fsf@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-21_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902210100 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org "Aneesh Kumar K.V" writes: > On 2/21/19 5:42 PM, Jan Kara wrote: >> Hi Aneesh, >> >> On Thu 21-02-19 12:52:39, Aneesh Kumar K.V wrote: >>> We found this while testing dax with XFS, but i guess this is true for >>> other file systems too. The stack trace looks as >>> > >>> I guess iomap code doesn't handle this correctly? Or am I missing >>> some other ways we can end up flushing tlb? >> >> So for RW->RO transition we use ptep_clear_flush() in dax_entry_mkclean() >> so that one is certainly safe. Similarly for unmapping. The RO->RW >> transition does not seem to have any TLB flush so there TLB could still >> carry stale information but it's the same as with normal page faults on >> invalid PTEs or with protection faults for normal pages (see e.g. >> finish_mkwrite_fault()). > > I am not sure i understood that. RO -> RW transition can have stale TLB > entries with RO mapping in them. So architecture do flush TLB during the > fault, some may not. We do have a NestMMU issue with that transition > which requires us to do mark the pte invalid and flush TLB for that > transition. (see commit bd5050e38aec3055ff4257ade987d808ac93b582 ) > > For invalid PTEs we should have a TLB entry at all. For invalid PTEs we should not have a TLB entry at all. -aneesh