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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 770BAC433EF for ; Tue, 14 Sep 2021 02:20:41 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 18056610F9 for ; Tue, 14 Sep 2021 02:20:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 18056610F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D5C16607AD; Tue, 14 Sep 2021 02:20:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XrXJMjeIzBlE; Tue, 14 Sep 2021 02:20:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 63BD36073D; Tue, 14 Sep 2021 02:20:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2B911C0011; Tue, 14 Sep 2021 02:20:39 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id AA295C000D for ; Tue, 14 Sep 2021 02:20:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8DF15402C0 for ; Tue, 14 Sep 2021 02:20:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dubb954kphS2 for ; Tue, 14 Sep 2021 02:20:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 577EC400C7 for ; Tue, 14 Sep 2021 02:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631586036; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rcYJHx/4UcJXZGKmDo86svliqJbYFIRBfH+q9c03jV8=; b=K/tQ/2mZ6iDR1Sy0/wtJtFmz9pEtYRwr03GpbyP2+q26mIhN/mtp88RYh01ddfZUTonu8R DJaWV03hkG6+r46m1BJOVPGANUALBHtAeRxp7CrqwupcCxnaIV+Bfsu2Lw8BCeWJMGKnLV BjH6S9vl9aAcbNzciYqBpaKZ1Ly78zg= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304-SmTGOHFcNgW367xWbRaQOA-1; Mon, 13 Sep 2021 22:20:34 -0400 X-MC-Unique: SmTGOHFcNgW367xWbRaQOA-1 Received: by mail-pg1-f198.google.com with SMTP id t28-20020a63461c000000b00252078b83e4so8512370pga.15 for ; Mon, 13 Sep 2021 19:20:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=rcYJHx/4UcJXZGKmDo86svliqJbYFIRBfH+q9c03jV8=; b=QoUMKO/DO6MJXaZErd7RZUF5Jj1iaSF0tb3leDcfRADxDst2QbYUm/9k3KuMlKg+mD edsYz5qVpDCCFuLcJqIjEN0bnCZYf9NiGRaCOagJnira+i80gmsDL8fcsQpPmoBwQZML Pvg9CMFpzq1fHLDtb9X2QQdpUdZ3lSXZislUjC5wV+tS5JGwcIwWQpFQztirphP8S7ep GL5IqrsTUHTN85LjJcxAp/iQUtTnCBAvlnfPUQvZ2RXFQj8JSaCcLGQGDYJHoyUSGJoy RZLo1GEqgVxgzGdbFNxcqDvi/b+hXmsI45Ascg5VzBwMg+6cYTJ6T63K7UtQwG1NmBS9 36ng== X-Gm-Message-State: AOAM532T9tQ5XpfXT0Zxb3MW2aGx8m3jLcbByDasFdTx4YVgmxQpWqni caZNEb8sOeF4VhreHsOom3ShMG7GN4bVnyloGj6tltWAPkkaTVhpbzOaef1cSkmL/mqSx4Zo8ev xnNXCWf/PHHGl667djHEVWV5gL09PWBOiKBLvBsU8RA== X-Received: by 2002:a17:902:bcc6:b0:138:d3ca:c356 with SMTP id o6-20020a170902bcc600b00138d3cac356mr12957338pls.6.1631586033277; Mon, 13 Sep 2021 19:20:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTi2t9kwRmgzAkZOi4siQl5/JqG3e4HK5NmMFCXfex3BVoLj5jj59CSw0hkzWSUkEcyY9uOw== X-Received: by 2002:a17:902:bcc6:b0:138:d3ca:c356 with SMTP id o6-20020a170902bcc600b00138d3cac356mr12957317pls.6.1631586033012; Mon, 13 Sep 2021 19:20:33 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id g3sm7944621pjm.22.2021.09.13.19.20.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 19:20:32 -0700 (PDT) Subject: Re: [PATCH 6/9] virtio_pci: harden MSI-X interrupts To: Thomas Gleixner , "Michael S. Tsirkin" References: <20210913055353.35219-1-jasowang@redhat.com> <20210913055353.35219-7-jasowang@redhat.com> <20210913015711-mutt-send-email-mst@kernel.org> <20210913022257-mutt-send-email-mst@kernel.org> <20210913023626-mutt-send-email-mst@kernel.org> <20210913024153-mutt-send-email-mst@kernel.org> <87bl4wfeq1.ffs@tglx> <20210913164934-mutt-send-email-mst@kernel.org> <87sfy8ds53.ffs@tglx> From: Jason Wang Message-ID: <98ddcf92-b0c8-77c3-d1ca-9855896a2600@redhat.com> Date: Tue, 14 Sep 2021 10:20:19 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <87sfy8ds53.ffs@tglx> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Cc: "Kuppuswamy, Sathyanarayanan" , Kuppuswamy Sathyanarayanan , "kaplan, david" , Peter Zijlstra , virtualization , James E J Bottomley , Dave Hansen , Peter H Anvin , Andi Kleen , Jonathan Corbet , Helge Deller , X86 ML , Ingo Molnar , Arnd Bergmann , Konrad Rzeszutek Wilk , "Hetzelt, Felicitas" , Tony Luck , Borislav Petkov , Andy Lutomirski , Bjorn Helgaas , Dan Williams , Richard Henderson , Thomas Bogendoerfer , Sean Christopherson , linux-kernel , pbonzini , "David S . Miller" , Kirill Shutemov X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="gbk"; Format="flowed" Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" CtTaIDIwMjEvOS8xNCDJz87nNjozMSwgVGhvbWFzIEdsZWl4bmVyINC0tcA6Cj4gT24gTW9uLCBT ZXAgMTMgMjAyMSBhdCAxNjo1NCwgTWljaGFlbCBTLiBUc2lya2luIHdyb3RlOgo+Cj4+IE9uIE1v biwgU2VwIDEzLCAyMDIxIGF0IDA5OjM4OjMwUE0gKzAyMDAsIFRob21hcyBHbGVpeG5lciB3cm90 ZToKPj4+IE9uIE1vbiwgU2VwIDEzIDIwMjEgYXQgMTU6MDcsIEphc29uIFdhbmcgd3JvdGU6Cj4+ Pj4gT24gTW9uLCBTZXAgMTMsIDIwMjEgYXQgMjo1MCBQTSBNaWNoYWVsIFMuIFRzaXJraW4gPG1z dEByZWRoYXQuY29tPiB3cm90ZToKPj4+Pj4+IEJ1dCBkb2VuJ3QgImlycSBpcyBkaXNhYmxlZCIg YmFzaWNhbGx5IG1lYW4gIndlIHRvbGQgdGhlIGh5cGVydmlzb3IKPj4+Pj4+IHRvIGRpc2FibGUg dGhlIGlycSI/ICBXaGF0IGV4dHJhY3RseSBwcmV2ZW50cyBoeXBlcnZpc29yIGZyb20KPj4+Pj4+ IHNlbmRpbmcgdGhlIGlycSBldmVuIGlmIGd1ZXN0IHRoaW5rcyBpdCBkaXNhYmxlZCBpdD8KPj4+ Pj4gTW9yZSBnZW5lcmFsbHksIGNhbid0IHdlIGZvciBleGFtcGxlIGJsb3cgYXdheSB0aGUKPj4+ Pj4gaW5kaXJfZGVzYyBhcnJheSB0aGF0IHdlIHVzZSB0byBrZWVwIHRoZSBjdHggcG9pbnRlcnM/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AgICAgdGhlIGludGVycnVwdCBhbmQgZW5zdXJlIHRo YXQgdGhlIGhhbmRsZXIgZGVuaWVzIHRvIHByb2NlZWQgYmVmb3JlCj4gICAgIHRoYXQgcG9pbnQK Pgo+IFNhbWUgc3RvcnkganVzdCBhIGRpZmZlcmVudCBtZWNoYW5pc20uCj4KPiBUaGFua3MsCj4K PiAgICAgICAgICB0Z2x4Cj4KCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fClZpcnR1YWxpemF0aW9uIG1haWxpbmcgbGlzdApWaXJ0dWFsaXphdGlvbkBsaXN0 cy5saW51eC1mb3VuZGF0aW9uLm9yZwpodHRwczovL2xpc3RzLmxpbnV4Zm91bmRhdGlvbi5vcmcv bWFpbG1hbi9saXN0aW5mby92aXJ0dWFsaXphdGlvbg== 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 X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27923C433F5 for ; Tue, 14 Sep 2021 02:20:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0ECBC60F24 for ; Tue, 14 Sep 2021 02:20:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237732AbhINCWA (ORCPT ); Mon, 13 Sep 2021 22:22:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34038 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238318AbhINCVw (ORCPT ); Mon, 13 Sep 2021 22:21:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631586035; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rcYJHx/4UcJXZGKmDo86svliqJbYFIRBfH+q9c03jV8=; b=TnHw1ihxeqPgn2RmlTE5nT5D0L/+yP+zqcvUy/6pzOtxw1vW/RD6sB3S6A6tTdqf8Xz+9G 5nOCM6wdWt6ME27C1sq+g79Phn+rHXfQwUtbxrOx1nEj74TFgxUslQP2122sl9llQzlC1F K7NanROu/3R4pJz3di0f7ivSStJhmH8= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-410-5xHKaJR1OD2fUzjbk_EB1A-1; Mon, 13 Sep 2021 22:20:34 -0400 X-MC-Unique: 5xHKaJR1OD2fUzjbk_EB1A-1 Received: by mail-pg1-f198.google.com with SMTP id h10-20020a65404a000000b00253122e62a0so8524236pgp.0 for ; Mon, 13 Sep 2021 19:20:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=rcYJHx/4UcJXZGKmDo86svliqJbYFIRBfH+q9c03jV8=; b=NKT6VLv5SGGmccAxcEZaXtDGgX+6UkOyTEM2rF25X5PwLHOPxiC8JfuoG12ujITNjz fn5QSGOzu89Eh7AxjOHn9XVXd0dggmh6SQFjnzItyUQ9K7V8jr/3kt+/H0Ph5LiIlKf4 e+gaR3cAOhXIvfeg6f6jiL73yPKsedH2NK0MGTxxJ4qLnoFcmGVfgZ3dmnJwM0GEy7b1 GnbtL8fdCav/TaFdNABG598zkew594x8w8iBLt1/L4BGv6L6qxwi5d/5lXU+VyNQK1XZ 05gSbyykHu2UPRcb/Nh184HQwSdmhivt1g2aMrrURz9GLWXL1wgB/Lg3/B8QK9pw773Y auzA== X-Gm-Message-State: AOAM5308ghRoItrUbwbfDSzkxq8+BXMdSDDuErssLooSp4FpKmme04C1 NOtr7d25HLJyHNK9PJUZt5mE2YNYOZP3CrKozXHaTsuLS4xHuKdyqdiKMc8wBtPGBl8rmxk1t2g IfnhoLTx5251whfzxWl53do2e X-Received: by 2002:a17:902:bcc6:b0:138:d3ca:c356 with SMTP id o6-20020a170902bcc600b00138d3cac356mr12957356pls.6.1631586033278; Mon, 13 Sep 2021 19:20:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTi2t9kwRmgzAkZOi4siQl5/JqG3e4HK5NmMFCXfex3BVoLj5jj59CSw0hkzWSUkEcyY9uOw== X-Received: by 2002:a17:902:bcc6:b0:138:d3ca:c356 with SMTP id o6-20020a170902bcc600b00138d3cac356mr12957317pls.6.1631586033012; Mon, 13 Sep 2021 19:20:33 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id g3sm7944621pjm.22.2021.09.13.19.20.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 19:20:32 -0700 (PDT) Subject: Re: [PATCH 6/9] virtio_pci: harden MSI-X interrupts To: Thomas Gleixner , "Michael S. Tsirkin" Cc: virtualization , linux-kernel , "Hetzelt, Felicitas" , "kaplan, david" , Konrad Rzeszutek Wilk , pbonzini , Andi Kleen , Dan Williams , "Kuppuswamy, Sathyanarayanan" , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Bjorn Helgaas , Richard Henderson , Thomas Bogendoerfer , James E J Bottomley , Helge Deller , "David S . Miller" , Arnd Bergmann , Jonathan Corbet , Peter H Anvin , Dave Hansen , Tony Luck , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , X86 ML References: <20210913055353.35219-1-jasowang@redhat.com> <20210913055353.35219-7-jasowang@redhat.com> <20210913015711-mutt-send-email-mst@kernel.org> <20210913022257-mutt-send-email-mst@kernel.org> <20210913023626-mutt-send-email-mst@kernel.org> <20210913024153-mutt-send-email-mst@kernel.org> <87bl4wfeq1.ffs@tglx> <20210913164934-mutt-send-email-mst@kernel.org> <87sfy8ds53.ffs@tglx> From: Jason Wang Message-ID: <98ddcf92-b0c8-77c3-d1ca-9855896a2600@redhat.com> Date: Tue, 14 Sep 2021 10:20:19 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <87sfy8ds53.ffs@tglx> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ÔÚ 2021/9/14 ÉÏÎç6:31, Thomas Gleixner дµÀ: > On Mon, Sep 13 2021 at 16:54, Michael S. Tsirkin wrote: > >> On Mon, Sep 13, 2021 at 09:38:30PM +0200, Thomas Gleixner wrote: >>> On Mon, Sep 13 2021 at 15:07, Jason Wang wrote: >>>> On Mon, Sep 13, 2021 at 2:50 PM Michael S. Tsirkin wrote: >>>>>> But doen't "irq is disabled" basically mean "we told the hypervisor >>>>>> to disable the irq"? What extractly prevents hypervisor from >>>>>> sending the irq even if guest thinks it disabled it? >>>>> More generally, can't we for example blow away the >>>>> indir_desc array that we use to keep the ctx pointers? >>>>> Won't that be enough? >>>> I'm not sure how it is related to the indirect descriptor but an >>>> example is that all the current driver will assume: >>>> >>>> 1) the interrupt won't be raised before virtio_device_ready() >>>> 2) the interrupt won't be raised after reset() >>> If that assumption exists, then you better keep the interrupt line >>> disabled until virtio_device_ready() has completed >> started not completed. device is allowed to send >> config interrupts right after DRIVER_OK status is set by >> virtio_device_ready. > Whatever: > > * Define the exact point from which on the driver is able to handle the > interrupt and put the enable after that point > > * Define the exact point from which on the driver is unable to handle > the interrupt and put the disable before that point Yes, this is exactly what this patch (and INTX patch) want to achieve. The driver should only able to handle the interrupt after virtio_device_ready() but before reset(). Thanks > > The above is blury. > >>> and disable it again >>> before reset() is invoked. That's a question of general robustness and >>> not really a question of trusted hypervisors and encrypted guests. >> We can do this for some MSIX interrupts, sure. Not for shared interrupts though. > See my reply to the next patch. The problem is the same: > > * Define the exact point from which on the driver is able to handle the > interrupt and allow the handler to proceed after that point > > * Define the exact point from which on the driver is unable to handle > the interrupt and ensure that the handler denies to proceed before > that point > > Same story just a different mechanism. > > Thanks, > > tglx >