Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2948522imm; Thu, 17 May 2018 00:20:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZogHdOyDzbnMQg6J3vlCrat0lcmRWcVePk14fKi1DrMxfq3WIPmRVQ1LLom0xW1TczzXPX5 X-Received: by 2002:a62:469b:: with SMTP id o27-v6mr4111098pfi.124.1526541606576; Thu, 17 May 2018 00:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526541606; cv=none; d=google.com; s=arc-20160816; b=r474FWs0LFjFZk2VGKNBXAXbmn9ehgmqkzDAyROURSUECURurSgSF6uZ1CAgVN23ik 1cB3ia/4Vee51Ckdr8Vu4huO/4+MTpSjoEj4wJX+wasTRH8gTMhUDGvcgb2if5exQ1DY U/RUE+hB/HxUrlg2N3VtWxgqpGXiK0ehbVNIXcQNVR8tJWHov5/nQXI9B2AlMBhmRhSu Sluam/2ZoJ23AiYNtWTBm+pL47DhmDATwGnQvuLj/n0eYsO8FVZuqRR9DlXNljX93VQo Mrv7dSN8JpibVp6l7P6y50zDwyw2AKaNpjcSJzWc7XGGSlQS5pAe7+HlZ9ec6FZzvsqh BFiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:in-reply-to:references :subject:cc:to:from:date:message-id:arc-authentication-results; bh=3AwGFp/2mboTU7nLjd1lAe3LnzV9v/cGyNO5LnRJDK8=; b=kWWIeBeVIZ1yWE97B/prhiaf+ovUJDkUfsnc9q/r85b2IoV7H2T4UAAwdHeOM8Fy+u rJLF/S1ix9C94ASpy278u2aIl1O7siw69IXkMqZar2qjp/qwGKEVh/og/5qOhlcr1wvA VFmoHE9CpgjI6m6M5nLD+dIBaNES8rX4JgRvmRqbQB/AlIbHX3OnBZaP71QQDSQlcJXo lyLI9W7HC45jiMqjM5hDTQadMpNBvu3ka4e4pRBRpi9BwpB5ihFN4/boLfrTcqes/TGF 7/TLW8ZPoerIv4/NhSzz2dRoUbZ3nZsouhpN6Ylv70SrIa+ynW4AB0hkC+FBXTsyWVKS ymwg== ARC-Authentication-Results: i=1; mx.google.com; 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 s36-v6si4243315pld.114.2018.05.17.00.19.51; Thu, 17 May 2018 00:20:06 -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; 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 S1752219AbeEQHSY convert rfc822-to-8bit (ORCPT + 99 others); Thu, 17 May 2018 03:18:24 -0400 Received: from prv1-mh.provo.novell.com ([137.65.248.33]:60644 "EHLO prv1-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938AbeEQHSX (ORCPT ); Thu, 17 May 2018 03:18:23 -0400 Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Thu, 17 May 2018 01:18:22 -0600 Message-Id: <5AFD2CBD02000078001C37BE@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.0.0 Date: Thu, 17 May 2018 01:18:21 -0600 From: "Jan Beulich" To: "Nadav Amit" Cc: , "the arch/x86 maintainers" , , "Josh Poimboeuf" , , , Subject: Re: [RFC 5/8] x86: refcount: prevent gcc distortions References: <20180515141124.84254-1-namit@vmware.com> <20180515141124.84254-15-namit@vmware.com> <5AFBDA6302000078001C31AC@prv1-mh.provo.novell.com> <8B7DE95F-5E57-44F0-90E0-CCBA35F98A07@vmware.com> In-Reply-To: <8B7DE95F-5E57-44F0-90E0-CCBA35F98A07@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> On 16.05.18 at 18:44, wrote: > Jan Beulich wrote: >>>>> On 15.05.18 at 16:11, wrote: >>> --- a/arch/x86/include/asm/refcount.h >>> +++ b/arch/x86/include/asm/refcount.h >>> @@ -14,34 +14,43 @@ >>> * central refcount exception. The fixup address for the exception points >>> * back to the regular execution flow in .text. >>> */ >>> -#define _REFCOUNT_EXCEPTION \ >>> - ".pushsection .text..refcount\n" \ >>> - "111:\tlea %[counter], %%" _ASM_CX "\n" \ >>> - "112:\t" ASM_UD2 "\n" \ >>> - ASM_UNREACHABLE \ >>> - ".popsection\n" \ >>> - "113:\n" \ >>> + >>> +asm ("\n" >>> + ".macro __REFCOUNT_EXCEPTION counter:vararg\n\t" >>> + ".pushsection .text..refcount\n" >>> + "111:\tlea \\counter, %" _ASM_CX "\n" >>> + "112:\t" ASM_UD2 "\n\t" >>> + ASM_UNREACHABLE >>> + ".popsection\n\t" >>> + "113:\n" >>> _ASM_EXTABLE_REFCOUNT(112b, 113b) >>> + ".endm"); >> >> A few comments on assembly code formatting - while gas at present is >> relatively lax in this regard, I wouldn't exclude that there might be a >> more strict mode in the future, and that such a mode might eventually >> become the default. Furthermore these formatting aspects affect >> readability of the assembly produced, should anyone ever find a need >> to look at it (perhaps because of some breakage) - I certainly do every >> once in a while. >> >> Labels should be placed without any indentation (but of course there >> may be more than one on a line, in which case subsequent ones may >> of course be arbitrarily indented). Instructions and directives, otoh, >> should be placed with at least a single tab or space of indentation >> (unless preceded by a label, in which case the extra white space still >> helps readability). > > Writing these patches, I looked at the generated assembly, and there did not > appear to be a standard. IIRC, .pushsection directives were not always > inlined. I will fix it according to your comments. Right, I should have made explicit that there's no consistency at all in pre-existing code. I merely think the issue shouldn't be made worse. Jan