Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp294279lqt; Thu, 18 Apr 2024 15:51:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1s1sBVo/gqHpuxh0NmHu/hO76M4hFRbi3ehwA5FONcksU0th0NPy0kyTkxEyZHmHaUvPWAXOnjx1XkXUOri+IcR0h/MoVTGrtzJObOQ== X-Google-Smtp-Source: AGHT+IHxjj6/dS4qd+9ryHCt8qd0BxOnAS8TSRrf5jXxRblnmDA34tZLQA5uZjnqhatQqT+84dyE X-Received: by 2002:a05:620a:956:b0:78e:e6e6:9dc8 with SMTP id w22-20020a05620a095600b0078ee6e69dc8mr597643qkw.12.1713480715608; Thu, 18 Apr 2024 15:51:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713480715; cv=pass; d=google.com; s=arc-20160816; b=uhwUyvUU4Ul1RwrJhWtzdsHi6r+RTQ+TRBY5wKgaYnzC9o1I7dWBoDWBpBmovSBzM6 aAJk6/VNGdalzbDNq1RKY3Kq+uYQmAtKX+7bOrgY/6oJtAUSMyBhrUSLPvkAZjAYvkYV qi0GQ9ZJ6GAd59KqZ0zNBZLZ/xTIze8qei/SFLz9mM5qo4CS5XiWywSfeal761iX+IbA avo0MzXDKWAZlllSgUULFore5FaTtbf8yhJqNViDv7Bjy3AmZrjr38g+NW13dEy6oMLG xtoghJvZSmPNErXsur/+ou4WlhUJ3dHCMdrToEyY5/shfX9WjAy6DpgsjFWDehp7Cv7H zMDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=7hXktYv19ejTEu5hwvclHHd8BQA6n4yOMqYlcBvl0zI=; fh=DPlu+sNsg7VuRXL4+iMuusAsRoyejKsxa9/K1gCb4Vc=; b=pOCnis9stQ/rMtd21gX5f3q9862xdO+MIhV6y+wxEK7T+RPqMDH87gjwvHwhHuG1tK cc1i4MoVWQzt+G9iHc69Cnw7dNgYe8cE8NGSJbHqkjfmjcP1YmF+YKc4uWzOZqL1mauA eFPUyX3zzyYNHT+1VJcNpegXtlQ10uEN0HYSoY82Xq4EsyFSkDKygE3aV3JDTJsYgs5i 2uqg3BcgIVQxnJRJxsZopIRMDMEhzptVy9QYcU/v1GQtw7Gm4Nya8FVDevydoK376oVI xS+togmQVNiRkull0aLHcknD2lsYHyLPZIAemNe0RX6qDXJI2BdhVTktn352s0giOfeW AY9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bRQBvS3H; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-150610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wh5-20020a05620a56c500b0078a72677be0si2503141qkn.194.2024.04.18.15.51.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 15:51:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bRQBvS3H; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-150610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 05E5A1C20DEB for ; Thu, 18 Apr 2024 18:06:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6F7917994D; Thu, 18 Apr 2024 18:05:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bRQBvS3H" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 86478175552; Thu, 18 Apr 2024 18:05:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713463552; cv=none; b=DD9KH3o9PRNUoa2zIFgtMOMqtPJvLFjJcYYSXVtu/eQfVZOwTBVuH1V+//UTMxaUpSkzzh8Zp+kpC5zTVfet3gkjHOIz0LrHAQnoEz4GyQPSky+Y3gzn0fDS0197TtLKFH9w/De8encs5DQ1a6tRtF6pTueNLGG4OIAIWr1YD6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713463552; c=relaxed/simple; bh=UHN9/iLhwy7XwyYNUPmUuZCVMwtBGVwjLhwBImjcW3k=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j8d0HhNN5tRqIX029MAVgmSysahSOus3YDuzYPc7VYge/g6/bFNrCllKerKYGUi8oTOC1T2fANSrWwNaVdKDVICi8jmxusF1ykj51jqGF9mY2WJm1Lvmh3wktrpP60416mXhg7p0zsq0TTWUhipDvqc/qOitHaxbB1PouLvSSdg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=bRQBvS3H; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713463550; x=1744999550; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UHN9/iLhwy7XwyYNUPmUuZCVMwtBGVwjLhwBImjcW3k=; b=bRQBvS3Hs/ruNvL4j2NVTMAvu+YYzFOATLj4UHty4e3z+k8VPSqa3R6d MiFNuTfRTjQP/5KoO5bVP1qoSH4PLIYB6DzHAWQ/LbDUV7BeX/vlhDWzm LceELYuhBtuNREBgLAP54XOX7XjnPwbTu/V52L84yhqjOiqhffLlgjr9+ N6G8NydpLoUnZ0uHMGPU+xCS9WGd2n9GJ9UQNSQ/7eTJqEEFawaQS054B AGhXUk5O76GIBvrca8+CIKiV/UyDHQnpWTy7cqnpL+f8BiMlCXmA3YDKL sgluorsVjOWt2qDcB5WfpGlFkSsn/77a896AsM03mmDPUtCdDQ7d4XPcR g==; X-CSE-ConnectionGUID: dUv7SPFGRbaD4zk06Eth0g== X-CSE-MsgGUID: zgEivhkdSXWaZlsJI9BJAQ== X-IronPort-AV: E=McAfee;i="6600,9927,11047"; a="11977317" X-IronPort-AV: E=Sophos;i="6.07,212,1708416000"; d="scan'208";a="11977317" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 11:05:49 -0700 X-CSE-ConnectionGUID: YaL3ncS1Su+LuCzG6gfi1A== X-CSE-MsgGUID: Y6AeD5voQ5qMqlYMs/So9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,212,1708416000"; d="scan'208";a="53990641" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.54.39.125]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 11:05:50 -0700 Date: Thu, 18 Apr 2024 11:10:24 -0700 From: Jacob Pan To: Thomas Gleixner Cc: Sean Christopherson , LKML , X86 Kernel , Peter Zijlstra , iommu@lists.linux.dev, Lu Baolu , kvm@vger.kernel.org, Dave Hansen , Joerg Roedel , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , Paul Luse , Dan Williams , Jens Axboe , Raj Ashok , Kevin Tian , maz@kernel.org, Robin Murphy , jim.harris@samsung.com, a.manzanares@samsung.com, Bjorn Helgaas , guang.zeng@intel.com, robert.hoo.linux@gmail.com, oliver.sang@intel.com, jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v2 03/13] x86/irq: Remove bitfields in posted interrupt descriptor Message-ID: <20240418111024.615aa95e@jacob-builder> In-Reply-To: <87wmouy3w3.ffs@tglx> References: <20240405223110.1609888-1-jacob.jun.pan@linux.intel.com> <20240405223110.1609888-4-jacob.jun.pan@linux.intel.com> <20240417110131.4aaf1d66@jacob-builder> <87wmouy3w3.ffs@tglx> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Thomas, On Thu, 18 Apr 2024 19:30:52 +0200, Thomas Gleixner wrote: > On Wed, Apr 17 2024 at 11:01, Jacob Pan wrote: > > On Tue, 16 Apr 2024 17:39:42 -0700, Sean Christopherson > > wrote: > >> > diff --git a/arch/x86/kvm/vmx/posted_intr.c > >> > b/arch/x86/kvm/vmx/posted_intr.c index af662312fd07..592dbb765675 > >> > 100644 --- a/arch/x86/kvm/vmx/posted_intr.c > >> > +++ b/arch/x86/kvm/vmx/posted_intr.c > >> > @@ -107,7 +107,7 @@ void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int > >> > cpu) > >> > * handle task migration (@cpu != vcpu->cpu). > >> > */ > >> > new.ndst = dest; > >> > - new.sn = 0; > >> > + new.notif_ctrl &= ~POSTED_INTR_SN; > >> > >> At the risk of creating confusing, would it make sense to add > >> double-underscore, non-atomic versions of the set/clear helpers for ON > >> and SN? > >> > >> I can't tell if that's a net positive versus open coding clear() and > >> set() here and below. > > IMHO, we can add non-atomic helpers when we have more than one user for > > each operation. > > > > I do have a stupid bug here, it should be: > > - new.notif_ctrl &= ~POSTED_INTR_SN; > > + new.notif_ctrl &= ~BIT(POSTED_INTR_SN); > > That's a perfect reason to use a proper helper. I just proved I was wrong:) will do. Thanks, Jacob