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=-8.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 3DC7BC2D0A8 for ; Mon, 28 Sep 2020 15:41:09 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 CA9312074F for ; Mon, 28 Sep 2020 15:41:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="D3tAE5mu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA9312074F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kMvGl-0001b0-0e; Mon, 28 Sep 2020 15:40:51 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kMvGk-0001av-36 for xen-devel@lists.xenproject.org; Mon, 28 Sep 2020 15:40:50 +0000 X-Inumbo-ID: 034fb5a9-e157-44f3-b127-26d07995c2bb Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 034fb5a9-e157-44f3-b127-26d07995c2bb; Mon, 28 Sep 2020 15:40:48 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1601307647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8k00dyy90cnElDeKCGRU7w+1tk+Sb5qx3fO7N/RDIl8=; b=D3tAE5mu77WAjU0eRyy3Hza1J/LzfkpYpbSOMXv3jILoqYgC/dhKRqiNClM6ZBWiRvtCld 3xuQvVZEe3HsMQvcYnABnx+uaI+uWNAKyI5CIjusscFIRFMMH2jFF6BbeYwuTHCk3zFyzG 6ZxXfyUDrI3FL8jaSFCi2RdjQxG1sJg= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AE553ADA8; Mon, 28 Sep 2020 15:40:47 +0000 (UTC) Subject: Re: [PATCH 6/5] x86/ELF: drop unnecessary volatile from asm()-s in elf_core_save_regs() To: Andrew Cooper Cc: "xen-devel@lists.xenproject.org" , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <06b8dedb-49d9-eeb6-d56a-c7852486d22e@suse.com> From: Jan Beulich Message-ID: <4a7d8f8b-72bf-4d3d-e273-588b656ce23a@suse.com> Date: Mon, 28 Sep 2020 17:40:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 28.09.2020 17:15, Andrew Cooper wrote: > On 28/09/2020 16:04, Jan Beulich wrote: >> There are no hidden side effects here. >> >> Signed-off-by: Jan Beulich >> --- >> v2: New. >> >> --- a/xen/include/asm-x86/x86_64/elf.h >> +++ b/xen/include/asm-x86/x86_64/elf.h >> @@ -37,26 +37,26 @@ typedef struct { >> static inline void elf_core_save_regs(ELF_Gregset *core_regs, >> crash_xen_core_t *xen_core_regs) >> { >> - asm volatile("movq %%r15,%0" : "=m"(core_regs->r15)); >> - asm volatile("movq %%r14,%0" : "=m"(core_regs->r14)); >> - asm volatile("movq %%r13,%0" : "=m"(core_regs->r13)); >> - asm volatile("movq %%r12,%0" : "=m"(core_regs->r12)); >> - asm volatile("movq %%rbp,%0" : "=m"(core_regs->rbp)); >> - asm volatile("movq %%rbx,%0" : "=m"(core_regs->rbx)); >> - asm volatile("movq %%r11,%0" : "=m"(core_regs->r11)); >> - asm volatile("movq %%r10,%0" : "=m"(core_regs->r10)); >> - asm volatile("movq %%r9,%0" : "=m"(core_regs->r9)); >> - asm volatile("movq %%r8,%0" : "=m"(core_regs->r8)); >> - asm volatile("movq %%rax,%0" : "=m"(core_regs->rax)); >> - asm volatile("movq %%rcx,%0" : "=m"(core_regs->rcx)); >> - asm volatile("movq %%rdx,%0" : "=m"(core_regs->rdx)); >> - asm volatile("movq %%rsi,%0" : "=m"(core_regs->rsi)); >> - asm volatile("movq %%rdi,%0" : "=m"(core_regs->rdi)); >> + asm ( "movq %%r15,%0" : "=m" (core_regs->r15) ); >> + asm ( "movq %%r14,%0" : "=m" (core_regs->r14) ); >> + asm ( "movq %%r13,%0" : "=m" (core_regs->r13) ); >> + asm ( "movq %%r12,%0" : "=m" (core_regs->r12) ); >> + asm ( "movq %%rbp,%0" : "=m" (core_regs->rbp) ); >> + asm ( "movq %%rbx,%0" : "=m" (core_regs->rbx) ); >> + asm ( "movq %%r11,%0" : "=m" (core_regs->r11) ); >> + asm ( "movq %%r10,%0" : "=m" (core_regs->r10) ); >> + asm ( "movq %%r9,%0" : "=m" (core_regs->r9) ); >> + asm ( "movq %%r8,%0" : "=m" (core_regs->r8) ); > > Any chance we can align these seeing as they're changing? I wasn't really sure about this - alignment to cover for the difference between r8 and r9 vs r10-r15 never comes out nicely, as the padding should really be in the number part of the names. I'd prefer to leave it as is, while ... > What about spaces before %0 ? ... I certainly will add these (as I should have noticed their lack myself). > Either way, Reviewed-by: Andrew Cooper Thanks. Jan