From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C223748CD64 for ; Wed, 29 Jul 2026 13:33:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785332030; cv=none; b=oDVLBDpANuBCo6liXBsG+uI23bN/WSgvLZlkPzy+YhLc6eUgREESOopR6BDJ8f/A7vb2pbAX4VPv5+5wFAYo/XFeKqcRFZxmrvGUtyd7Rg4ZgW/wGu+DOMZL1Ed4tbqSYZkdc4s+pRKBYiKh96z7XhfYvl3nOOdPHa1D9+V34AQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785332030; c=relaxed/simple; bh=K0ygnMAFELlBdyDd/KT2teaL2TrzoS7MwyViwa4IIDQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rLWzYOs/yNTj4orhkEH73CQmhwmYdqrs9wGa6Q5uourG8q61XZt8phKrMmibTLQe01EC17yb52Fv+hoI9igAgfPHxrkJ3E7k2taqv8bNM69Le/L4BU2UPTbpRiVfsitDBGBlkt5rjWbUua40vbEWAWdin/faP8CVXOFXPllW4VQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=RUlC4an0; arc=none smtp.client-ip=209.85.210.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="RUlC4an0" Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-8488ac68185so2379562b3a.2 for ; Wed, 29 Jul 2026 06:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785332025; x=1785936825; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8cpEO4JktV/Wn0qoLGpZpmCga6uZX3snEVQEMhCVZKg=; b=RUlC4an0NK+KSk0bldd6JbuSoYyJT3L4jbBdTVeTbLujCnky/7nDw8boOCzRsgNpLe zzZTL6FUfh0zq0OlOLFwB4dQVtvslnuD9yzgzbma/RZks7Hsu3y3sAEokOmvKtGS6bYs uOYTy3bwDw/RWYSY/KtHWjw/WYDuGx1VyUsK+52N3MtzSrBw8v1+k1k1grhF9w2dPXNM vjt+w+150K5aPz/P4H8nzvzOC66+PzMrqS+bRURSmvyvKekRxv059uTODmWiKFvAV5GU 7u/iIxmtt2PuokxK8fVhUpJSE5pr95kmxvofy87t9wNLPpxAtXhDb7PQL6lLWRl2F3P7 NXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785332025; x=1785936825; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8cpEO4JktV/Wn0qoLGpZpmCga6uZX3snEVQEMhCVZKg=; b=ClCt+wrtUz2mXAJIgxWovFTOFu8tZF0itSxlhV77FQ3OcX7aFMi6giO8DdongujSjE 5p0zbEF8xXucEN4BCX+xj+hwu66aEEqnMjt9yqiiFlPivK5Jm/nPOzQkZCYHHkdYNz+6 BNO+66vH3Tx+Fm6l4X4fwWRx8Tl8qrogzwJMu9Fe9QyL2a8jkCM4L4LvPB6SghSBx2pn Tma/WFAmn9jb1jE0PukhN3ZWoxi2TBe+AaW32RWNc3OKp9fU+kBkTRDDG1ZqfV1QEAll Lo6ThF2FiiOTkxr9V0VGv3kqKRyTj5WH/1sncUsODwxPkf/lN7ArJA+uyk/UJdQvA06X bBRQ== X-Forwarded-Encrypted: i=1; AHgh+RoNh7oBEL9vKlgZiuaTxqdRBrKSxiIes/FD4sDpAe+0tiCJehTUNPLe05IqPRKPqFqPbBo6QoiOaE8oeIU=@vger.kernel.org X-Gm-Message-State: AOJu0YzdKCuDIZaeULgoJMeEXTYjSUBSTYfRjeeuDcTl5Oc5I9Oc/Psy B3gR/N+cCFNeoZnngiLTTmV4bVU4S28ToKrAVIPUDs1yyyoKjT75a29KYnMubtMHywiSWy+avrE 0NlsVZA== X-Received: from pfbjc34.prod.google.com ([2002:a05:6a00:6ca2:b0:848:4690:d658]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4fc7:b0:842:5da3:9b89 with SMTP id d2e1a72fcca58-84e932ee1f3mr7600555b3a.38.1785332024476; Wed, 29 Jul 2026 06:33:44 -0700 (PDT) Date: Wed, 29 Jul 2026 06:33:43 -0700 In-Reply-To: <99aef43760db560d32e12e99df6bf209c67260e8.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260728002236.869865-1-seanjc@google.com> <99aef43760db560d32e12e99df6bf209c67260e8.camel@intel.com> Message-ID: Subject: Re: [PATCH 0/2] KVM: x86/mmu: Use LOCK CMPXCHG to clear Accessed bits From: Sean Christopherson To: Kai Huang Cc: "pbonzini@redhat.com" , "kvm@vger.kernel.org" , "jthoughton@google.com" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" On Wed, Jul 29, 2026, Kai Huang wrote: > On Mon, 2026-07-27 at 17:22 -0700, Sean Christopherson wrote: > > I initially was planning on tweaking the FROZEN_SPTE value to make it ok to > > use LOCK AND on Accessed bits, but AFAICT there's no meaningful downside to > > using CMPXCHG. > > Maybe do both, e.g., still remove the A-bit from FROZEN_SPTE? AFAICT there's no > good reason to keep the A-bit in FROZEN_SPTE. Hmm, I'm leaning "no". Once aging uses CMPXCHG, the A-bit isn't any more or less likely to be corrupted than any other bits. And arguably, using the A-bit is "safer", because (a) it's got the same bit position on EPT and everything else, and (b) spuriously setting or clearing the bit is more likely to be benign.