From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5196CC433FE for ; Wed, 27 Oct 2021 15:28:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35D5C60E0B for ; Wed, 27 Oct 2021 15:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242742AbhJ0PbD (ORCPT ); Wed, 27 Oct 2021 11:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237703AbhJ0PbB (ORCPT ); Wed, 27 Oct 2021 11:31:01 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECCD4C061767 for ; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id k26so3066504pfi.5 for ; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=IXIkAF60iwH8Ca28unKtkkjCxMxH4jsRE7rdlyRpHRKxqRH5DKvzKzXeE1xZpeP67E xwOJxCxtNAW/vuRZ9/cA++xLC0bu82EJesdjjIouYVg3x2VESqFJeksK7bKKBVif038n GNlri9Hc+F1u7CW4lPLn9JPRn52da4aBC4xsr93HTbSLq1yGzKbznkaiM+WfpWPTb1nX 8Hjyo7QQx66GQF0REMEMDncs7WF5cqEgNENljeKIdAyawTn2njGp/q6Q7uPOzyYDFpEX mqf5isD4pvLAp694w88H9zUwbgY74QXFwiejeE2dZlhZt757K0HlOnfUIVAivKet6eGr 4Dpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=LqutRHrMVnFeSGGxdSTT8T5qjob7KU5wE5DZ5a7xgWqJzRFv1Wyu1IoVA7bum7++I0 wir93RCv+K1+6/CLCGkFambiCvQ+6BQ+Af5GfHoe2QDWGJUyWHzc9VYQEP/kev/QCAbe Rt/Oi2gP6UHblpB4njUnUmJMuSOmL1jmAyOLkUUOX6N/S/v8VXRCsgcr7O9EikgNJj+J Ab2Vkjs33kfLldV4xP15zbJB2yaq979OLrCXl7l6u6b0MfPufXkZcjJeJFqUC+sm0dR0 ywfQEeu/S+tb9oxyL9CRJWpDWQU0Ua/pjS3fEg7lWrrOwFots488hpy+VWpuEKTnJRpu jKrQ== X-Gm-Message-State: AOAM532M/Q5iRe5jquGDN1c3ktOjJ+LksmgAGtoSpC7+ORyRj1fIut4r ijY1bQkaHhx4521qMG6lfedfIw== X-Google-Smtp-Source: ABdhPJxibfpJFn220g32tVsxXXYwD2JThHpi8b5HJLrZMbbjn5Hu0UDQk4ZV4kEcRQbC7q9gao3DeQ== X-Received: by 2002:a05:6a00:2405:b0:44c:1ec3:8dbe with SMTP id z5-20020a056a00240500b0044c1ec38dbemr33619608pfh.33.1635348515143; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y19sm340714pfn.23.2021.10.27.08.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 08:28:34 -0700 (PDT) Date: Wed, 27 Oct 2021 15:28:31 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang Subject: Re: [PATCH v2 00/43] KVM: Halt-polling and x86 APICv overhaul Message-ID: References: <20211009021236.4122790-1-seanjc@google.com> <614858dd-106c-64cc-04bc-f1887b2054d1@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021, Paolo Bonzini wrote: > On 27/10/21 16:41, Sean Christopherson wrote: > > The other thing I don't like about having the WARN in the loop is that it suggests > > that something other than the vCPU can modify the NDST and SN fields, which is > > wrong and confusing (for me). > > Yeah, I can agree with that. Can you add it in a comment above the cmpxchg > loop, it can be as simple as > > /* The processor can set ON concurrently. */ > > when you respin patch 21 and the rest of the series? I can definitely add a comment, but I think that comment is incorrect. AIUI, the CPU is the one thing in the system that _doesn't_ set ON, at least not without IPI virtualization (haven't read that spec yet). KVM (software) sets it when emulating IPIs, and the IOMMU (hardware) sets it for "real" posted interrupts, but the CPU (sans IPI virtualization) only clears ON when processing an IRQ on the notification vector. So something like this? /* ON can be set concurrently by a different vCPU or by hardware. */ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27A1FC433EF for ; Wed, 27 Oct 2021 15:29:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEA6C60E0B for ; Wed, 27 Oct 2021 15:29:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DEA6C60E0B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=a97ylkDKd2MgG+Y87m4QVtX93j7bzQTblB60jbUrosA=; b=SmU6LLEAUU3dbV RzFJDw/BxpHWO9AEgMVPx9VldDunDGlZyfAoYyxod63HFLoBNTy4d/NsGXQZRkhXHp6H9V5fYsyT0 6w996cCnReIey7ArOV6/+qm6Nls7mMTn5qJycqUVoknBn+5LdWbJSOu0R+TE23UEe8hQ0OiZ27TjU iU2IhYl2Yu5j3ExsFAhOaTM23IeCyuFIHYhicJBjprWWtdUeZgCFRB3F0SWA0xajepnmiqF1OPsXS f8rHxuSY5jRkrLF9CbtXtCYGHOH09h2QhWZ4CkjRcgxSbYM4DlZbZkE3svERLm5XURZR9OMbWmU9q 2PkkDG+kt1Z+ve2ZTqfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfkrD-005JcZ-2C; Wed, 27 Oct 2021 15:28:51 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfkr0-005JZh-EA for linux-riscv@lists.infradead.org; Wed, 27 Oct 2021 15:28:40 +0000 Received: by mail-pg1-x536.google.com with SMTP id f5so3225163pgc.12 for ; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=IXIkAF60iwH8Ca28unKtkkjCxMxH4jsRE7rdlyRpHRKxqRH5DKvzKzXeE1xZpeP67E xwOJxCxtNAW/vuRZ9/cA++xLC0bu82EJesdjjIouYVg3x2VESqFJeksK7bKKBVif038n GNlri9Hc+F1u7CW4lPLn9JPRn52da4aBC4xsr93HTbSLq1yGzKbznkaiM+WfpWPTb1nX 8Hjyo7QQx66GQF0REMEMDncs7WF5cqEgNENljeKIdAyawTn2njGp/q6Q7uPOzyYDFpEX mqf5isD4pvLAp694w88H9zUwbgY74QXFwiejeE2dZlhZt757K0HlOnfUIVAivKet6eGr 4Dpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=e5+iydfoOLbYHBpLgxGObTl+QwX3/u9rKmW5PGUgWuMHWgzD+688kwaLOwDJw7XbN6 Wc5bI8NjU5/Dz6XFhkKgIjNTwT1Q67/2IR8iCVeXEH894aS+bF2jAFo4TQbOfEwrxfoa rpXhtit7+grW7T96Eln75cpqftBKQlEsJWPqEwXeASWES+XXVrMuCGk36SSgzAcE/U9X CxtumWpcGk6EpCh1qMWLKEv6I5Ka/F/VDKu5lV+Jl05X1oCuhVTe0N0p6IIN0/5djpTD f/PrHfVI++hIx+9/g76NbWkzBMNIStauIUcHP5bf7cePH9GLgDTONxK+ZGOm7iP7CLZD lKgw== X-Gm-Message-State: AOAM531M1zSOtbA3iEDHRFZT94Ax7Ppq21D2NnZyFVP41DzP/rCiQHlj xDklq2Qy45aaqZUX2mVTUjlixQ== X-Google-Smtp-Source: ABdhPJxibfpJFn220g32tVsxXXYwD2JThHpi8b5HJLrZMbbjn5Hu0UDQk4ZV4kEcRQbC7q9gao3DeQ== X-Received: by 2002:a05:6a00:2405:b0:44c:1ec3:8dbe with SMTP id z5-20020a056a00240500b0044c1ec38dbemr33619608pfh.33.1635348515143; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y19sm340714pfn.23.2021.10.27.08.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 08:28:34 -0700 (PDT) Date: Wed, 27 Oct 2021 15:28:31 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang Subject: Re: [PATCH v2 00/43] KVM: Halt-polling and x86 APICv overhaul Message-ID: References: <20211009021236.4122790-1-seanjc@google.com> <614858dd-106c-64cc-04bc-f1887b2054d1@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211027_082838_517112_F2D64046 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Oct 27, 2021, Paolo Bonzini wrote: > On 27/10/21 16:41, Sean Christopherson wrote: > > The other thing I don't like about having the WARN in the loop is that it suggests > > that something other than the vCPU can modify the NDST and SN fields, which is > > wrong and confusing (for me). > > Yeah, I can agree with that. Can you add it in a comment above the cmpxchg > loop, it can be as simple as > > /* The processor can set ON concurrently. */ > > when you respin patch 21 and the rest of the series? I can definitely add a comment, but I think that comment is incorrect. AIUI, the CPU is the one thing in the system that _doesn't_ set ON, at least not without IPI virtualization (haven't read that spec yet). KVM (software) sets it when emulating IPIs, and the IOMMU (hardware) sets it for "real" posted interrupts, but the CPU (sans IPI virtualization) only clears ON when processing an IRQ on the notification vector. So something like this? /* ON can be set concurrently by a different vCPU or by hardware. */ _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBC08C433EF for ; Wed, 27 Oct 2021 15:28:41 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 706A5610C8 for ; Wed, 27 Oct 2021 15:28:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 706A5610C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F10284B0C0; Wed, 27 Oct 2021 11:28:40 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UleLDu7YPSbc; Wed, 27 Oct 2021 11:28:39 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 328D34B161; Wed, 27 Oct 2021 11:28:39 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B95874B136 for ; Wed, 27 Oct 2021 11:28:37 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KGyodbZBfrcV for ; Wed, 27 Oct 2021 11:28:36 -0400 (EDT) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 33F424B0F4 for ; Wed, 27 Oct 2021 11:28:36 -0400 (EDT) Received: by mail-pg1-f172.google.com with SMTP id r2so3230333pgl.10 for ; Wed, 27 Oct 2021 08:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=IXIkAF60iwH8Ca28unKtkkjCxMxH4jsRE7rdlyRpHRKxqRH5DKvzKzXeE1xZpeP67E xwOJxCxtNAW/vuRZ9/cA++xLC0bu82EJesdjjIouYVg3x2VESqFJeksK7bKKBVif038n GNlri9Hc+F1u7CW4lPLn9JPRn52da4aBC4xsr93HTbSLq1yGzKbznkaiM+WfpWPTb1nX 8Hjyo7QQx66GQF0REMEMDncs7WF5cqEgNENljeKIdAyawTn2njGp/q6Q7uPOzyYDFpEX mqf5isD4pvLAp694w88H9zUwbgY74QXFwiejeE2dZlhZt757K0HlOnfUIVAivKet6eGr 4Dpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=pInBTfZnRMr8tAU5KUuQnihjJlLO6PXdZPQ+hzhZ74s2YnqvlsCJMLMaetPd4KYAfe WhP+VQEhyH5xWsDfoAUanEJomCRNnu3JHB3FSoha9hQmRMs6vdnjwgTJ8vQK8j6xG0N4 uWpGw2u3bqWFQ0KHeXAYbLVlZDlWO68a8JLL3kN9+TQvxpUPDkzg+ffcdoZqyVB8XRzn CIWPlPU3QiotF/hSVKHwL5rB4ghn3vpCiftBD0bNVudS/CXzsID5Bc7wBFu7EoIRmb7D ebmdN+axnOqQwUHnL++zXr6VE1H7OZ4vU7DCQwOzfftKM7GDceO0LXbtIeSMhWyEHNAz PGZQ== X-Gm-Message-State: AOAM533DYTXqFtBE5A4Oa2Z0F+0XBel2c/oI8TKTnzI9w9LMP6ZgojlE OcR7ixHp4TLV2/J6QK5A8SBmnQ== X-Google-Smtp-Source: ABdhPJxibfpJFn220g32tVsxXXYwD2JThHpi8b5HJLrZMbbjn5Hu0UDQk4ZV4kEcRQbC7q9gao3DeQ== X-Received: by 2002:a05:6a00:2405:b0:44c:1ec3:8dbe with SMTP id z5-20020a056a00240500b0044c1ec38dbemr33619608pfh.33.1635348515143; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y19sm340714pfn.23.2021.10.27.08.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 08:28:34 -0700 (PDT) Date: Wed, 27 Oct 2021 15:28:31 +0000 From: Sean Christopherson To: Paolo Bonzini Subject: Re: [PATCH v2 00/43] KVM: Halt-polling and x86 APICv overhaul Message-ID: References: <20211009021236.4122790-1-seanjc@google.com> <614858dd-106c-64cc-04bc-f1887b2054d1@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: Cornelia Huck , Wanpeng Li , kvm@vger.kernel.org, David Hildenbrand , linux-kernel@vger.kernel.org, Paul Mackerras , Atish Patra , linux-riscv@lists.infradead.org, Claudio Imbrenda , kvmarm@lists.cs.columbia.edu, Janosch Frank , Marc Zyngier , Joerg Roedel , Huacai Chen , Christian Borntraeger , Aleksandar Markovic , Albert Ou , kvm-ppc@vger.kernel.org, Paul Walmsley , David Matlack , linux-arm-kernel@lists.infradead.org, Jim Mattson , Anup Patel , linux-mips@vger.kernel.org, Palmer Dabbelt , kvm-riscv@lists.infradead.org, Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Wed, Oct 27, 2021, Paolo Bonzini wrote: > On 27/10/21 16:41, Sean Christopherson wrote: > > The other thing I don't like about having the WARN in the loop is that it suggests > > that something other than the vCPU can modify the NDST and SN fields, which is > > wrong and confusing (for me). > > Yeah, I can agree with that. Can you add it in a comment above the cmpxchg > loop, it can be as simple as > > /* The processor can set ON concurrently. */ > > when you respin patch 21 and the rest of the series? I can definitely add a comment, but I think that comment is incorrect. AIUI, the CPU is the one thing in the system that _doesn't_ set ON, at least not without IPI virtualization (haven't read that spec yet). KVM (software) sets it when emulating IPIs, and the IOMMU (hardware) sets it for "real" posted interrupts, but the CPU (sans IPI virtualization) only clears ON when processing an IRQ on the notification vector. So something like this? /* ON can be set concurrently by a different vCPU or by hardware. */ _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41664C433EF for ; Wed, 27 Oct 2021 15:29:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1036760E0B for ; Wed, 27 Oct 2021 15:29:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1036760E0B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aohfJpAl3SzpKeqUbUQIDlaX4ZmU3Smw9XsqPe3KhDM=; b=INwEkQB3KUReJA Fj/fQ/5hEe4l6HQyeG05XapfCc7+Z15xZMen200dTQ8fRvkt22en9Fi4sovr6snBPRY2MhE0otlBB TO6+DYgiJ2jClHhZRblBY0X3ADKxpFq8hlUOpg8Ju0BUvcCG5fwxabbxM2Xnm+wr+ohaolf7MccOg 1Z+5pHxp4+iOshWcvP/rIiZSEhsfr8qN3wK6IwHxg7lyizJvnkLsvkxMWf36VhKPlm1hAxYkoPGQK dbHGZYKlOwZ4+2RKySEG5yPBHvtkrSO6bA9COxg8e9nNjk04sZXGrXGBnvGyUK5ZzHWtJ18l7+gkb pIGaXYLllUW9CbG89wag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfkr4-005JbT-2I; Wed, 27 Oct 2021 15:28:42 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfkr0-005JZi-E0 for linux-arm-kernel@lists.infradead.org; Wed, 27 Oct 2021 15:28:39 +0000 Received: by mail-pg1-x52f.google.com with SMTP id q187so3294667pgq.2 for ; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=IXIkAF60iwH8Ca28unKtkkjCxMxH4jsRE7rdlyRpHRKxqRH5DKvzKzXeE1xZpeP67E xwOJxCxtNAW/vuRZ9/cA++xLC0bu82EJesdjjIouYVg3x2VESqFJeksK7bKKBVif038n GNlri9Hc+F1u7CW4lPLn9JPRn52da4aBC4xsr93HTbSLq1yGzKbznkaiM+WfpWPTb1nX 8Hjyo7QQx66GQF0REMEMDncs7WF5cqEgNENljeKIdAyawTn2njGp/q6Q7uPOzyYDFpEX mqf5isD4pvLAp694w88H9zUwbgY74QXFwiejeE2dZlhZt757K0HlOnfUIVAivKet6eGr 4Dpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jluBW5yA9LvugmQi8oyfDy8/cabbakiUXPqo4utsaB8=; b=CgFvuiY2Ax8eR9lZE4HNGUmAwSPZirOu1aiHVYTUg+iQ+5MKzbYZ+cpxJRJ/WOLZ7h sLh65CG7Cnwj36mbegh8kFLmrMmxjDRa7mPUT2V1xscXw5na+wWkuQ7oQAIelFYAaguk OBwex7Si1+/DLBowNoDMkn6otdZlosHFS9BzQO6deUgDds19mDV0vtCyNi47jpJ3HWqQ 1490yJzQLog3qvzvspwKamuW0zfWfc59ZvYMJMdQNp7XdFUeMXOvXqEXYLYF5AQ7Xc6q GlzRmTEv6C/7mKeb1aJ5xMbIfFFMaWzJ6Anbo+YslyGu458KErHdMtMHygkvSvBJjNbh jYgQ== X-Gm-Message-State: AOAM532zO3HtbNsFmbknG2B/NIJYlKGHFomxBHQAB5NtNk+/oi9L/BUs EJqi9YJo0ROdm1VBidpqdBsj2A== X-Google-Smtp-Source: ABdhPJxibfpJFn220g32tVsxXXYwD2JThHpi8b5HJLrZMbbjn5Hu0UDQk4ZV4kEcRQbC7q9gao3DeQ== X-Received: by 2002:a05:6a00:2405:b0:44c:1ec3:8dbe with SMTP id z5-20020a056a00240500b0044c1ec38dbemr33619608pfh.33.1635348515143; Wed, 27 Oct 2021 08:28:35 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y19sm340714pfn.23.2021.10.27.08.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 08:28:34 -0700 (PDT) Date: Wed, 27 Oct 2021 15:28:31 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang Subject: Re: [PATCH v2 00/43] KVM: Halt-polling and x86 APICv overhaul Message-ID: References: <20211009021236.4122790-1-seanjc@google.com> <614858dd-106c-64cc-04bc-f1887b2054d1@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211027_082838_511962_8AFBE7EF X-CRM114-Status: GOOD ( 15.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 27, 2021, Paolo Bonzini wrote: > On 27/10/21 16:41, Sean Christopherson wrote: > > The other thing I don't like about having the WARN in the loop is that it suggests > > that something other than the vCPU can modify the NDST and SN fields, which is > > wrong and confusing (for me). > > Yeah, I can agree with that. Can you add it in a comment above the cmpxchg > loop, it can be as simple as > > /* The processor can set ON concurrently. */ > > when you respin patch 21 and the rest of the series? I can definitely add a comment, but I think that comment is incorrect. AIUI, the CPU is the one thing in the system that _doesn't_ set ON, at least not without IPI virtualization (haven't read that spec yet). KVM (software) sets it when emulating IPIs, and the IOMMU (hardware) sets it for "real" posted interrupts, but the CPU (sans IPI virtualization) only clears ON when processing an IRQ on the notification vector. So something like this? /* ON can be set concurrently by a different vCPU or by hardware. */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel