Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp888041rwd; Sat, 20 May 2023 08:24:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7spXe1/ZbNsudi8N1P2uP95BYyt/pMg95j28PMun8E2u+gEBiG3LQ0FVZYZaV85L1gG1tE X-Received: by 2002:a17:902:f7d6:b0:19d:20a:a219 with SMTP id h22-20020a170902f7d600b0019d020aa219mr5574734plw.66.1684596297305; Sat, 20 May 2023 08:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684596297; cv=none; d=google.com; s=arc-20160816; b=JZTrbBAxa9rVGRPcZ70/tO/HsD5198wDBSJfu+UxULQ82SWvwAirAKB7WQkEleidLE DzooO3fclmxLxmlSwcb5cTIJEysJrtTxJ+yW0wfSdgRWU28lu0TWuy68KnVMmde8dswz TAe1JylMGbtkiPNyvH2rniLtjiw/5jPNcZWcOWTHyke8jHLqFkljcT4GNsa3UAzrwoQa Ms/I2QWLUzNKVYF0TtIboMr0B/BTcRtaJyrXfnX+O4l5ctwtVIuHZD0F79faL9r+14Os rsjlvD7lY5Cwp2G66JEHFUk7vYJBUu7y6hyqj+NYnesTZlFjUjQKXx0SfemWs1OxRW65 IaKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=aa3hX/fA0kw3zAvbLHpth1nKSHzqiH1/xoeSyjYa+44=; b=AvD2L9YGCtDBPOgU1EF9b/YAlgKIEyFy1Nj7EJoL849HGEyu/3RUEqttdSIjpUK2mx Hl/dzytL08k4k1nMK0fGV8nWKlYTkPiShhczutjMUFl60kvnkWI5TajzoSD8b538qHWj L2B2TCwlFqWPiyLTZxS5C0dCAt58qEybz6rm5EWHGpRa2Fg83KCDszKL+JfhfR271m1M nCF6of6pnQA2HPzMHmFx5Ys5wmk1IWmXrwviOdEkgJyLcX0d0oMnaMNYtD/8BeV86s0C rfZZP1a/7YAZgXm3rStz3spt6Ia7tXW9WLhdxfuFbvv1JS7zDTE4gqf3YIQZSId1ahX/ fIWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=DjVIQbEE; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=wtHrGm2x; 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 h1-20020a170902f54100b001a95c413f7csi1609278plf.550.2023.05.20.08.24.45; Sat, 20 May 2023 08:24:57 -0700 (PDT) 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; dkim=pass header.i=@arndb.de header.s=fm3 header.b=DjVIQbEE; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=wtHrGm2x; 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 S231731AbjETPOK (ORCPT + 99 others); Sat, 20 May 2023 11:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjETPOI (ORCPT ); Sat, 20 May 2023 11:14:08 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E48E115; Sat, 20 May 2023 08:14:01 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 007223200943; Sat, 20 May 2023 11:13:56 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Sat, 20 May 2023 11:13:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1684595636; x=1684682036; bh=aa 3hX/fA0kw3zAvbLHpth1nKSHzqiH1/xoeSyjYa+44=; b=DjVIQbEEzF8gzFujZJ Ja8RZc6CYm7LRcuMbwXywCoX5IxQGZQDHzllM9s9KoZWL8NCgytF5HXZPayWcyH+ h6hymDfvSRrP75/PknwFAMEELiXgtHlspEubEPRo8vxqJUoQ78ckzWD3FQHdcHMx HCNA1qpmTkWeJhWihk51TrrgSj+NUnC8w9AjsYrhRMKlGdflD1n7fzKeJifEEtPU OxjeHO/lRhIzi9L5CwE5YQlfNvWOGAv/ISoaQWaGVzNzPdgAJ34xkBm1O+eYV9Zw BL8N0CR/OP7eqpwHvJA8xLzurZmeE9h5W77AZ7fvslx7th7pQxFt9e4T/BHBHFNu L+rQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1684595636; x=1684682036; bh=aa3hX/fA0kw3z AvbLHpth1nKSHzqiH1/xoeSyjYa+44=; b=wtHrGm2xnbhXmTeF6BUoqV5Cn2tCC GkLrDXRIjQQ2J0vNbzWLjHmX7v0huaQy4Jw6IBySxuCpdyqxiZmSFmR73dA+y9Em g3ZkAoXcL1JPGVXfC8cHIzCCo1Pqz+eO8UiuyBOBzBJHCNlGX3II3Uio5IcPpI9L 61aYN6OJj9rnTXWEGSDbtlMBSJrfUrNjs5baol3TkOJMoS3HUXd8G2MiPkcTEBal zJ9t9BuvMzS061gF7ZwnaBmAMXCq0egpYUP2JnlAaIUshDx/xuEaAejpRkAD0K9A hwkpPv3snDnn1OyAVnAs4DYSwRLUo3gvZsSrdHPG4pjoNcfiIlJ3Ri+kw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeijedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B469DB60089; Sat, 20 May 2023 11:13:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-431-g1d6a3ebb56-fm-20230511.001-g1d6a3ebb Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230519195135.79600-1-jiaxun.yang@flygoat.com> Date: Sat, 20 May 2023 17:13:35 +0200 From: "Arnd Bergmann" To: "Maciej W. Rozycki" Cc: "Jiaxun Yang" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, "Thomas Bogendoerfer" , Linux-Arch , "Baoquan He" , "Huacai Chen" Subject: Re: [PATCH v4] mips: add including Content-Type: text/plain X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,URIBL_BLOCKED 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 Sat, May 20, 2023, at 16:45, Maciej W. Rozycki wrote: > if (sizeof(type) != sizeof(u64) || sizeof(u64) == sizeof(long)) \ > *__mem = __val; \ > else if (cpu_has_64bits) { \ > unsigned long __flags; \ > type __tmp; \ > \ > if (irq) \ > local_irq_save(__flags); \ > __asm__ __volatile__( \ > ".set push" "\t\t# __writeq""\n\t" \ > ".set arch=r4000" "\n\t" \ > "dsll32 %L0, %L0, 0" "\n\t" \ > "dsrl32 %L0, %L0, 0" "\n\t" \ > "dsll32 %M0, %M0, 0" "\n\t" \ > "or %L0, %L0, %M0" "\n\t" \ > "sd %L0, %2" "\n\t" \ > ".set pop" "\n" \ > : "=r" (__tmp) \ > : "0" (__val), "m" (*__mem)); \ > if (irq) \ > local_irq_restore(__flags); \ > } else \ > BUG(); \ > > etc. so we don't actually lose atomicity, because we always use 64-bit > operations (SD above, store-doubleword) and we BUG if they are not there > (i.e. with 32-bit hardware; not a build-time check as in principle the > same 32-bit kernel image ought to run just fine both on 32-bit and 64-bit > hardware). A few MIPS platforms do use them, e.g. SB1250, which requires > 64-bit unswapped accesses to SoC registers. Ok, makes sense. Arnd