From patchwork Wed Mar 12 13:40:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 26110 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E2655236AC for ; Wed, 12 Mar 2014 13:40:57 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id g12sf39826561oah.3 for ; Wed, 12 Mar 2014 06:40:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Nk1/PWRxps7NaxqZzRk4sQ42a7W0iS+qcMHsjCUyuQQ=; b=CuFqtusw38Ov/UkHuyP+ZxTTUp3jjkJ+wU4jhxJSsqp0MPupc85y5OvhJXrLwnc5Ei kgF3n0B+y1/v25w35bNZvRWBErKLu1S2W+Byj5kP8VCxEOHaZeB/gSbs55Ap4KPX1639 BmE/5lTBZD4cA9k8Fm+s9603i/5HQ0f26S32Ya/TQsr62bJ2Hzw70HydpNS86Q/PQrqw xs0BTwR6Dvj3AnohoJ5VN6CMM6Rhhk7pcZNAOzJ6P7D3kZlZZj6MBoNDU+NroUvUDWzh bzID54u+3HORgdYgn9HslFtWKxasPMcTSnj07/FT0geNYQV3QOeDGsGVhRxiL/tNNFyQ UYTQ== X-Gm-Message-State: ALoCoQkscSVydVpgEgNMn2v/8C6ORfdB5sVOXlitcgwdvXWGpRjBc1IFW2Zf2PWuc4Nn4Ived7OX X-Received: by 10.50.176.229 with SMTP id cl5mr12468195igc.3.1394631657483; Wed, 12 Mar 2014 06:40:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.181 with SMTP id h50ls2927956qgh.15.gmail; Wed, 12 Mar 2014 06:40:57 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr32895929vcb.16.1394631657337; Wed, 12 Mar 2014 06:40:57 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id xb4si3796307vdc.116.2014.03.12.06.40.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 06:40:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so9902145veb.39 for ; Wed, 12 Mar 2014 06:40:57 -0700 (PDT) X-Received: by 10.58.161.205 with SMTP id xu13mr32241708veb.4.1394631657208; Wed, 12 Mar 2014 06:40:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp289415vck; Wed, 12 Mar 2014 06:40:56 -0700 (PDT) X-Received: by 10.180.77.49 with SMTP id p17mr712331wiw.4.1394631656073; Wed, 12 Mar 2014 06:40:56 -0700 (PDT) Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by mx.google.com with ESMTPS id ap4si23844065wjc.64.2014.03.12.06.40.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 06:40:56 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.177 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=74.125.82.177; Received: by mail-we0-f177.google.com with SMTP id u57so11108136wes.22 for ; Wed, 12 Mar 2014 06:40:55 -0700 (PDT) X-Received: by 10.180.12.14 with SMTP id u14mr7900148wib.0.1394631655404; Wed, 12 Mar 2014 06:40:55 -0700 (PDT) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id j8sm11095886wjn.13.2014.03.12.06.40.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2014 06:40:54 -0700 (PDT) From: Steve Capper To: linux-arm-kernel@lists.infradead.org Cc: will.deacon@arm.com, catalin.marinas@arm.com, linux@arm.linux.org.uk, chanho61.park@samsung.com, zishen.lim@linaro.org, patches@linaro.org, gary.robertson@linaro.org, michael.hudson@linaro.org, christoffer.dall@linaro.org, peterz@infradead.org, Steve Capper Subject: [RFC PATCH V3 5/6] arm64: mm: Enable HAVE_RCU_TABLE_FREE logic Date: Wed, 12 Mar 2014 13:40:22 +0000 Message-Id: <1394631623-17883-6-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394631623-17883-1-git-send-email-steve.capper@linaro.org> References: <1394631623-17883-1-git-send-email-steve.capper@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In order to implement fast_get_user_pages we need to ensure that the page table walker is protected from page table pages being freed from under it. This patch enables HAVE_RCU_TABLE_FREE, any page table pages belonging to address spaces with multiple users will be call_rcu_sched freed. Meaning that disabling interrupts will block the free and protect the fast gup page walker. Signed-off-by: Steve Capper --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/tlb.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 27bbcfc..6185f95 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -38,6 +38,7 @@ config ARM64 select HAVE_MEMBLOCK select HAVE_PATA_PLATFORM select HAVE_PERF_EVENTS + select HAVE_RCU_TABLE_FREE select IRQ_DOMAIN select MODULES_USE_ELF_RELA select NO_BOOTMEM diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index 72cadf5..58a8b78 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h @@ -22,6 +22,14 @@ #include +#include +#include + +static inline void __tlb_remove_table(void *_table) +{ + free_page_and_swap_cache((struct page *)_table); +} + /* * There's three ways the TLB shootdown code is used: * 1. Unmapping a range of vmas. See zap_page_range(), unmap_region().