Received: by 10.213.65.68 with SMTP id h4csp1062595imn; Wed, 21 Mar 2018 01:25:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELsg5EcEjX3GUsvEJSvTYKGNiOnWGCL7RNWozBvUgGCm5YjDZS+m6Hs6UKMfK5L+TokKDrx6 X-Received: by 10.98.233.3 with SMTP id j3mr16298031pfh.38.1521620710278; Wed, 21 Mar 2018 01:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521620710; cv=none; d=google.com; s=arc-20160816; b=eodFdUUI7ga2+MKDsj8IGNuyAA7tehPhCUSpi8NYZov+beThzt27KWG1Uy2Tk7/BDC oUyCJAJjhB/S8q2qBE+8LjcCBN8T4cEbrVWzyx7fTC4X4PlrYZykhG8WK2ues6Dh5/Jh byKTpu+j/QDuSWqh5nUtasMdaZgQclF5xdqXEcrwIKzyVvTYKsYQPQtAkE/XSaLm0y5z X9qKWkORp/jEw2j7/B0pTpHq9J9EynIwVVHTMz/IiA+sjh/i2p9HvB6rXC7x3x9V0GV+ cSNTDmgPLStZUMD5KKuVVdViS4hKGt+1yOCypR4cJOBC133sByQMlrE0yU6CKHLqwxSB HSGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:user-agent:message-id :references:in-reply-to:subject:cc:to:from:date :content-transfer-encoding:mime-version:arc-authentication-results; bh=kyqha5V7XweX0youGtrI6AfrlYM7bCOK8FWRJjzhYVY=; b=LUuU+BLWl5QdQW90DizwrSaWk8BU8ClWjvG0a506kxU2Hcoh7oZFb7cMgNba9uP9DA JaaPe9QuaZ9/LtsEO1XlwGp3JlVxrkaoW3WjmcZpKpafsyzBf3BhfkGAGEJUg3Gekhgd TsE/7PBmtn/662SuUTx0CQCQiKO90hdSISxK4qPkZhorifegpSDTsegDeCqMoibuvZf+ v4s91RqBH4DJ21TQ6oVw7OtOvsfFLo4zWf6EJnhprTCW95FmPPL88fhPWFpYqbHitG18 LxWHEBF7OGcNL3lYv8W97kC5y9YvpbYFKEZIERT3bIY7yAuZodnYtk7WlREr6IM2mDoY mEtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=YJOIgWXL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b23si2463478pgn.258.2018.03.21.01.24.55; Wed, 21 Mar 2018 01:25:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=YJOIgWXL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751908AbeCUIWx (ORCPT + 99 others); Wed, 21 Mar 2018 04:22:53 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:46495 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863AbeCUIWt (ORCPT ); Wed, 21 Mar 2018 04:22:49 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 02B205C1EF3; Wed, 21 Mar 2018 09:22:25 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Wed, 21 Mar 2018 09:22:47 +0100 From: Stefan Agner To: Russell King - ARM Linux Cc: ard.biesheuvel@linaro.org, arnd@arndb.de, nicolas.pitre@linaro.org, marc.zyngier@arm.com, behanw@converseincode.com, keescook@chromium.org, Bernhard.Rosenkranzer@linaro.org, mka@chromium.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] bus: arm-cci: use asm unreachable In-Reply-To: <20180320233046.GL2743@n2100.armlinux.org.uk> References: <20180320230206.25289-1-stefan@agner.ch> <20180320230206.25289-2-stefan@agner.ch> <20180320233046.GL2743@n2100.armlinux.org.uk> Message-ID: <23ba28a09df84e723cd38bfc16dfca56@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1521620546; bh=kyqha5V7XweX0youGtrI6AfrlYM7bCOK8FWRJjzhYVY=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID; b=YJOIgWXLvN2ltFpuoK/fBwqOs/IAS4ePdUcz5nsUbJqdnQy6pYJEF7RfAIkBPGUBBcLSZMqemsGddma0u63oDu7PBxAbqLTtSrkIwkfHGzI6bfvnTFLBTcHrPZNKVD/bVgDI1pu1s50tJkDCjjUevmegtNyMUOxd1fl7I0H2Klc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.03.2018 00:30, Russell King - ARM Linux wrote: > On Wed, Mar 21, 2018 at 12:02:02AM +0100, Stefan Agner wrote: >> Mixing asm and C code is not recommended in a naked function by >> gcc and leads to an error when using clang: >> drivers/bus/arm-cci.c:2107:2: error: non-ASM statement in naked >> function is not supported >> unreachable(); >> ^ >> >> Instead of using the unreachable() macro use the assember variant >> ASM_UNREACHABLE. This will no longer emit __builtin_unreachable(), >> but since the function is naked and its return type is void it seems >> not to have aversive effects. > > I think that unreachable() there is rather silly - this function > *does* return, and the comments say as much. Just delete the silly > "unreachable()", there's no need to put an ASM_UNREACHABLE in there. > > The function is not declared as not returning, and nothing in this > file uses it anyway - it's called from the mcpm code, which also > _does_ expect this function to return (if it doesn't, then we're > basically saying the CPU that called it is dead.) > Hm, that makes sense. Will just drop unreachable() in the next revision. Thanks for reviewing! -- Stefan >> >> Signed-off-by: Stefan Agner >> --- >> drivers/bus/arm-cci.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c >> index 5426c04fe24b..ee9da86fec47 100644 >> --- a/drivers/bus/arm-cci.c >> +++ b/drivers/bus/arm-cci.c >> @@ -2084,6 +2084,7 @@ asmlinkage void __naked cci_enable_port_for_self(void) >> >> " mov r0, #0 \n" >> " bx lr \n" >> + ASM_UNREACHABLE >> >> " .align 2 \n" >> "5: .word cpu_port - . \n" >> @@ -2103,8 +2104,6 @@ asmlinkage void __naked cci_enable_port_for_self(void) >> [sizeof_struct_cpu_port] "i" (sizeof(struct cpu_port)), >> [sizeof_struct_ace_port] "i" (sizeof(struct cci_ace_port)), >> [offsetof_port_phys] "i" (offsetof(struct cci_ace_port, phys)) ); >> - >> - unreachable(); >> } >> >> /** >> -- >> 2.16.2 >>