Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3081133rwb; Fri, 16 Dec 2022 09:49:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf5dTwlz01ISUDkOuC38MaSNtr7gS8et4C2k5hk3Nr1AdCCZwBbmS87GkCRuPVl6PhU+M1QG X-Received: by 2002:a17:902:768b:b0:186:865c:ea17 with SMTP id m11-20020a170902768b00b00186865cea17mr31703372pll.38.1671212957512; Fri, 16 Dec 2022 09:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671212957; cv=none; d=google.com; s=arc-20160816; b=rf6gHh5sPq6Fme6MVcpvfWWTljB0vljR6WxmikXLYzLI93fMJzII+GkJWdlKgqNXXW /1/BX8lfcjFsvjmDVjSyZYtWtGeUKYjfB3Waa4ZUo2SsuEGHGFjI7h3kmi98UWqttZCD iPPrEpL90OJ3fn/tNY2mgRf2TCc0ciUfBymBoEa8BYpU9jGU+BDHgxW2hkBuxl64k/QL GMWISTaCmEJkrXd4U7spnlNS7OBhsCxXnrIi6LDvfdTkgitliJpq/iv+sdg554gbq5Wj klWalA0uhM/C7f9jdwhSQZWiDXB1ZR6bzBEeXffIEoUz7C2tzhPJrHrm3vNcvSIzEJCi EXsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=v7ZXrhoIPpCkQhg45/YLdL8aMtxMKxle7HM/ZpAF3sI=; b=RcLrypo3KQVAGo3TgE3pc27Lwfmph5sTly2KHM7in0S3wW5WHLt3fI0nm2cU02n2MA z3kkQOr6XFlio5WMqhrJqPD9NrJsCibReboXi4+s1Jcdfc5jEGGuWLSWiBXdXDE1FrTW QVianNVCm9JoJNJ/LJbGiX37C0nYOpZYircFnbNXN+8D3lI5pb1qq5sCXSP7z8G6boUs 3iD4AAhoFHMV58kgG+p0QSn/eGJ6l1SggxWZKvkVtDPHNDgw2uOKwOesWd/BgV8z5wKG s3SQOZbCYCtNURA6sIhZA8e8nwVOGJdQqCrqd+Xu6EcMT9Xz+frjEQ5s8O5FYsh6uOv/ JxmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a170902729400b001891fd4ebf0si2866794pll.495.2022.12.16.09.49.08; Fri, 16 Dec 2022 09:49:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230233AbiLPRiO (ORCPT + 68 others); Fri, 16 Dec 2022 12:38:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiLPRiM (ORCPT ); Fri, 16 Dec 2022 12:38:12 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC544046A; Fri, 16 Dec 2022 09:38:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 776B3621C0; Fri, 16 Dec 2022 17:38:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD48FC433D2; Fri, 16 Dec 2022 17:38:08 +0000 (UTC) Date: Fri, 16 Dec 2022 12:38:04 -0500 From: Steven Rostedt To: David Laight Cc: 'Andreas Schwab' , "'Leizhen (ThunderTown)'" , Geert Uytterhoeven , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , "Joe Lawrence" , "live-patching@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Masahiro Yamada , Alexei Starovoitov , Jiri Olsa , Kees Cook , Andrew Morton , "Luis Chamberlain" , "linux-modules@vger.kernel.org" , Ingo Molnar , linux-m68k , "Jason A. Donenfeld" Subject: Re: [PATCH v9] kallsyms: Add self-test facility Message-ID: <20221216123805.6eba002c@gandalf.local.home> In-Reply-To: <20221216121947.7d03b651@gandalf.local.home> References: <20221115083349.1662-1-thunder.leizhen@huawei.com> <49070ac3-02bb-a3b3-b929-ede07e3b2c95@huawei.com> <4aaede14-8bd3-6071-f17b-7efcb5f0de42@huawei.com> <66ec4021-b633-09ba-73ee-b24cdb3fa25a@huawei.com> <06345dca-0afb-00a5-c9e9-5ba830d8ad05@huawei.com> <52450ec1da164d6d87587063c3b3d3d2@AcuMS.aculab.com> <592dce7a0de24c62bd31c29f86ce6c1b@AcuMS.aculab.com> <87pmcjidfe.fsf@igel.home> <1ba1fadb39994a4d91edabdfd9d69fa6@AcuMS.aculab.com> <87len7ibtt.fsf@igel.home> <87fsdfib07.fsf@igel.home> <819801284eb745d9a4189759bad297f5@AcuMS.aculab.com> <20221216115314.6120beb7@gandalf.local.home> <20221216121947.7d03b651@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 16 Dec 2022 12:19:47 -0500 Steven Rostedt wrote: > I assumed that "memory" was for memory unrelated to the input constraints. Well, it looks like you do need a "memory" barrier. https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html "memory" The "memory" clobber tells the compiler that the assembly code performs memory reads or writes to items other than those listed in the input and output operands (for example, accessing the memory pointed to by one of the input parameters). To ensure memory contains correct values, GCC may need to flush specific register values to memory before executing the asm. Further, the compiler does not assume that any values read from memory before an asm remain unchanged after that asm; it reloads them as needed. Using the "memory" clobber effectively forms a read/write memory barrier for the compiler. As the "(for example, accessing the memory pointed to by one of the input parameters)" is exactly this case. -- Steve