Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3320493iob; Mon, 16 May 2022 19:17:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH/5tQvsU3ohUafG011H4TvROX5GgS9CxUY7ugI+SLLoHOC9OhAveh1UpKmDim+RMbM0cZ X-Received: by 2002:aa7:cdd7:0:b0:42a:bbb2:84e5 with SMTP id h23-20020aa7cdd7000000b0042abbb284e5mr4976625edw.91.1652753863945; Mon, 16 May 2022 19:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652753863; cv=none; d=google.com; s=arc-20160816; b=tH0JkNthsWjzDJgduP/GJ63D/ZGarrBe2IbbYAH//sd7dVaYhV+x3OxIT5+xH2rB7W FJtnOknLsVZlysI/1RRtLaeH5DqnfUJ4QfDKAiTeWOriB7u2sm2XHG6/+mKLCi8n6Txz QxtLFChi/LuBEwndq1XXwtpazei5fL+fT/IO82RF0jqKNEBr3AxW7YuuDCC/bHk6p7iv X+ttTB1BWlDyKyYgn3lUss572Yp3x2ReBSMSiz37avd3pZivp495vu+mozFCmx5K1kLL xonLpt6Qnt1dk9Tuoww131FDo8hybEZQNmx7VS5jxAmM3bRF7FrwCME/rg2fSZ15+hUx 9Z1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=u8W+9QrHPo7jdPM3Bcoe/9qQ4ATKCLa3Udps7+UVOAc=; b=sFGq2oR+8FFim1vvI5BIYCI3Qq7OLUmejywXQ/Sxlzh8l6tVU9KXdiOAGKdukxc4d0 Wk6K0Ji0u8q+i0/nb9zW/4InZLav2QmV9hzT5hXIsE05cIeyA8zF/Lg7bLMo6el4GGW8 yrPyqME1K9Zh8ydVEAMvgi7OPwXGlf639R4c/8kGATiecg5tS6j+G+8NGGN3Ti6uPA+r hPXSslpa7yjKuuB4Gii+vvwg3FPjFecZWGlHix2WCDOT5MWqxpVPPBZg13ZaVjLiR/SA 0wI4ycV+Z64ecCuA8wJVHevO2aTf0xz6V6rF0yLwDSHffAOaYOm0g6A4OjC2Q7eR8HMH bqqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=a70vIt1f; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fu31-20020a170907b01f00b006efc0b0d8ebsi1012177ejc.809.2022.05.16.19.17.18; Mon, 16 May 2022 19:17:43 -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=@google.com header.s=20210112 header.b=a70vIt1f; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244283AbiEPOIR (ORCPT + 99 others); Mon, 16 May 2022 10:08:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233260AbiEPOIO (ORCPT ); Mon, 16 May 2022 10:08:14 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C5FF3A72E for ; Mon, 16 May 2022 07:08:13 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id q76so14170538pgq.10 for ; Mon, 16 May 2022 07:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=u8W+9QrHPo7jdPM3Bcoe/9qQ4ATKCLa3Udps7+UVOAc=; b=a70vIt1fKElhDJvP1TFnRL5oukRLPASFThfAiiD0oSs+ftrcbRS+O6yQGBEhqMGLHW PM76KWpc8psDzV3PWj71Mu6MevW3FA4KEc1uqRGDYHY8Ij5oAtIrBCTyI3x9c4rfC/f+ JdGhUpGE8JewAOEa23SbWg1suSLR6pgMqpT+YNk2e/XTWmUIPYJhcOuUaETTIcIw6soH pykKXejyUAgE9mbYBrYKY/5GZ94m7Ddj+AueGghoQ5jWv5nOz92UPBQLWFI0aONjbrom G+oLCsjyZ2RbZCLv6T0TobHjIZ/m6tyKAIZ7Q1LcX4O1wO+eiZCJSs4BXyeCD/X4zukB 5UIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=u8W+9QrHPo7jdPM3Bcoe/9qQ4ATKCLa3Udps7+UVOAc=; b=worzxNGuMFHp6GByOOA/71VgqKdHMn/6KlM6XSjp5alSaYf7Ft2AvpYXJ6m66iza0x INaNyTfMHwfVVXpbTJdxOOUXrr0Fzoibv6zzAPAEURgYZdBWoTAtdquxrlz+o4PQzTmG Ny7ZitvqO5I6oo97iugQwSlKK2p/mtNjOncyV7GxBh6kHaH1uXxPH4mMd5ibvDM7owiM EaaB/oH2wpcPioaQwSmE6a/xP9osXzjI2Xvxdg8qBgiTUCrNWaZCHyaD6RMJ5bRiYNHi iQn7WQB+H0hDIOHLKyhGQLsvO/56PDDrZAksvv/7FK+GA0Ux0CwoHsfDI2Z+n9tzlP5w U69g== X-Gm-Message-State: AOAM533mr5klSXlYQkqWhIKi9clXtG0SZTCyFKzbqZDcpQWIfiowWobv ni/p59Czoq2dFKay7GVUYFGQDg== X-Received: by 2002:a63:1d42:0:b0:3ed:6b3d:c52d with SMTP id d2-20020a631d42000000b003ed6b3dc52dmr10639644pgm.295.1652710092327; Mon, 16 May 2022 07:08:12 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id c1-20020a170902c2c100b0015e8d4eb2e9sm6999368pla.307.2022.05.16.07.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 07:08:11 -0700 (PDT) Date: Mon, 16 May 2022 14:08:08 +0000 From: Sean Christopherson To: Maxim Levitsky Cc: Uros Bizjak , Peter Zijlstra , X86 ML , LKML , kvm@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Will Deacon , Boqun Feng , Mark Rutland , "Paul E. McKenney" , Marco Elver Subject: Re: [PATCH] locking/atomic/x86: Introduce try_cmpxchg64 Message-ID: References: <20220510154217.5216-1-ubizjak@gmail.com> <20220510165506.GP76023@worktop.programming.kicks-ass.net> <20220511075409.GX76023@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Mon, May 16, 2022, Maxim Levitsky wrote: > On Wed, 2022-05-11 at 21:54 +0200, Uros Bizjak wrote: > > On Wed, May 11, 2022 at 6:04 PM Sean Christopherson wrote: > > > On Wed, May 11, 2022, Uros Bizjak wrote: > > > > On Wed, May 11, 2022 at 9:54 AM Peter Zijlstra wrote: > > > > > Still, does 32bit actually support that stuff? > > > > > > > > Unfortunately, it does: > > > > > > > > kvm-intel-y += vmx/vmx.o vmx/vmenter.o vmx/pmu_intel.o vmx/vmcs12.o \ > > > > vmx/evmcs.o vmx/nested.o vmx/posted_intr.o > > > > > > > > And when existing cmpxchg64 is substituted with cmpxchg, the > > > > compilation dies for 32bits with: > > > > > > ... > > > > > > > > Anyway, your patch looks about right, but I find it *really* hard to > > > > > care about 32bit code these days. > > > > > > > > Thanks, this is also my sentiment, but I hope the patch will enable > > > > better code and perhaps ease similar situation I have had elsewhere. > > > > > > IMO, if we merge this it should be solely on the benefits to 64-bit code. Yes, > > > KVM still supports 32-bit kernels, but I'm fairly certain the only people that > > > run 32-bit KVM are KVM developers. 32-bit KVM has been completely broken for > > > multiple releases at least once, maybe twice, and no one ever complained. > > > > Yes, the idea was to improve cmpxchg64 with the implementation of > > try_cmpxchg64 for 64bit targets. However, the issue with 32bit targets > > stood in the way, so the effort with 32-bit implementation was mainly > > to unblock progression for 64-bit targets. > > Would that allow tdp mmu to work on 32 bit? From a purely technical perspective, there's nothing that prevents enabling the TDP MMU on 32-bit kernels. The TDP MMU is 64-bit only to simplify the implementation and to reduce the maintenance and validation costs.