From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FA5922652D for ; Fri, 6 Feb 2026 01:12:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770340370; cv=none; b=THPXyGDl9JXMRBWqDkOqdnw7znJZm1ICUBXMMJcVpHGv46J4MTf5RBYwQgX4Me2MmGt8iYugGRifaZh6SYD7qfdgzC2l+lfwEWxbOWHQGNHnn1iPRAGon/LGc+aCPbajr7YYv6BC9pJ+2bZ/yJehODk3ZrY+p1eCOOWkePsOzDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770340370; c=relaxed/simple; bh=KrvUykdzoWqc5N96BU+dGTXvtUZcMP99lptlQr+kl3o=; h=MIME-Version:Date:Content-Type:From:Message-ID:Subject:To:Cc: In-Reply-To:References; b=hV7zPfENGvTyiH3zUG/BwB31y+5blxm+Gpj86QzwMCET3e3nFQuqMWOmm0tJfz96grDKRcATtgldxiwep1ZQh7wm84T1L9bsMFJnr9xvIe9TAy/1kXFnHWbz0yahL8pAZO9sfxrDSuZ37MP4J2ooxGuMkE3zg3GkMG4VjQxsVeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ZmRfZVF5; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ZmRfZVF5" Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1770340367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JPnsENJNlvmMUEplunXnoKZyWAIlu9yV3pp07k9kFr4=; b=ZmRfZVF5YLlTB6wYynMGFnQKwEvMoYinvqVkI96oqtz1e58yj5+hl6DoRD1Zq1D/5WRuLP 7Ds6DkyC4r7fDTYTAWdtYiQXXc1Sv6ONrJq2R8044GhdQt0wDDpfttFwpY9DmkGoC2lBF4 OUw2RVRCA69cTAQ3asHXqK8koIdZ2e0= Date: Fri, 06 Feb 2026 01:12:38 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Yosry Ahmed" Message-ID: TLS-Required: No Subject: Re: [PATCH v4 01/26] KVM: SVM: Switch svm_copy_lbrs() to a macro To: "Sean Christopherson" Cc: "Paolo Bonzini" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org In-Reply-To: References: <20260115011312.3675857-1-yosry.ahmed@linux.dev> <20260115011312.3675857-2-yosry.ahmed@linux.dev> X-Migadu-Flow: FLOW_OUT February 5, 2026 at 4:59 PM, "Sean Christopherson" wr= ote: >=20 >=20On Thu, Jan 15, 2026, Yosry Ahmed wrote: >=20 >=20>=20 >=20> In preparation for using svm_copy_lbrs() with 'struct vmcb_save_are= a' > > 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. > >=20=20 >=20> Macros are generally not preferred compared to functions, mainly d= ue to > > type-safety. However, in this case it seems like having a simple mac= ro > > copying a few fields is better than copy-pasting the same 5 lines of > > code in different places. > >=20=20 >=20> 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 VMC= B12. > > It is not architecturally defined for the CPU to clear arbitrary cle= an > > bits, and it is not needed, so drop that one call. > >=20=20 >=20> Technically fixes the non-architectural behavior of setting the di= rty > > bit on VMCB12. > >=20 >=20Stop. Bundling. Things. Together. >=20 >=20/shakes fist angrily >=20 >=20I was absolutely not expecting a patch titled "KVM: SVM: Switch svm_c= opy_lbrs() > to a macro" to end with a Fixes tag, and I was *really* not expecting i= t to also > be Cc'd for stable. >=20 >=20At a glance, I genuinely can't tell if you added a Fixes to scope the= backport, > or because of the dirty vmcb12 bits thing. >=20 >=20First 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 Fixe= s, but > for us humans, that's _useful_ information, because it says "hey you, t= his 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). I agree, but fixing the dirty behavior on its own requires open-coding th= e function, then the following patch would change it to a macro and use i= t again. I was trying to minimize the noise of moving code back and forth= ..