Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp840332lqt; Tue, 19 Mar 2024 05:45:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7EkiExuR2qhKB/+BKbHdTqHr2gWsm5p9+KbSqLsYPLeJEDqm1Lgum/gbY5slGiNehFI/iMxnwwy3YDi5eXiCw4X0VKik+W/sB2tlJ2g== X-Google-Smtp-Source: AGHT+IGxkdThAbBpGgZwd30l+EcFja8OpAKQWJJQdIb9JE48rVcfSPtIBjecT2p5t3tf3ZQBA/0q X-Received: by 2002:a05:6808:1818:b0:3c3:7cc7:f25a with SMTP id bh24-20020a056808181800b003c37cc7f25amr13302525oib.43.1710852356878; Tue, 19 Mar 2024 05:45:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710852356; cv=pass; d=google.com; s=arc-20160816; b=l0NYb4p/mehKuYE5a8c5lC2kOQk+c1hVkFpePwKNBPckPwjS64VblnbPclAiPM6K8I kTqv3NCWzUWqLk/Gud6c3BlT9s8Q0en0eWHyTbqKDwyg3alpWiVlV1GkYQr5Kv9NKQiC OGSzdJOCaQr7rImIwahVAH5UjTfunFd6wI3l5rcKefVWOZRFHg9DpwsnhP7Ea8QDX1/x XY0KTkjlNUBSDp/z59Ys9/LJd7NcD1fslRSViuyjMazPVevJc3QuPIbXvG8EkL2aV4zw ooFZVPfrUCd0xwV6MbjF4ZYaHyiRIMA6TEV0sLKrqsRjZF2vaJPwpEg5JYdKVxV1oZS0 Xf3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QCnVQ6eF8q7c3H5K7fRMGpDCEN2zvByN9L+V6LcZ1Jk=; fh=H4zuGoYm9fBgcUhZ7V48w31pHemx8/Bvqjy3cyg3qoo=; b=hPjJBNLdrkDgB6a/vZUPrw8csa+rDnmsTyP4Jwh4KeRbHDQ8plWVjK63pDDwlvNnHJ UOohz+79uK1XymFvvX+igMfqtIRYzY1WqR61gVjoOJ3+3/WcsxYnkGnE3Jo2Tpjy+Cry fgA7eJ0nq9O+xjRxK42VOoWZBN/auJw7Piqs24+qQduimYRgiKWKhJGp+pUgM5W3nirD mplhlOH//1OT4JKZ9AFbvOuuLWvPiq9fnBKGxZ/CvCngUa3M3466StqkbC2r7DK4YC27 +FoqTPgixZEPe1rri+g9B1rcGRmB0fJKwz+oUcMRCKulVM2w3vcR9bGo/P8TzsiCsisz Pg9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=Et3Hm9Ji; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-107531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ow20-20020a05620a821400b0078831bd38dfsi11145715qkn.379.2024.03.19.05.45.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 05:45:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=Et3Hm9Ji; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-107531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 981B41C21CBE for ; Tue, 19 Mar 2024 12:45:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EF965A4CF; Tue, 19 Mar 2024 12:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="Et3Hm9Ji" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A62295A4C7 for ; Tue, 19 Mar 2024 12:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710852350; cv=none; b=dac2UqG0XZ673uH0Ds5t3oC7XS0Ng3gWBEHCGL/P0ZBHN6+BLzk9pJ+hDhVUodsdzhvqcBvMtNPbmK2+ourj8OXUVBbQ6Ds3yl1P4gQhwsh+Tx36AaO6RKDRsEGEl7uchmkYe2KSOj7y873usi5EUgVB2r7LKnXrk31Y+Z7+M34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710852350; c=relaxed/simple; bh=Vq5FfZgwtJTnS/zN0GAF3T/ikNNPCy9YkKCxgLh4tTc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jwSALvW7wICGYZcz1HV/KzHApY0ZyrFTZvGqnzTWQyPollCBWGgwcahDrW+/RM8sf4hnxWQyNSCVGH84Ke4zvDWt0nFxPBSDkm3ix+Z/7Kg2xTrS35gnKDZoOyQNc6koOdMrOyMF9wHqTQlTzaYA32o2tSk8ZMavqeDPd6LtcPM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=Et3Hm9Ji; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id DC2BC40E016C; Tue, 19 Mar 2024 12:45:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RQzMyzj0HghI; Tue, 19 Mar 2024 12:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1710852340; bh=QCnVQ6eF8q7c3H5K7fRMGpDCEN2zvByN9L+V6LcZ1Jk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Et3Hm9JiolA9aI76GMPr2Avio38cnEMabndlqy6Ti3VdhnvqlJXlnbfI6T6nlXjqN oS/TroIo1tLAQzBUP4eJCc9dDy7UkxAuZI8zWa3S9eRzcdzcEyHOSQVimzYpCn3Vfh 8AxMDUj6w/UQSLMW5bgyV8IEVACukmVQBORWFM4p8/xi6hXa+pS2RvDPX9gYuodp+F 2JoA7K+G+gONWmCwZrpRn9T89w8g92i6hj7HIMV+goEkqv3rat0+z2ssjjBZI6ggOt yNhQ+L8+4L5KGpaYXZTfDLnVhbkJ7CrsZSxJzNAu5ed4YmyumsRn1sLaR5H1H+P9sv SN0A2+UH4u1EVi6OlCrSMka3IrPPI4RrsrSp33Ggj1Lacl9A8lkjrVsciXyMdZ+/oC i3ZtPW+NP8Ha/LExRJrw8R6fFOxwwttGAMhDQkX/uQWXYPGqSKPlez8MZ5mtXjmd5j zS5jXoEX7j8EZ0y1a8BTOdJAoL5ATN1gTExjJPphZf+S6VDkG+fyk/USHMttSslkM6 JF0EEM9Q6pyjXP39qun77l5ntLt9JigHZhvmeCREPi67Ywa4x+1dBdutf/J4rFppNN 1/bns/P5R/BMxN808sizeMGAcedQ1zwx+nTgTp4lqttCDocM5pLWyqyNNQhBRQdQRS m+a5lGCGG7bVBNkQ5LBlrdtk= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 69EEC40E0140; Tue, 19 Mar 2024 12:45:29 +0000 (UTC) Date: Tue, 19 Mar 2024 13:45:24 +0100 From: Borislav Petkov To: Uros Bizjak Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Linus Torvalds , Ingo Molnar , Josh Poimboeuf , Sean Christopherson Subject: Re: [PATCH -tip 0/3] x86/asm: Use generic asm operand modifiers instead of %P in asm templates Message-ID: <20240319124524.GBZfmI5IWLaioPcOUz@fat_crate.local> References: <20240319104418.284519-1-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240319104418.284519-1-ubizjak@gmail.com> On Tue, Mar 19, 2024 at 11:40:11AM +0100, Uros Bizjak wrote: > The "P" asm operand modifier is a x86 target-specific modifier. > > For x86_64, when used with a symbol reference, the "P" modifier > emits "sym" instead of "sym(%rip)". When used with a constant, the > "P" modifier emits "cst" instead of "$cst". This property is used to > emit bare symbol references and bare constants without all > syntax-specific prefixes. > > The generic "c", "n" and "a" operand modifiers should be used instead. > The following table shows the modifiers supported by all targets and > their effects: > > Modifier Description > ----------------------------------------------------------- > 'c' Require a constant operand and print the > constant expression with no punctuation. > 'n' Like '%c' except that the value of the constant > is negated before printing. > 'a' Substitute a memory reference, with the actual > operand treated as the address. This may be > useful when outputting a "load address" > instruction, because often the assembler syntax > for such an instruction requires you to write > the operand as if it were a memory reference. > > Also note that unlike GCC, clang emits %rip-relative symbol > reference with "P" asm operand modifier, so the patch also unifies > symbol handling with both compilers. FTR, I really appreciate the clear explanations of the operand modifiers along with an example in the commit messages. What they really do and what they mean have caused some serious head-scratching in the past, up to the point where I went through gcc sources with Matz' help to figure out what some of them do. So thanks! :-) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette