From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85B86C2BA19 for ; Wed, 15 Apr 2020 12:08:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 526B6206F9 for ; Wed, 15 Apr 2020 12:08:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O017E4gd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 526B6206F9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cV2dHwY4JNoOG4BfpPR/16TT1I5PPS1iYbxG/oBiF+0=; b=O017E4gdr+Cqds XiVnw2z8C5N16255Y6cXcnjC/YH1acHDIcDR5Se2bxYxpe2nGxkWUVRCvyQhOstwyhUE0SVKauHLR 7ePcSaEExZSA3PiYDdgARdN1Dx16VavixypgKcS9GCMeNT0/opLU0VkQQ3xZa/2yXq1yy2hsBmSOW GHIH5oEsLZXqIDdio9Ha4opgdMdOhm/X/FAddRg3TWk6iA4mwPEOrjyxlLDGJqyDQ2xRZc6XHNxk2 T+hDpciZhMLs3jaBTsncarUIWQ7Yb7gAbbKPK1iF9rzF3bZJJPsbm8jyxfrP20H0tIZqv1OSFccRx lXZTqq8Co6F59y/TJS9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOgpm-00087v-JA; Wed, 15 Apr 2020 12:08:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOgpj-00087Z-J5 for linux-arm-kernel@lists.infradead.org; Wed, 15 Apr 2020 12:08:01 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3931C1063; Wed, 15 Apr 2020 05:07:56 -0700 (PDT) Received: from gaia (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E1C653F68F; Wed, 15 Apr 2020 05:07:54 -0700 (PDT) Date: Wed, 15 Apr 2020 13:07:52 +0100 From: Catalin Marinas To: Fangrui Song Subject: Re: [PATCH v2] arm64: Delete the space separator in __emit_inst Message-ID: <20200415120752.GD6526@gaia> References: <20200414163255.66437-1-maskray@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200414163255.66437-1-maskray@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200415_050759_672789_0AE3E330 X-CRM114-Status: GOOD ( 11.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Ilie Halip , Nick Desaulniers , linux-kernel@vger.kernel.org, Jian Cai , clang-built-linux@googlegroups.com, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Apr 14, 2020 at 09:32:55AM -0700, Fangrui Song wrote: > In assembly, many instances of __emit_inst(x) expand to a directive. In > a few places __emit_inst(x) is used as an assembler macro argument. For > example, in arch/arm64/kvm/hyp/entry.S > > ALTERNATIVE(nop, SET_PSTATE_PAN(1), ARM64_HAS_PAN, CONFIG_ARM64_PAN) > > expands to the following by the C preprocessor: > > alternative_insn nop, .inst (0xd500401f | ((0) << 16 | (4) << 5) | ((!!1) << 8)), 4, 1 > > Both comma and space are separators, with an exception that content > inside a pair of parentheses/quotes is not split, so the clang > integrated assembler splits the arguments to: > > nop, .inst, (0xd500401f | ((0) << 16 | (4) << 5) | ((!!1) << 8)), 4, 1 > > GNU as preprocesses the input with do_scrub_chars(). Its arm64 backend > (along with many other non-x86 backends) sees: > > alternative_insn nop,.inst(0xd500401f|((0)<<16|(4)<<5)|((!!1)<<8)),4,1 > # .inst(...) is parsed as one argument > > while its x86 backend sees: > > alternative_insn nop,.inst (0xd500401f|((0)<<16|(4)<<5)|((!!1)<<8)),4,1 > # The extra space before '(' makes the whole .inst (...) parsed as two arguments > > The non-x86 backend's behavior is considered unintentional > (https://sourceware.org/bugzilla/show_bug.cgi?id=25750). > So drop the space separator inside `.inst (...)` to make the clang > integrated assembler work. > > Suggested-by: Ilie Halip > Signed-off-by: Fangrui Song > Reviewed-by: Mark Rutland > Link: https://github.com/ClangBuiltLinux/linux/issues/939 Queued for 5.7. Thanks. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel