From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 9098B1D61B7 for ; Fri, 6 Feb 2026 00:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770339567; cv=none; b=iDWyrF6326VI8aOvPG7kXFoqDgErKHPwu7CrmUun2HVumRJ1lasWvoGYjX5THrMUQlFLZpSqYcTu8bfCUQ/akTAiFti13/1ItJoAERX3zo01DLgrYdCbo+fcWJJSNpTEV/D9rcygcMp7c8D2xT0ulyXDc6LRxjzndM5jC9WT2M4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770339567; c=relaxed/simple; bh=Z22E8Z/xOghP60bXDHWrbjG32oKG5M1OjVbLTZohHJQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=nNWadEC0Rb7NVqxHeU+B2uF9ZOjSpLu9ptPtBQv4tjxeuD/UrmDohTf044d1WxAAkY70qAzTOJ+CX+IT0QF/HAmI8WdAsknqT8FIcIslhfEaXvo9F7ekO1H5X14ExpZWKGITYXm/+IqZzGsnuEjbamnyLW3AYPY8DOk02/U4e5c= 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=UCs/SgG8; arc=none smtp.client-ip=209.85.214.202 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="UCs/SgG8" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2a945ba5553so1642825ad.0 for ; Thu, 05 Feb 2026 16:59:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770339567; x=1770944367; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=a/Tid1mYhZU5lXa7L9EYLX8oTkVKGe9BZFcSs1D+TSU=; b=UCs/SgG8Ap/yPaEETn5YmJMt5b0rTtbjyB8ej7F54i7cKLIdqAN13bM8tWV02vQM7S BZgSQ7icuJreWb4qwWfIcLrmS1FLD943NHvFgbmK6p5WcByBDyf7DjnhBUnc4oygZjYs B5RAP1Ki+SX7cFlgIXULiJfttbbU2aBPrML/swcAMk3eCgXKtM6v/Lf6GBXdh3wwU5UX Ca2aIRhFg5QjZAbt//ZnVkCZvkamHYDRf/R5TjKhffmFDIKYFvpwe7j3NRQzahOrFk1I ycPEIuQf1JlqcDTedSWeI/JNxZTdh+26505JR6SFzI5GQXO68rSVhnQ3t/j/Qg6X1ZGE 210A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770339567; x=1770944367; h=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; bh=a/Tid1mYhZU5lXa7L9EYLX8oTkVKGe9BZFcSs1D+TSU=; b=rf479vQl5pwtTBOka1SXZ1/KNxbFuFyhyb4Lhq8KGlyCFR/DdDS38xGa/cFtQaDyYy WHAdaeVB5PnMztod6NWrb8DboooVCR3XlpgRXbhARPicHDt5SkAJsJBbOt8OEAs+TQ/5 bUZ6mLQJZQo6z7KyizRqjtdeI3KtbYkd6bSAbc9FGQU5jWZJp13p0XYEat2Lbx9ZxvGm b7Un8QK11+JNp0ZQ1BK7BKd7dRvabgGbIvFX/EE9CMXaKBaW5wvuVA8Ub+OeKrx/K38r 1EtDNyAsZ5Qj2sd/Yi2lgtYRAzmJdHGFqyY1qR6YcM2LaZ3S23ktYdAjlN41hUQLe0Q7 7irA== X-Forwarded-Encrypted: i=1; AJvYcCVWhkKUmdiUmcyVEA6BXHl8J4fBP4bsyOpTF9/S9s/y4dNXhoeqCTj6erg/1v/fvZzAQZJlbhBzKHXfnzw=@vger.kernel.org X-Gm-Message-State: AOJu0YwdL/Pz6vrhEMW8WYBI+oThdguPK4s8lAbFZCpJugb689h1FSWI plEdCVZmIk/LrjIX5I34kOyraiv4nXl+v6EnFRXH46EckqeW61MfYpl2qka6FdvTqoRa+lFgF7q N1SH7kw== X-Received: from plbmj7.prod.google.com ([2002:a17:903:2b87:b0:29f:25b4:4dc4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:e746:b0:2a1:3ee7:cc7a with SMTP id d9443c01a7336-2a951666792mr10607745ad.17.1770339566983; Thu, 05 Feb 2026 16:59:26 -0800 (PST) Date: Thu, 5 Feb 2026 16:59:25 -0800 In-Reply-To: <20260115011312.3675857-2-yosry.ahmed@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260115011312.3675857-1-yosry.ahmed@linux.dev> <20260115011312.3675857-2-yosry.ahmed@linux.dev> Message-ID: Subject: Re: [PATCH v4 01/26] KVM: SVM: Switch svm_copy_lbrs() to a macro From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, Jan 15, 2026, Yosry Ahmed wrote: > In preparation for using svm_copy_lbrs() with 'struct vmcb_save_area' > without a containing 'struct vmcb', and later even 'struct > vmcb_save_area_cached', make it a macro. Pull the call to > vmcb_mark_dirty() out to the callers. > > Macros are generally not preferred compared to functions, mainly due to > type-safety. However, in this case it seems like having a simple macro > copying a few fields is better than copy-pasting the same 5 lines of > code in different places. > > On the bright side, pulling vmcb_mark_dirty() calls to the callers makes > it clear that in one case, vmcb_mark_dirty() was being called on VMCB12. > It is not architecturally defined for the CPU to clear arbitrary clean > bits, and it is not needed, so drop that one call. > > Technically fixes the non-architectural behavior of setting the dirty > bit on VMCB12. Stop. Bundling. Things. Together. /shakes fist angrily I was absolutely not expecting a patch titled "KVM: SVM: Switch svm_copy_lbrs() to a macro" to end with a Fixes tag, and I was *really* not expecting it to also be Cc'd for stable. At a glance, I genuinely can't tell if you added a Fixes to scope the backport, or because of the dirty vmcb12 bits thing. First fix the dirty behavior (and probably tag it for stable to avoid creating an unnecessary backport conflict), then in a separate patch macrofy the helper. Yeah, checkpatch will "suggest" that the stable@ patch should have Fixes, but for us humans, that's _useful_ information, because it says "hey you, this is a dependency for an upcoming fix!". As written, I look at this patch and go "huh?". (and then I look at the next patch and it all makes sense).