Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37959706rwd; Wed, 12 Jul 2023 00:38:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlHx0HF8d7vTDFE6+DwpQc18ELS25eJF9ZEHjF92g61dYxiX5A+znjekBYQzgwr77nyxQUvV X-Received: by 2002:a05:6358:27a3:b0:134:c279:c829 with SMTP id l35-20020a05635827a300b00134c279c829mr18340377rwb.18.1689147517158; Wed, 12 Jul 2023 00:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689147517; cv=none; d=google.com; s=arc-20160816; b=YJKXn/bfFW1IKwvN/Va0KkR5NmB/fIpvusZtlnXcaPfwsa8X5A+x23ZQUCGJeNXfPO vKQvNc6O0mS7p2SKxQyjiLRl1EWcPwNY9E8Kp65DQTHhUfFcnslWNKzdZvniFG2W/RMa 8E9hCuEzaQJjtr4aHCuWpMeS3UMLWDNuXTHm5r2FSdy09O/CJVn3xfgPTtveC3a1PT4c 1uuxuyMeBr+jOLxzXfgdQ3LqXgg5HEL7VwauDKS7pddjDw6oJZlGAMRBIarcYA2VM4sp 85IAO/sjN6ZrF7bjettCrKB+o8xdzsnsIXdYlZhzQETnyE+b+4iNR44/GueOS8FbNXF3 cqrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=1A9hDP1IFugJWpztXroSFXvX20mA8EGv/+jiUxuoLQg=; fh=pZaznGCCyrtFVmjyMJMJN6nkeNcYp4yVW1POo88DbvA=; b=wH1lcF2BKaBo0GNdmXKCAW3HppEzU0cDFAda7bNx9ukGXBG/E4hcDs93a/eeHoHoO/ iET9eIkq6Vc4oIcMpOJKoPWFQ2tLnC78Tfh0v+vAQhnISEW+qIqHGcScBSXLN4Yk/7XM yghLnHLw6Z3anbqBbYpPvdfaF0QOlB+PFhLoBNoAPEQsK4lMcAVzRQSIZ4sDoAtOu8RB VeoxKG45VjaMax9OQeIUSkD+ldh7wdS6mJdvrduOz3q4YwWg3xhVLSb5jl7SIYwlQzxh it4pzGdMRym0ayVCIUMZLsQOeKyzGVzQU5OtYKI26WD3XH8HkQ2fcS1M/fJ9S/5m+qaq I7Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y9Bvax+n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63104a000000b0055337cf6342si2845942pgq.332.2023.07.12.00.38.25; Wed, 12 Jul 2023 00:38:37 -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=@kernel.org header.s=k20201202 header.b=Y9Bvax+n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231981AbjGLHaS (ORCPT + 99 others); Wed, 12 Jul 2023 03:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231753AbjGLHaO (ORCPT ); Wed, 12 Jul 2023 03:30:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64368E5C; Wed, 12 Jul 2023 00:30:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E77D1616EF; Wed, 12 Jul 2023 07:29:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57B76C433C8; Wed, 12 Jul 2023 07:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689146999; bh=mYl1VBLvBZPTuNIlm4VW2kK0B//qEYUU0LdpuTrRiDQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Y9Bvax+nzWdO9RlBo2qMr9H6yyOGsbHw6ch45Q/PnVePfWmzubxuBSDT3sA6cWZOL qbkSITqIkE4RlOCPBHQLbdfzJsdz6QjAQpLVcID7L6lpv0vfg/7AotGdFzLvaKbn7Q kvTVhKjSlISqpObF5nHs/LVLRHsCMhqpd0PmZID+o4Y2AaZLsgWsYewA+I4018430k F2cJfenhUks1F5rJvcxRbxPTQ9MGns0wMVjaQ+yW5+Ve4ErpJiAF1W5hAb5nhyLW/j K2PLoYfwGnXlODU3Om/D26j8PHqn1F6SPTjY1BuvlmuHtTzjkXW8HWLSCGIpFtufN/ 1z1hLLbt+UNGQ== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qJUIN-00CMXF-VH; Wed, 12 Jul 2023 08:29:57 +0100 Date: Wed, 12 Jul 2023 08:29:33 +0100 Message-ID: <87h6q9a8pu.wl-maz@kernel.org> From: Marc Zyngier To: "Aiqun(Maria) Yu" Cc: , , , , , , , , , , Subject: Re: [PATCH] arm64: Add the arm64.nolse_atomics command line option In-Reply-To: <9e69158f-1e67-344b-fea9-85bb5e21183f@quicinc.com> References: <20230710055955.36551-1-quic_aiquny@quicinc.com> <875y6s8bwb.wl-maz@kernel.org> <32f442e3-3d5c-4cec-9791-0da039f88287@quicinc.com> <874jmc8654.wl-maz@kernel.org> <6e07ad52-2629-346e-6217-ec07777ebc5b@quicinc.com> <86lefnvsto.wl-maz@kernel.org> <8a950aa5-fdd8-f983-0411-4b39ade596f4@quicinc.com> <86cz0ywx5p.wl-maz@kernel.org> <9e69158f-1e67-344b-fea9-85bb5e21183f@quicinc.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: quic_aiquny@quicinc.com, will@kernel.org, corbet@lwn.net, catalin.marinas@arm.com, quic_pkondeti@quicinc.com, quic_kaushalk@quicinc.com, quic_satyap@quicinc.com, quic_shashim@quicinc.com, quic_songxue@quicinc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Wed, 12 Jul 2023 03:47:55 +0100, "Aiqun(Maria) Yu" wrote: > > On 7/11/2023 6:38 PM, Marc Zyngier wrote: > > On Tue, 11 Jul 2023 11:12:48 +0100, > > "Aiqun(Maria) Yu" wrote: > >> > >> For the KVM part, per my understanding, as long as the current feature > >> id being overriden, the KVM system also get the current vcpu without > >> the lse atomic feature enabled. > >> KVM vcpu will read the sys reg from host arm64_ftr_regs which is > >> already been controled by the idreg_overrides. > > > > You're completely missing the point. > > > > The guest is free to map memory as non-cacheable *and* to use LSE > > atomics even if the idregs pretend this is not available. At which > The guest also can have the current linux kernel mechanism of LSE > ATOMIC way. [snip useless diagrams] Yes, the guest can do the right thing. The guest, a totally unprivileged piece of SW, can also ignore the idregs and take the whole machine down because your HW is broken. > Just like other KVM vcpu cpu features, lse atomic can be a feature > inherit from the pysical cpu features for the KVM vcpus. See above. Your reasoning applies to a well behaved guest, which is the *wrong* way to reason about these things. M. -- Without deviation from the norm, progress is not possible.