From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38871C43334 for ; Thu, 16 Jun 2022 18:45:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377733AbiFPSo7 (ORCPT ); Thu, 16 Jun 2022 14:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbiFPSo6 (ORCPT ); Thu, 16 Jun 2022 14:44:58 -0400 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1AFA2C132; Thu, 16 Jun 2022 11:44:56 -0700 (PDT) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1655405094; 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=Vyq1QaJNcPGeZXUPChWIIfLLby0vd/A5lJq5m22MfDI=; b=F77myjhPBWu0h7ouFKKj0XC9PilN0M7a9ouW2YaFoSXdgN8CVJ+CDau2RV6XCwtnnBluRB ayIgk0cX5PRFYRmiToLFeK4mXWHDK2B5vHwt7UBftBK/BrEqJCGKICgjanti1ZbxByX7Lp ULHroYgZFgfrGwnb1buKFIR5ktUxAfo= Date: Thu, 16 Jun 2022 18:44:53 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: oliver.upton@linux.dev Message-ID: <7b1040c48bc9b2986798322c336660ab@linux.dev> Subject: Re: [PATCH] selftests: KVM: Handle compiler optimizations in ucall To: "David Laight" Cc: "Raghavendra Rao Ananta" , "Marc Zyngier" , "James Morse" , "Alexandru Elisei" , "Suzuki K Poulose" , "Paolo Bonzini" , "Catalin Marinas" , "Will Deacon" , "Peter Shier" , "Ricardo Koller" , "Oliver Upton" , "Reiji Watanabe" , "Jing Zhang" , "Colton Lewis" , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, "Andrew Jones" In-Reply-To: <3e73cb07968d4c92b797781b037c2d45@AcuMS.aculab.com> References: <3e73cb07968d4c92b797781b037c2d45@AcuMS.aculab.com> <20220615185706.1099208-1-rananta@google.com> <20220616120232.ctkekviusrozqpru@gator> <33ca91aeb5254831a88e187ff8d9a2c2@AcuMS.aculab.com> <20220616162557.55bopzfa6glusuh5@gator> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org June 16, 2022 11:48 AM, "David Laight" wrote:= =0A> No wonder I was confused.=0A> It's not surprising the compiler optim= ises it all away.=0A> =0A> It doesn't seem right to be 'abusing' WRITE_ON= CE() here.=0A> Just adding barrier() should be enough and much more descr= iptive.=0A=0AI had the same thought, although I do not believe barrier() = is sufficient=0Aon its own. barrier_data() with a pointer to uc passed th= rough=0Ais required to keep clang from eliminating the dead store.=0A=0A-= -=0AThanks,=0AOliver