Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp141119lqt; Thu, 18 Apr 2024 10:31:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWAwrNFEnDlmQKBv4cqWI4QWih17+32ZYUF/3Iop5f7p73vQc0NYI/UNPow3j7N8nZiW/6vUE3LZpqXqNP8lmNGVkQk8xGmmI+meBMbg== X-Google-Smtp-Source: AGHT+IFoTMSyW/cZ8BuDNLYVfPGPqQAgbfOppTepTiro2pdx22vJRr+pExry0tQ3uhNSffMwlXa2 X-Received: by 2002:a05:6358:d08c:b0:186:f7d:a7fa with SMTP id jc12-20020a056358d08c00b001860f7da7famr2929032rwb.17.1713461467664; Thu, 18 Apr 2024 10:31:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713461467; cv=pass; d=google.com; s=arc-20160816; b=EgQjz1ugZd5Cu30V5ClKn5eVWHu4Wiit6D88SbENfxFQWCSzVihcX4jhoLQWyLe5Vu SvnRY2nh1n8tm9F15aoL26k96dVSOSbHXFTnSl0rVee/zrtv3kfIWAqZRkuqxvW5qiJc zb5PfiC+ATgiOxBree+1j20jcyb1xpLCPmYu2fm7ynqru2vOdfW9vV9KFr11KtoSuL/h W16RmD9EwsIr34XgFez757xgN9NedS3wDkTWC2RbnBboqSFur4ymeFoj7JY71cpxb6zg 3UT5w29PI4xZYYIg6U8pLDFAesmnIxuWQm3n9fKg4/Ffu+7ns5WFZ7Rs5jdexUWjDime gGRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=n133tZXDB6Bd91GvCflFVAWL+NU2byLCtgDyzJMIL+U=; fh=bSbJnVjShRPWIbOpBIRD4whccdKonLa+AM2yHANX+Kw=; b=YvJtcskDwe0ib2Lnwygerd/GmVc7fgG/L96HJV270HX7X8zGw7aA2dsZfOzbPd5xSS zofxq49QxVbZWxxZ/2lnmFgbO1HbLMf9LMDNq+Dihoexx+ViWqPu/nb2ib3hUT22FVQ3 SeSfX9TLlBHXipUYa+qC0TotUbcCkHYYy2iLkF9OG6jhZVA0Uj4mRYe/6kab/tCuEPz7 i/rYrQJ6bqGqE0ie6iDaR85A/PGYVqMwzlePyUEGe6DROmH1XnV1RZm+3j2qnIyURm+4 Kae3/hM5kQhnyCJq8lnn6yGH95Y7dwiJYjRhtyxJuzC8D3fsmv7dIeBVE8Xiz6tVvYOG oUAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JaPzhGeU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=usvJW0EI; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-150572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v19-20020a056102331300b0047bb69df98dsi497948vsc.525.2024.04.18.10.31.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 10:31:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JaPzhGeU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=usvJW0EI; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-150572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 5938E1C21045 for ; Thu, 18 Apr 2024 17:31:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D640B174EFF; Thu, 18 Apr 2024 17:30:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JaPzhGeU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="usvJW0EI" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 EFEA0171092; Thu, 18 Apr 2024 17:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713461458; cv=none; b=ro+279j8OIsgCrQrEhjUQLmRRGZlQes7a6wRgdXLpPwgtMDRUB/1XBu9aEZ4mSTiQTZBuvIdl1MhjSth/1vuYSV1gftNWVGRX/BBmv52cr74/2Nd/bzV07q+AEpj64f1IyZEbg7OTo+H43G4frSUGgQTN8ZJ4Oqyj0vx/3uTGgA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713461458; c=relaxed/simple; bh=o01ymuKifh+K0Qu307eSX0ERloFE9BsY+DcrAJ29XVM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=t7BTdSfEhCiinMaaJgSK+cQ7E63nciFz0pJf+3wY3TQBlf/xha794iT12iT+PQx3SsVpfwCZJ08U9OIsftMm7SLeTNRHuzOT61pbP+U5pkhE0IGOReduJIy8XJgM0/9jk/ORN1CZI0rnloZLJQiHAzF6Oo9TRSubIFSFL8Y1psQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JaPzhGeU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=usvJW0EI; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713461454; 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: in-reply-to:in-reply-to:references:references; bh=n133tZXDB6Bd91GvCflFVAWL+NU2byLCtgDyzJMIL+U=; b=JaPzhGeUkDR0xJWNGEOZX6QlTvHj+laTe+Gb7LSuFrynIBfCTbrdk02GsZUHBPUa3MxyH7 Ja4MJ4n94Wesjd3qChowGdMXyBLVyaAMDZ3OduoZddQ/d4am634dGPFU4lNxcEAlIj98mL 0NbXX4yhuiMnTKA77HYiqgxXJKJ4t5IQHMSac/KT5csV6NB8Frzw++e9VD8bKNu83l8SPy Ru8PhXlzhAo/MpRAM7QnQwEyYuFHP3GVdBN7o7ktbq/dH5EbjprkQMSaRfw3RDJAx0ZJG1 bwodGvkjdU78nLkjnjYed1D6mBhcCtlJywIJA0ljhdOK6ikUpRbkvJO85Yl7jg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713461454; 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: in-reply-to:in-reply-to:references:references; bh=n133tZXDB6Bd91GvCflFVAWL+NU2byLCtgDyzJMIL+U=; b=usvJW0EICUWJjhC/qhtiJVBvvnPiIIv+LS4QdG+QAWCzmyg+6eR2HBrklesFtjER9a/45F 7OSjfw5XMeZQdJCg== To: Jacob Pan , Sean Christopherson Cc: 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, jacob.jun.pan@linux.intel.com, oliver.sang@intel.com Subject: Re: [PATCH v2 03/13] x86/irq: Remove bitfields in posted interrupt descriptor In-Reply-To: <20240417110131.4aaf1d66@jacob-builder> References: <20240405223110.1609888-1-jacob.jun.pan@linux.intel.com> <20240405223110.1609888-4-jacob.jun.pan@linux.intel.com> <20240417110131.4aaf1d66@jacob-builder> Date: Thu, 18 Apr 2024 19:30:52 +0200 Message-ID: <87wmouy3w3.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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.