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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80DB1CCA47E for ; Thu, 16 Jun 2022 18:45:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DCF5C4B1B4; Thu, 16 Jun 2022 14:44:59 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@linux.dev Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 66lpezC+ij5U; Thu, 16 Jun 2022 14:44:58 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9C0464B121; Thu, 16 Jun 2022 14:44:58 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 943404B105 for ; Thu, 16 Jun 2022 14:44:57 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SXSWorBkm3Bp for ; Thu, 16 Jun 2022 14:44:56 -0400 (EDT) Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 42D164B103 for ; Thu, 16 Jun 2022 14:44:56 -0400 (EDT) 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 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" 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 Cc: Catalin Marinas , kvm@vger.kernel.org, Will Deacon , Marc Zyngier , Peter Shier , linux-kernel@vger.kernel.org, Colton Lewis , linux-kselftest@vger.kernel.org, Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu June 16, 2022 11:48 AM, "David Laight" wrote: > No wonder I was confused. > It's not surprising the compiler optimises it all away. > > It doesn't seem right to be 'abusing' WRITE_ONCE() here. > Just adding barrier() should be enough and much more descriptive. I had the same thought, although I do not believe barrier() is sufficient on its own. barrier_data() with a pointer to uc passed through is required to keep clang from eliminating the dead store. -- Thanks, Oliver _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 E43A5C43334 for ; Thu, 16 Jun 2022 18:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbiFPSo6 (ORCPT ); Thu, 16 Jun 2022 14:44:58 -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-kselftest@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 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B94BC433EF for ; Thu, 16 Jun 2022 18:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To:Cc:To:Subject: Message-ID:From:Date:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mv+epe8B2QpYl1TBy+ldGjez5iq55k3KMu0ReUSr134=; b=di+kfi7MbngaPg zVdi4qczsAyD4U82rhnBF6mWHGhG4xI6rqE1jm04stbppLcn6FS9PqsfW24p4fiJhFyzlPW6mWzhf G+6pEPgpY3y/283tXRhlWG9FPIkHYQ47F/+T/Uw8N++SxuNdDVGLSgrXzt9kyi830K2/jVhDK/8ij wF9G7CH+fTatHA2O/yseIzYcmwx8klQAJQZ/HCigjBkrVJJQrabeBXtTyb8NlrUylOCGxWDuUo/dc r3orEBP5IaJ3QpnE6Un9rSZF3hiowYmYvdsv0BX4gcyf3gyp17amWwxcGWEG8y1Rw1gLwe6N1mQVG 8t/vW2qDy50ApoDT8byA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1uUM-003stD-6e; Thu, 16 Jun 2022 18:45:06 +0000 Received: from out2.migadu.com ([188.165.223.204]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1uUI-003srN-FI for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2022 18:45:03 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_114502_693112_0D38753D X-CRM114-Status: UNSURE ( 4.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org June 16, 2022 11:48 AM, "David Laight" wrote: > No wonder I was confused. > It's not surprising the compiler optimises it all away. > > It doesn't seem right to be 'abusing' WRITE_ONCE() here. > Just adding barrier() should be enough and much more descriptive. I had the same thought, although I do not believe barrier() is sufficient on its own. barrier_data() with a pointer to uc passed through is required to keep clang from eliminating the dead store. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel