From patchwork Tue Nov 10 01:31:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 7587361 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 51D1F9F2F7 for ; Tue, 10 Nov 2015 01:34:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FA1A205D8 for ; Tue, 10 Nov 2015 01:34:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5331F205DD for ; Tue, 10 Nov 2015 01:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634AbbKJBdn (ORCPT ); Mon, 9 Nov 2015 20:33:43 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:35678 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbbKJBcD (ORCPT ); Mon, 9 Nov 2015 20:32:03 -0500 Received: by pasz6 with SMTP id z6so223485667pas.2 for ; Mon, 09 Nov 2015 17:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt_com.20150623.gappssmtp.com; s=20150623; h=from:to:to:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:subject :date:message-id:in-reply-to:references; bh=FD+D4bZALGV8xX9QGqr8G5sBX8RRKisI76bhK79NCjE=; b=WMUq+hZYto2joPY2BDDycGu2t4to9hD57Mll9bJfq2EQ7Z6onal5dhIJdVTm8aKrrr QI8Zs1dnhggMES/88D6ONo3vsnfcVNL3RIdbZEjIsSOPW4r6e6FxNGv8BJeX1zcJlsru c/8R7ommwA8XT/65LZNXIlUctga4t4fV/RI0xWT16d99mo4n7hxSGI6N1UBxzqrimV2E CcQj3J0BhM7cdJgqy/T5MJtA4tfRcJvOxoORpVVKY4Cbfjq4OyPAoyFJakHyuK5Ux+ua jaXc00Vo/hxlEa5mc/+oHCEcJ+RM5Kl8immNY9bE+Up2j66tehlOVckMErm/Whb9uoHQ pt3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:to:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:subject:date:message-id:in-reply-to:references; bh=FD+D4bZALGV8xX9QGqr8G5sBX8RRKisI76bhK79NCjE=; b=lQcJtmna2B5nmHv6rPz8GFAHf+EQZnzgOHQ+NMemE2awghWHhVyYBJ/0TLBjJb2kwL 3aFElOR8yl9OdYrYBegs4MRWTgtQqHa1LOQYNriyBzhnKe3kR16qfv6WlY0oJXjkzSRC twmX4jlrTt8u2DGi9xaowDs9NPAjNE+hmtgKMlD3E/kDY7AvY/gptbblErmBAsMSqrc6 0h2cGQg3uP37FYYnr/bURRNhfExQSvIKnupXz87Ge0f0xPUqVQEFbPQfcc3GCIClOT6K P05iWe4QtJiktL8GOPRo2M9895L3vTjn7GojWBmfraP+GTTIKGKHiwu6ij0yqX/9BB5c MTZw== X-Gm-Message-State: ALoCoQmVwwbYL1GdmdgEhsDS8Dp5foCaAsj89JRT3iM7HO7ixWKbbLt8V70FXiExp22pmVQURUfP X-Received: by 10.68.233.233 with SMTP id tz9mr1508190pbc.15.1447119121755; Mon, 09 Nov 2015 17:32:01 -0800 (PST) Received: from localhost (wap-cal.CS.Berkeley.EDU. [128.32.35.228]) by smtp.gmail.com with ESMTPSA id kd9sm607459pbb.32.2015.11.09.17.32.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 17:32:01 -0800 (PST) From: Palmer Dabbelt To: arnd@arndb.de To: dhowells@redhat.com To: peterz@infradead.org Cc: viro@zeniv.linux.org.uk Cc: ast@plumgrid.com Cc: aishchuk@linux.vnet.ibm.com Cc: aarcange@redhat.com Cc: akpm@linux-foundation.org Cc: luto@kernel.org Cc: acme@kernel.org Cc: bhe@redhat.com Cc: 3chas3@gmail.com Cc: chris@zankel.net Cc: dave@sr71.net Cc: dyoung@redhat.com Cc: drysdale@google.com Cc: davem@davemloft.net Cc: ebiederm@xmission.com Cc: geoff@infradead.org Cc: gregkh@linuxfoundation.org Cc: hpa@zytor.com Cc: mingo@kernel.org Cc: iulia.manda21@gmail.com Cc: plagnioj@jcrosoft.com Cc: jikos@kernel.org Cc: josh@joshtriplett.org Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: mathieu.desnoyers@efficios.com Cc: jcmvbkbc@gmail.com Cc: paulmck@linux.vnet.ibm.com Cc: a.p.zijlstra@chello.nl Cc: tglx@linutronix.de Cc: tomi.valkeinen@ti.com Cc: vgoyal@redhat.com Cc: x86@kernel.org Cc: Palmer Dabbelt Subject: [PATCH 13/14] Hide CONFIG_PHY_RAM_BASE_ADDRESS from userspace Date: Mon, 9 Nov 2015 17:31:10 -0800 Message-Id: <1447119071-19392-14-git-send-email-palmer@dabbelt.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1447119071-19392-1-git-send-email-palmer@dabbelt.com> References: <1446579994-9937-1-git-send-email-palmer@dabbelt.com> <1447119071-19392-1-git-send-email-palmer@dabbelt.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 This feels a bit odd, but I couldn't really come up with a better way to do it. There already appears to be a workaround for this macro not being defined in userspace, so I figured I'd better leave that in place, since someone is probably using it. The result is that unless you include before then you'll get the wrong offsets. The only user of is currently , so it's at least safe for now. There's a CPP error in there to check for this. --- arch/blackfin/include/asm/fixed_code.h | 6 +++++ arch/blackfin/include/uapi/asm/fixed_code.h | 35 ++++++++++++++++------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/arch/blackfin/include/asm/fixed_code.h b/arch/blackfin/include/asm/fixed_code.h index bc330f0..7e03b9b 100644 --- a/arch/blackfin/include/asm/fixed_code.h +++ b/arch/blackfin/include/asm/fixed_code.h @@ -9,6 +9,12 @@ #ifndef __BFIN_ASM_FIXED_CODE_H__ #define __BFIN_ASM_FIXED_CODE_H__ +#ifdef CONFIG_PHY_RAM_BASE_ADDRESS +#define CONFIG_PHY_RAM_BASE_ADDRESS 0x0 +#endif + +#define PHY_RAM_BASE_ADDRESS CONFIG_PHY_RAM_BASE_ADDRESS + #include #ifndef __ASSEMBLY__ diff --git a/arch/blackfin/include/uapi/asm/fixed_code.h b/arch/blackfin/include/uapi/asm/fixed_code.h index 3bef1dc..50b70a0 100644 --- a/arch/blackfin/include/uapi/asm/fixed_code.h +++ b/arch/blackfin/include/uapi/asm/fixed_code.h @@ -10,29 +10,32 @@ #ifndef _UAPI__BFIN_ASM_FIXED_CODE_H__ #define _UAPI__BFIN_ASM_FIXED_CODE_H__ - -#ifndef CONFIG_PHY_RAM_BASE_ADDRESS -#define CONFIG_PHY_RAM_BASE_ADDRESS 0x0 +#ifndef PHY_RAM_BASE_ADDRESS +#ifdef __KERNEL__ +#error "Don't include , include " +#else +#define PHY_RAM_BASE_ADDRESS 0x0 +#endif #endif -#define FIXED_CODE_START (CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) +#define FIXED_CODE_START (PHY_RAM_BASE_ADDRESS + 0x400) -#define SIGRETURN_STUB (CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) +#define SIGRETURN_STUB (PHY_RAM_BASE_ADDRESS + 0x400) -#define ATOMIC_SEQS_START (CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) +#define ATOMIC_SEQS_START (PHY_RAM_BASE_ADDRESS + 0x410) -#define ATOMIC_XCHG32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) -#define ATOMIC_CAS32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x420) -#define ATOMIC_ADD32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x430) -#define ATOMIC_SUB32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x440) -#define ATOMIC_IOR32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x450) -#define ATOMIC_AND32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x460) -#define ATOMIC_XOR32 (CONFIG_PHY_RAM_BASE_ADDRESS + 0x470) +#define ATOMIC_XCHG32 (PHY_RAM_BASE_ADDRESS + 0x410) +#define ATOMIC_CAS32 (PHY_RAM_BASE_ADDRESS + 0x420) +#define ATOMIC_ADD32 (PHY_RAM_BASE_ADDRESS + 0x430) +#define ATOMIC_SUB32 (PHY_RAM_BASE_ADDRESS + 0x440) +#define ATOMIC_IOR32 (PHY_RAM_BASE_ADDRESS + 0x450) +#define ATOMIC_AND32 (PHY_RAM_BASE_ADDRESS + 0x460) +#define ATOMIC_XOR32 (PHY_RAM_BASE_ADDRESS + 0x470) -#define ATOMIC_SEQS_END (CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) +#define ATOMIC_SEQS_END (PHY_RAM_BASE_ADDRESS + 0x480) -#define SAFE_USER_INSTRUCTION (CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) +#define SAFE_USER_INSTRUCTION (PHY_RAM_BASE_ADDRESS + 0x480) -#define FIXED_CODE_END (CONFIG_PHY_RAM_BASE_ADDRESS + 0x490) +#define FIXED_CODE_END (PHY_RAM_BASE_ADDRESS + 0x490) #endif /* _UAPI__BFIN_ASM_FIXED_CODE_H__ */