From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (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 559C9212566 for ; Fri, 6 Feb 2026 01:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770341843; cv=none; b=f8ACwL/75IcNtMjfY9+nIPQBbCsR5eR68mOT9Bx5M2mv5wRYbqFPfSgoJPf7G65Rz/xud7OQzoqXKACtnzoHjSNhRwgQS4wai3xDrDLokHgGaj2PQpQSaDNQb4krUij5Bl/gFBlml3zEeyM5mYISETvZAhdih9ggTMTn/7++7gI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770341843; c=relaxed/simple; bh=3nXGFTXJKxFQ/Q/T0eJFrTLoYWSbFkYglkxnarVYjcY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=JN/AMNLKrMIoi0cz54qG6sEaq6DaJ3MAuy0fRYIQ3h4ortKgTpxKKVoldF0Zb53b17EBDHLmcBrvkdxvPhGKbW9n8uqVbYUnopjCpTlp3ZeQK2giF/YNTPVpIBArid/fjGfHeCIX1MlkIXtOtxk5ViHN10npuKUghgV39YsFN7M= 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=3aYBVZKR; arc=none smtp.client-ip=209.85.214.201 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="3aYBVZKR" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2a7b7f04a11so51332645ad.3 for ; Thu, 05 Feb 2026 17:37:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770341843; x=1770946643; 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=6HcbFAQ5ji2NXv3x3xA5R27OOd827rmNEXbIuMb23b8=; b=3aYBVZKR7VzJqljF4yZ2ixQL4c8uVCxsnCZJkm4OAg7A6jLVmLO0a5A99LF9CH/zmc sfbhDcOOB2ODTkHPiWIPuBjL02epbfixuG4MOtR/TAaXeZ5iseQokz4S0OWnechA7ry9 XfUuebWyrmQamftEzyoyCFhab57xpeF1cSVADD6zB/PeXzOl4t4ciZigfeysQvIig3RB kZVQnXSTofBHryl2TNXc3X6x87Gr2nVgCpdF5EFvJ3lLyffUkqPtYq9MXsAFfAgpnD9b GYubKDDsHeF8kQiL9HDPKi8EvEjtzpSy5cUA+TPq6sYMEYqZ4C02w4V7Cj81Xqq9Y9Wv kdEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770341843; x=1770946643; 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=6HcbFAQ5ji2NXv3x3xA5R27OOd827rmNEXbIuMb23b8=; b=fJk+yz2CITWEI+9TK9h6t6KJp1KVq++/G2KXxD8Y24+0oU/6ZKIs2b8nQv41tY9D1P xCkMWE2z8tqRXRTJHWJhnyCyFgbqHd5s0pASIfPJbeHTHGXEpySX7zaLNv2FgPJ9KXWu 0hOSI40dT1gPXgRXZ92PmuO8MVLZRVq227e+3tcACf58AshgqhZo+f+25VLFJWeiTEmy 6Zrv4Ozv3UasH+6PpELoisWhbsVXy82LtuQiXWsfx4NqRtRqmYO3kUrp+cNt54vSFQJ8 xVxQnFoRvC/SYb0U041zreH0qv8AA20G0SSbKbFgIy4gMjYT/xFoD9mq9OOcsp0O6ltL 6bng== X-Forwarded-Encrypted: i=1; AJvYcCUObfzTSKscLjwIyGfVLjUcfHiz89LYJRr0hbnJOsO2VHoniiDXhasseicwqOj5zVtm5/v1NMoCOPI8WAk=@vger.kernel.org X-Gm-Message-State: AOJu0YxpTgCz1CTf3rsq4Qj/K3m4klPJ1eDL46zwyuJBGnb4kQiLAMkV lcSVS4K0YjuT1GA4aSCd8XmZtO9SQaDXVi4958KE3qosYoSISlD1VDcoZc8h5pTUOjBkws5Cgfj QuiPIPA== X-Received: from plim1.prod.google.com ([2002:a17:903:3b41:b0:2a8:71ec:6799]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f788:b0:2a0:b02b:2114 with SMTP id d9443c01a7336-2a9516754e5mr12308075ad.11.1770341842775; Thu, 05 Feb 2026 17:37:22 -0800 (PST) Date: Thu, 5 Feb 2026 17:37:21 -0800 In-Reply-To: <20260115011312.3675857-23-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-23-yosry.ahmed@linux.dev> Message-ID: Subject: Re: [PATCH v4 22/26] KVM: SVM: Use BIT() and GENMASK() for definitions in svm.h From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, Jan 15, 2026, Yosry Ahmed wrote: > Use BIT() and GENMASK() (and *_ULL() variants) to define the bitmasks in > svm.h. Oh, hey, just what I was talking about. But why is this buried as patch 22/26? AFAICT, it's got nothing to do with the rest of the series. > Opportunistically switch the definitions of AVIC_ENABLE_{SHIFT/MASK} > and X2APIC_MODE_{SHIFT/MASK}, as well as SVM_EVTINJ_VALID and > SVM_EVTINJ_VALID_ERR, such that the bitmasks are defined in the correct > order. > > No functional change intended. > > Signed-off-by: Yosry Ahmed > --- > arch/x86/include/asm/svm.h | 78 +++++++++++++++++++------------------- > 1 file changed, 39 insertions(+), 39 deletions(-) > > diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h > index 770c7aed5fa5..0bc26b2b3fd7 100644 > --- a/arch/x86/include/asm/svm.h > +++ b/arch/x86/include/asm/svm.h > @@ -189,39 +189,39 @@ struct __attribute__ ((__packed__)) vmcb_control_area { > #define V_TPR_MASK 0x0f > > #define V_IRQ_SHIFT 8 > -#define V_IRQ_MASK (1 << V_IRQ_SHIFT) > +#define V_IRQ_MASK BIT(V_IRQ_SHIFT) I vote (and if anyone disagrees, their vote doesn't count) to purge the _SHIFT and _MASK crud. There is zero reason to define the shifts. And then when we rename, I would like to try and find better names, e.g. maybe things like V_GIF and V_ENABLE_GIF_VIRTUALIZATION? Anyways, that's partly why I asked why this patch is here. If we're changing things, then I'd like to do some cleanup. But this series is already a chonker, so I'd much prefer to do any cleanup in a separate series.