Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1766338iob; Fri, 29 Apr 2022 12:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqikFz0hU2qlpRBjGgzDPnYKEdqnyym4NI8wnNAb2xvoiaXf47v7clTd9W557ynGfaZQvw X-Received: by 2002:a17:902:ed82:b0:158:fef8:b501 with SMTP id e2-20020a170902ed8200b00158fef8b501mr544158plj.47.1651259888696; Fri, 29 Apr 2022 12:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651259888; cv=none; d=google.com; s=arc-20160816; b=or0VG25h9rO0pWkfoJwwrF4LPeHIL4jjaZT3sNUnqkbSvdlG/aJ8UfHt211WR4/xxx Yh0b2XWq+kirnHFatHp4btRE5+5/dxRZluxoe2gVrFYXWKZmCUtuxs4VBXgUMakSQ3CL /XdQHMqAcM7DLMkbXK67ao1UInAG8DphW0rSetxXYK5qGp73wKdv57fAoK9ccNhobOlt TnbezE7uZ2EOgc8UzDJ/tpRd1XxQGCItOKmQyefK9kDQenU3xLHC2mnPJNhLsbdnshyN spKmv2bAVSKiP/Q0XOWMR9Z61UkpI5dNShFF8yD9b+CTK5scRVWJvnsvs+G8r+dIDc4i H8gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=BRKdot5ttusBTKgjdBbqkbA/kf9Xlr83fTRIj0wkH84=; b=HfX7041/CDeeMNFDRMEocuUystVAxpy3RJwtEY1kkKylLXAKWQ0geSPWO4pU4wPA+j 8FtiDapQYUV6ZoQKLNw6lC4p5A90bJRT2wOicIWRUftJyeHKGgT5VD9MWZg5L6aULYv6 c3OsoVjXnxmInen8UAEmiobBpP/1/n1qG1YwQsrsnBxLjBw1lsf0pCvFDTzxm5mJKSJy acBXKKh0gBTv/JuYFIq/VnM01423uw9rpHV1K7neFwyH53I8nAS33IzhZ15rMyqDeq6b N2Pq06H+lUPEanGiOhtjYlVf3H/ApUE1r+eWbPUbMqKHjIDSVNldO7B9iR/iaj+4LJP5 M1yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TDVC34fS; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020a170902b08f00b001587856ec71si7201775plr.268.2022.04.29.12.17.47; Fri, 29 Apr 2022 12:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TDVC34fS; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347656AbiD1Nv0 (ORCPT + 99 others); Thu, 28 Apr 2022 09:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344676AbiD1NvW (ORCPT ); Thu, 28 Apr 2022 09:51:22 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C41F49C87; Thu, 28 Apr 2022 06:48:07 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651153684; 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=BRKdot5ttusBTKgjdBbqkbA/kf9Xlr83fTRIj0wkH84=; b=TDVC34fSnSPxzYcINftwPpx5/duIBp2zqhZ+Np9mWNUL0oYWvhRdoBf/AVJSgjszCnJAKk JtpIG2eGXh/BwJUdms03bJ3whjcZbsDcYN2eBeZY3OK2dOE5+DfZe7JezcpDL02cJsylP/ XREMKrt+eKlYFQ7HDhiYz41wRLWtQUanqgtU6N1RYVOCu6epwNlfRYvUYCseb0bJIe6p0U uBqhjBhwWauqzZTyd5a7ZAFXdWimCnd67tZxj36aixFyahABpZxiytU2fc7ngNCxlCmiP0 HbtJe41fB/HMZx6AlVlRgyREuJ2Ge7F5gZXpzOPwKADXmTTPVjAnu06Kj7JkOg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651153684; 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=BRKdot5ttusBTKgjdBbqkbA/kf9Xlr83fTRIj0wkH84=; b=iSex9BtdxA9VVKGTdcZeKTKYsnoSP0JqXGxVekCncx0EzMDri3nZItgkjhutaLCMDFCwLr BfAMf7EIz+w2j8Aw== To: Salvatore Bonaccorso , Jeremi Piotrowski Cc: Dusty Mabe , Stefan Roese , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Michal Simek , Marek Vasut , x86@kernel.org, maz@kernel.org, Andrew Cooper , Juergen Gross Subject: Re: [tip: irq/urgent] PCI/MSI: Mask MSI-X vectors only on success In-Reply-To: <87v8uuwhs4.ffs@tglx> References: <20211210161025.3287927-1-sr@denx.de> <163948488617.23020.3934435568065766936.tip-bot2@tip-bot2> <43418c23-5efd-4d14-706f-f536c504b75a@denx.de> <87v8uuwhs4.ffs@tglx> Date: Thu, 28 Apr 2022 15:48:03 +0200 Message-ID: <87wnf9uxnw.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 27 2022 at 19:35, Thomas Gleixner wrote: > On Wed, Apr 27 2022 at 09:59, Salvatore Bonaccorso wrote: > XEN guests do not use the common PCI mask/unmask machinery which would > unmask the interrupt on request_irq(). > > So I assume that the following happens: > > Guest Hypervisor > > msix_capabilities_init() > .... > alloc_irq() > xen_magic() -> alloc_msix_interrupt() > request_irq() > > msix_mask_all() -> trap > do_magic() > request_irq() > unmask() > xen_magic() > unmask_evtchn() -> do_more_magic() > > So I assume further that msix_mask_all() actually is able to mask the > interrupts in the hardware (ctrl word of the vector table) despite the > hypervisor having allocated and requested the interrupt already. > > Nothing in XEN_HVM handles PCI/MSI[-X] mask/unmask in the guest, so I > really have to ask why XEN_HVM does not disable PCI/MSI[-X] masking like > XEN_PV does. I can only assume the answer is voodoo... > > Maybe the XEN people have some more enlightened answers to that. So I was talking to Juergen about this and he agrees, that for the case where a XEN HVM guest uses the PIRQ/Eventchannel mechanism PCI/MSI[-X] masking should be disabled like it is done for XEN PV. Why the hypervisor grants the mask write is still mysterious, but I leave that to the folks who can master the XEN voodoo. I'll send out a patch in minute. Thanks, tglx