Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2377122ybl; Thu, 9 Jan 2020 11:40:08 -0800 (PST) X-Google-Smtp-Source: APXvYqzgluwrTMUqyrvm6RD0h+sV4LIFStArUgvDisHrMp06WLCanLdrp1eSuGqfSR96wGNVudZO X-Received: by 2002:a9d:560f:: with SMTP id e15mr9844644oti.301.1578598808355; Thu, 09 Jan 2020 11:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578598808; cv=none; d=google.com; s=arc-20160816; b=AtyyUFR7fQBsFgHOYwauMVZaENpwN6jWB3UjEBXi9/stX7qXy87iXzjJ6knkWPIusy xpeYGEHa1c6hzIOJhPRJssK4RhTzfvwMNGlPpGmbXVCESdg8n+4nMN355F8+HsZ12dcg 589ITEqNYsZQc6JejCfRRzZtHiu5wOQC5gSIBi1uckDESVzDJcf7niVIVPwPHtyP3t8X sWFixXI70P8ZMhd6zOVftMfDKLj3My1YuYohPPWvrflRxJXwxXl1nfyTzP8VC/c/8SGQ weYOyTJ+kfyykSHf0kdJdQ0wv2qKmF4iYy5MusLIHdm3R7lVqnciTDtGVIvguwLhN3tQ ncFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=DS/D4BU8TS8lcmyYi9Yx8bLKi6TcZ+BDFTEZEN0u5Uk=; b=ZogRqkI8Vw2jMukvWE69xkU4p+QHyO8/WwSHSAOPRWEPnLQHOupGHoyvdFtGZUW/OX ueuxEID6GW84s04gaWWs/h9hL8x3m/0VDmqL4mwGS1ShP3epTvLfeYM39MMwRPAB41ER pge3XQqXuh9xCcFxse832eAKQU1a3ni55nRq3NS9YyMoZvgHn8VHl+EYLJnq1yyKIGUs RcrjCE7606RAMipnfs++fD5ZgKNJnm2aZWlz7WB4jt8iyffEURVDvOGDi99Oh+/I21/0 t5edPjSigXLK/sjKdILFZDi6zQmyv73XShV6exID9i19iWNjfZSnvv8fLwluZxul9bOc z6aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si4535695otj.282.2020.01.09.11.39.56; Thu, 09 Jan 2020 11:40:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733099AbgAIQGs convert rfc822-to-8bit (ORCPT + 99 others); Thu, 9 Jan 2020 11:06:48 -0500 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:36117 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729642AbgAIQGr (ORCPT ); Thu, 9 Jan 2020 11:06:47 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R471e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04446;MF=gerry@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0TnGGnLn_1578585967; Received: from 192.168.0.100(mailfrom:gerry@linux.alibaba.com fp:SMTPD_---0TnGGnLn_1578585967) by smtp.aliyun-inc.com(127.0.0.1); Fri, 10 Jan 2020 00:06:07 +0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v1 2/2] virtio-mmio: add features for virtio-mmio specification version 3 From: "Liu, Jiang" In-Reply-To: <20200105054142-mutt-send-email-mst@kernel.org> Date: Fri, 10 Jan 2020 00:06:06 +0800 Cc: Jason Wang , Zha Bin , linux-kernel@vger.kernel.org, slp@redhat.com, virtio-dev@lists.oasis-open.org, jing2.liu@intel.com, chao.p.peng@intel.com Content-Transfer-Encoding: 8BIT Message-Id: <02D38CC0-8DD5-44E1-92B2-0F9E97A112CE@linux.alibaba.com> References: <229e689d-10f1-2bfb-c393-14dfa9c78971@redhat.com> <0460F92A-3DF6-4F7A-903B-6434555577CC@linux.alibaba.com> <56703BDA-B7AE-4656-8061-85FD1A130597@linux.alibaba.com> <20200105054142-mutt-send-email-mst@kernel.org> To: "Michael S. Tsirkin" X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Jan 5, 2020, at 6:42 PM, Michael S. Tsirkin wrote: > > On Thu, Dec 26, 2019 at 09:16:19PM +0800, Liu, Jiang wrote: >>> 2) The mask and unmask control is missed >>> >>> >>>> but the extension doesn’t support 3) because >>>> we noticed that the Linux virtio subsystem doesn’t really make use of interrupt masking/unmasking. > > Linux uses masking/unmasking in order to migrate interrupts between > CPUs. This is a limitation of the PCI MSI/MSIx spec. To update the MSI/MSIx vector configuration, we need to write to msg_high/msg_low/msg_data registers. Because write to three 32-bit registers is not an atomic operation on PCI bus, so it may cause incorrect interrupt delivery if interrupt happens after writing 1 or 2 registers. When Intel remapping is enabled on x86 platforms, we don’t need to mask/unmask PCI MSI/MSIx interrupts when setting affinity. For MMIO MSI extension, we have special design to solve this race window. The flow to update MMIO MSI vector configuration is: 1) write msg_high 2) write msg_low 3) write msg_data 4) write the command register to update the vector configuration. During step 1-3, the hardware/device backend driver only caches the value written. And update the vector configuration in step 4, so it’s an atomic operation now. So mask/unmask becomes optional for MMIO MSI interrupts. > > -- > MST