[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1] xen: Work around Clang-IAS macro expansion bug
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 21 Feb 2023 13:10:48 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RGg+S/YX3ih7sldNRpJcUDqZqWYCbeNPIix+ilwvGVs=; b=S4EbC1JkbSSoca2ncMI4q9RqxdfUJD4TCFwq6ksIkFBMTQuGXe40/33GhVL6hM+q6pS9w3bkhHSZBHttTsp/xi50p75R+iEpysuEA4aHWiObMtKE+kuEmsNVWrdAUep2JYC/AmfPRz2964QaFUGDoNGLVeMItXt9ekZGeJUz9uXt2qXin2zEkIsDytqFBI9HDCOpcUF54lrJ3yP7juuB2wsypdFYbupyELNTzXeeomuCmQpwAYxbUwPiZipFUJ/dqFSTS7wXCULdAxiEUYfTxkyYmaOgAZci3TrpGIayQjhYoMVH64bACj6i+Vh6Ksh8lrLdWfuDxOrxBxZYSF8dDg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a5HSlNjrn0IENNwu7nNVisWpBVqOsvOKihnL2yIz4Sz51PR0N7fNLsBpP99qeTckcdnk3MVPOYOGPVQRRN44HpFT7qmAICGi/raZgf8k3mM2P2un9nl4sn3lmzGbvUiBkWrrt9HIfJfY1aaGVRRSimtdmBal34jDl8ZJ2H0NNMsLRszyoZaqq2RoW3HUcCkeI4sr3qspyqR0yVjpMaqgsoDvDQozAMpRKo97YcAtBFhmeg0l9U9tq6WBSbI3n263NKWNY3eGqoBzxPmIX8/5nb0bGmClkNVP9IsrrSFKlf3KgyjEM45lvEtUYW31zRT/IvVVWCWEpID+7tLIhEAqng==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 21 Feb 2023 13:11:31 +0000
- Ironport-data: A9a23:TYPi8KhlY0M+CAX8dPvYQOa0X161QhEKZh0ujC45NGQN5FlHY01je htvDzrTP6mMYjT0eIhxPoS/oEID68OAztcxGwdo/nw0EyMb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWt0N8klgZmP6sT5gWHzyN94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+ tRIKR8/fB+cndi2/+KJYMYy29oCNMPSadZ3VnFIlVk1DN4AaLWaGuDgw48d2z09wMdTAfzZe swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilEhluGzYLI5efTTLSlRtm+eq njL4CLSBRYCOcbE4TGE7mitlqnEmiaTtIc6Re3ip6802QH7Kmo7ARsQdUOFkNCDk0Ofdc55O Wc93hExlP1nnKCsZpynN/Gim1aGtBMBX9tbE8Uh9RqAjKHT5m6xGWwsXjNHLts8u6ceVTEsk 1OEgd7tLThuq6GOD2KQ8K+OqjG/MjRTKnUNDRLoViMA6tjn5Ys13hTGS486FLbv14OlXzbt3 zqNsS4ywa0JitIG3Lm6+laBhC+wop/OTUg+4QC/sn+Z0z6VrbWNP+SAgWU3J94eRGpFZjFtZ EQ5pvU=
- Ironport-hdrordr: A9a23:YuROX6zCaGcHMB9Xww5mKrPxMegkLtp133Aq2lEZdPULSKGlfp GV9sjziyWetN9wYh4dcB67SdC9qADnhPlICO4qTMqftWjdyRGVxeRZgbcKrAeQeBEWmtQtsJ uINpIOc+EYbmIK8/oSgjPZLz9I+rDunsGVbKXlvg9QpGlRGt5dBmxCe2Km+yNNNW977NYCZf ihDp0tnUvdRZ1bVLXyOpFDNNKz1eHjpdbDW1orFhQn4A6BgXeB76P7KQGR2lMzQi5C2rAr9E nCikjc6r+4u/+25xfA3yuLhq4m1OfJ+59mPoihm8IVIjLjhkKBY5lgYaSLuHQYsfyi81Ejlf jLulMFM95o433cU2mpqV/G2hXm0hwp93j+oGXozEfLkIjcfnYXGsBBjYVWfl/w7Fchhsh11O Zu03iCv5RaIBvclGCljuK4HS1Cpw6Rmz4PgOQTh3tQXc83b6JQl5UW+AdwHI0bFCz3xYg7GK 1FDd3a5txRbVSGBkqp9VVH8ZiJZDAeDx2GSk8Ntoi81CVXpmlwyw8iyMkWjh47heUAYqgBw9 6BHrVjlblIQMNTR7l6Hv09Tcy+DXGIaQ7QMUqJSG6XVJ0vCjbokdra8b817OaldNgj150pgq nMV1teqCobZ1/uM8uTx5dGmyq9AVlVZQ6diP222qIJ/4EVHNHQQGm+oREV4oWdSswkc47ms6 3ZAuMQPxfhRVGebbqhkTeOHaW6EkNuI/H9iuxLKm5mnfi7WrECltarBso7d4CdWAoMayfYPk YpegTVCYFp0n2LM0WI9SQ5HUmdNXDCwQ==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 21/02/2023 12:46 pm, Jan Beulich wrote:
> On 21.02.2023 13:26, Andrew Cooper wrote:
>> On 21/02/2023 10:31 am, Jan Beulich wrote:
>>> On 17.02.2023 13:22, Andrew Cooper wrote:
>>>> https://github.com/llvm/llvm-project/issues/60792
>>>>
>>>> It turns out that Clang-IAS does not expand \@ uniquely in a translaition
>>>> unit, and the XSA-426 change tickles this bug:
>>>>
>>>> <instantiation>:4:1: error: invalid symbol redefinition
>>>> .L1_fill_rsb_loop:
>>>> ^
>>>> make[3]: *** [Rules.mk:247: arch/x86/acpi/cpu_idle.o] Error 1
>>>>
>>>> Extend DO_OVERWRITE_RSB with an optional parameter so C callers can mux %=
>>>> in
>>>> too, which Clang does seem to expand properly.
>>>>
>>>> Fixes: 63305e5392ec ("x86/spec-ctrl: Mitigate Cross-Thread Return Address
>>>> Predictions")
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>>> ---
>>>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>>>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>>> CC: Wei Liu <wl@xxxxxxx>
>>>>
>>>> v1 (vs RFC):
>>>> * Rename \foo to \x, reorder WRT \@ to avoid needing \() too.
>> Sadly, this is not quite correct. There needs to be a non-numeric
>> character separating \@ and \x or the concatenation of the two can end
>> up non-unique.
> How that if \@ is always 1?
It isn't always 1.
Global (file scope) have \@ expand properly from 0 to N.
Function scope have \@ expand properly from 0 to N in a single asm()
statement.
The 1 here is actually because mknops took the 0 and didn't use it. If
instead we had something like:
asm ("DO_OVERWRITE_RSB"); // \@ = 0
asm ("mkops 2;"
"DO_OVERWRITE_RSB"); // \@ = 1
then it would assemble fine, but the way we build alternatives in asm()
statements reliably causes the alternative block to consume \@=1.
>> So I think we need the \().
> Or put one at the start of the label and the other at the end?
We already played that trick with \n for the .irp, which suffers
similarly with concatenation.
~Andrew
|