From patchwork Wed Apr 27 12:16:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 8956241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2BF9BF29F for ; Wed, 27 Apr 2016 12:18:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22FC12021F for ; Wed, 27 Apr 2016 12:18:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EFEAB2022D for ; Wed, 27 Apr 2016 12:18:15 +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 1avOOk-00065m-T3; Wed, 27 Apr 2016 12:16:54 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1avOOi-0005zN-Eg for linux-arm-kernel@lists.infradead.org; Wed, 27 Apr 2016 12:16:52 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B3D93A; Wed, 27 Apr 2016 05:16:32 -0700 (PDT) Received: from [10.1.87.55] (e103136-lin.cambridge.arm.com [10.1.87.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0ACD63F218; Wed, 27 Apr 2016 05:16:30 -0700 (PDT) Subject: Re: [PATCH 3/3] ARM: domain: move {set, get}_domain under config guard To: Russell King - ARM Linux References: <1461325416-29570-1-git-send-email-vladimir.murzin@arm.com> <1461325416-29570-4-git-send-email-vladimir.murzin@arm.com> <20160427104918.GQ19428@n2100.arm.linux.org.uk> From: Vladimir Murzin Message-ID: <5720AD9D.7020909@arm.com> Date: Wed, 27 Apr 2016 13:16:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160427104918.GQ19428@n2100.arm.linux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160427_051652_517189_67B9BF8E X-CRM114-Status: GOOD ( 15.82 ) X-Spam-Score: -7.9 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jean-philippe.brucker@arm.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 On 27/04/16 11:49, Russell King - ARM Linux wrote: > On Fri, Apr 22, 2016 at 12:43:36PM +0100, Vladimir Murzin wrote: >> Domains is not available on !MMU cores, like R/M class. However, >> currently guarding manages M-class only, for the R-class, in case >> of fault we get in recursive "undefined instruction" faulting because >> __show_regs() tries to get domain information. >> >> Fix it by extending CONFIG_CPU_USE_DOMAINS on {set,get}_domain >> functions and providing stubs for the case where Domains is not >> supported. > > Huge big bloody NAK. > > I think it would be useful if you read the history of the file, > particularly looking at commit a5e090acbf545c0a3b04080f8a488b17ec41fe02. > > It really amazes me how people propose patches which undo bits of > previous patches without making comments about it. > > No way is this patch going in, which has the effect of completely > disabling SW PAN, sorry. > Thanks, Russell! I've confused myself that support for CPU_SW_DOMAIN_PAN implies CONFIG_CPU_USE_DOMAINS, but now I see they are in fact different features/users of those accessors. So something like below should be sufficient to fix my case, right? Cheers Vladimir diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 4adfb46..d10c385 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -108,7 +108,7 @@ void __show_regs(struct pt_regs *regs) else domain = *(unsigned int *)(regs + 1); #else - domain = get_domain(); + domain = IS_ENABLED(CONFIG_CPU_USE_DOMAINS)? get_domain() : 0; #endif #endif