From patchwork Wed Jun 18 20:10:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 4379111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7325C9F314 for ; Wed, 18 Jun 2014 20:13:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADF912037E for ; Wed, 18 Jun 2014 20:13:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCE0F20379 for ; Wed, 18 Jun 2014 20:13:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxMBv-0000Qz-RO; Wed, 18 Jun 2014 20:10:43 +0000 Received: from mail-yk0-f201.google.com ([209.85.160.201]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxMBt-0000O5-4o for linux-arm-kernel@lists.infradead.org; Wed, 18 Jun 2014 20:10:41 +0000 Received: by mail-yk0-f201.google.com with SMTP id 9so59777ykp.0 for ; Wed, 18 Jun 2014 13:10:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EPTSQzeWmTFALsIaCH2WYLZrxm2KE3SYWq9sfqej/AM=; b=BJinnnPB2aYi4ukgrjLs+/kpaiHu7BkUSNGE6nqbfwYnDrhShGUMhjvLqLyrODoz/w IdQLpzV+A8YOhxaJtibHcUk6qJPUwzfnarKNeep39k7zoZPTb/wQPJ5aG0CGQaf88Elk PLMDSxvh+qPuZoGTK5SXM7yJKmWWzf4GojYX9JoyIZ3IUYRbu3HvIkPcQom+KhYfz2jd RQBYne76z/YoX77bbbIbyWx49nWbJZkcsdhmDpmgFD+iSaQB1tP4IFOu5NCxOvG1HxK3 O4mL8oJKcAwyiUWH1Y8LwDIAdHuInIyrvh+FQ/P58cPloITku/7lp9W2e6UTOMyimrIq n6zQ== X-Gm-Message-State: ALoCoQkdLwXNfxxCsSTUAQZ16sQ8id8NgzSgTLpeR39gzcpBqReYQOz+ufiXUWo/Vbj34Dq5BwdA X-Received: by 10.58.108.40 with SMTP id hh8mr260133veb.18.1403122216631; Wed, 18 Jun 2014 13:10:16 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id t4si210639yhm.0.2014.06.18.13.10.16 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jun 2014 13:10:16 -0700 (PDT) Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.120.100]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 7A70E5A4630; Wed, 18 Jun 2014 13:10:16 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 10474160AA5; Wed, 18 Jun 2014 13:10:15 -0700 (PDT) From: Colin Cross To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM64: implement TASK_SIZE_OF Date: Wed, 18 Jun 2014 13:10:09 -0700 Message-Id: <1403122209-26352-1-git-send-email-ccross@android.com> X-Mailer: git-send-email 2.0.0.526.g5318336 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140618_131041_262895_C65FF6DC X-CRM114-Status: GOOD ( 10.54 ) X-Spam-Score: -0.7 (/) Cc: Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Colin Cross , Andrew Morton X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP include/linux/sched.h implements TASK_SIZE_OF as TASK_SIZE if it is not set by the architecture headers. TASK_SIZE uses the current task to determine the size of the virtual address space. On a 64-bit kernel this will cause reading /proc/pid/pagemap of a 64-bit process from a 32-bit process to return EOF when it reads past 0xffffffff. Implement TASK_SIZE_OF exactly the same as TASK_SIZE with test_tsk_thread_flag instead of test_thread_flag. Cc: stable@vger.kernel.org Signed-off-by: Colin Cross --- arch/arm64/include/asm/memory.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 993bce527b85..902eb708804a 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -56,6 +56,8 @@ #define TASK_SIZE_32 UL(0x100000000) #define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ TASK_SIZE_32 : TASK_SIZE_64) +#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \ + TASK_SIZE_32 : TASK_SIZE_64) #else #define TASK_SIZE TASK_SIZE_64 #endif /* CONFIG_COMPAT */