From patchwork Sun May 20 00:43:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 916968 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pNkD1czLz9s3x for ; Sun, 20 May 2018 10:55:32 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F5LE34Bk"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40pNkC5RbLzDrTf for ; Sun, 20 May 2018 10:55:31 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F5LE34Bk"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::241; helo=mail-pl0-x241.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F5LE34Bk"; dkim-atps=neutral Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40pNT42glmzDrWR for ; Sun, 20 May 2018 10:44:08 +1000 (AEST) Received: by mail-pl0-x241.google.com with SMTP id az12-v6so6678987plb.8 for ; Sat, 19 May 2018 17:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hvag+NSnjD+bOjB7jAHzwIebQMpDE3JgxbO5+IjbYFQ=; b=F5LE34BkGqMDsKDbjIRqecYiNSFc0QoFJBlZoilDoF7CbQNUWomFx6GU8Wx0KJWdcp /fmMsNRw0WdYCGjAOsRguzKfJjaRv96udoBpv+4x+/oUFB7zUvQV9hoFmba4f3OG8tHS X44UgOLmyxr61en5MgXw30vQhLHLHQuU3uitrjhKtnOwbbL2JbORPL6oBhWIgv68u694 Tc22m5ZX3Qfr/gzZVHejUpUuZqdHk7x9Ul0uO9XtEP20/CAtDcS6bBnjD2JqxD/qgALy NeBcvzK4QBXY4CdO9HBfVnIOpyr8uY/JSn9YQ8K5xWAlDY8EEMX3HrI8qLv2jBzm8RYg knVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hvag+NSnjD+bOjB7jAHzwIebQMpDE3JgxbO5+IjbYFQ=; b=OrHKQHTQ5eUUOnFJMn1X1w8xa8YZc9ZE1WvTieuDUlJqArBBPYn2xcEMb3yqF3s++j TDkrkTJI+ilvl3jzNgBTJHzueqc2otAHIPvJ3ijsZU/cdSYZGvFZN0lOnvcwIoMgAK/M h/SrRH88TGHzzKb0DcNUm5zLLO3xpzx1VQPHQ/6RI1jM5n549gv8JXN1xZzYrIlzuRf3 dGW+oP0R7oglo/33hiQ7f6zlVab87GvFLyGFG/ruAPuVJkNSPbQtejF/EAFpNuZbvyiy UR9/BkgKV+RjwVyjFMLYv1ZrKNWrvtYh3PHjxYkLcCwaZhTlV9Rk2PvXDs5PCAWdOEDU NSwA== X-Gm-Message-State: ALKqPwctZtnhKOXUEKNz34lLlHvuS2GIJWc+AZHFZ9BWOLz7DmBAGaAC An8IqRwQdvSrMaI+/ce8b6AYYw== X-Google-Smtp-Source: AB8JxZplPyBMeCpk/opJIKz8austG3jWrlCFP7ij1KJ8vA/Cb+kUbiVSuZr/KXkAlSBulu3ilvxkXQ== X-Received: by 2002:a17:902:a4:: with SMTP id a33-v6mr14937049pla.346.1526777046505; Sat, 19 May 2018 17:44:06 -0700 (PDT) Received: from roar.au.ibm.com (59-102-70-78.tpgi.com.au. [59.102.70.78]) by smtp.gmail.com with ESMTPSA id x25-v6sm16356062pfn.11.2018.05.19.17.44.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 May 2018 17:44:05 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 4/7] powerpc/64s/radix: make ptep_get_and_clear_full non-atomic for the full case Date: Sun, 20 May 2018 10:43:44 +1000 Message-Id: <20180520004347.19508-5-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180520004347.19508-1-npiggin@gmail.com> References: <20180520004347.19508-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This matches other architectures, when we know there will be no further accesses to the address (e.g., for teardown), page table entries can be cleared non-atomically. The comments about NMMU are bogus: all MMU notifiers (including NMMU) are released at this point, with their TLBs flushed. An NMMU access at this point would be a bug. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/book3s/64/radix.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h index 705193e7192f..fcd92f9b6ec0 100644 --- a/arch/powerpc/include/asm/book3s/64/radix.h +++ b/arch/powerpc/include/asm/book3s/64/radix.h @@ -176,14 +176,8 @@ static inline pte_t radix__ptep_get_and_clear_full(struct mm_struct *mm, unsigned long old_pte; if (full) { - /* - * If we are trying to clear the pte, we can skip - * the DD1 pte update sequence and batch the tlb flush. The - * tlb flush batching is done by mmu gather code. We - * still keep the cmp_xchg update to make sure we get - * correct R/C bit which might be updated via Nest MMU. - */ - old_pte = __radix_pte_update(ptep, ~0ul, 0); + old_pte = pte_val(*ptep); + *ptep = __pte(0); } else old_pte = radix__pte_update(mm, addr, ptep, ~0ul, 0, 0);