Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2919708iob; Sun, 1 May 2022 01:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDoouV+4vxQkWUwRI9NR0rZlgwqT4WksSMsr5ANUu4K8kXdDp1I5BU7qBAaO59nH0vL+Ad X-Received: by 2002:a19:ad08:0:b0:46b:ae4d:2861 with SMTP id t8-20020a19ad08000000b0046bae4d2861mr5337789lfc.228.1651392988877; Sun, 01 May 2022 01:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651392988; cv=none; d=google.com; s=arc-20160816; b=IGgzxYWxd8ZHMcXzl8rG7yeu+/LbptDfpA52fXzCapZOfqwSn2/jcvkrtdtoArIZ+W Cnds7+XlkL2xpZkMYX/AIWrThkJgCNWopsoWfJqBSr4JYxaFs5rJECyC2txHhViWclJp 0tK3OKSlVsIBclmSdmqSJXCWJQ4FAf9BPHeOLpvpoLJRY1rkMhK3SUPUGANZ9znJ52Jj AfTc7wtCGHcWXEJjzZmr6QSO+d+nq0m5E974E8hwGi+JnD7DhFSSMfJMIa6301Kvmw6i xdWpCXfX9ro76RiChbEJb9Fcj/Y3pnBY9TTla9Q4yN1VNQZj80VhB7JNZ6/tFLymkum8 Hbgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=zI+9j94q19l63yFihh0+ZsjTI2C5NOx2hP5jr2k4x9k=; b=K2qewEjkxKmvj5lOFaGTcLebCfc2ysCbhIXFt+cnxoJpjRwMY2b5d/PhQZwxE5IA/6 NzqM8FajrkS8mH0aH4BWdLzcVrU//Ug9nhKJEhQ86B7tbv7UXzUAvu585kq51QSRZczR 1h4wD95tcG21iCajKHH3lwpHaeE5fu64ctGAPC8SlH0baVi1+m3I4cZdnvD5LKdOZ8xx MHIwovqBwnSF0VRQZVe8PzFY5EkvcHIz7ddYL0H57/KKXHaXFg52hetqUEScMVtBkpyK +PrfqVzUv0vNOvNl2s3FYUxsy7TF6u7XsfWjTXW9QFCGUzAsY169y40e+f9OZy5gPQ5e COQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WK6kihR8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a0565120c0400b0047212c4cb5fsi13437065lfu.161.2022.05.01.01.16.01; Sun, 01 May 2022 01:16:28 -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=@gmail.com header.s=20210112 header.b=WK6kihR8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351218AbiD1Sq3 (ORCPT + 99 others); Thu, 28 Apr 2022 14:46:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348158AbiD1Sq2 (ORCPT ); Thu, 28 Apr 2022 14:46:28 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1187ABF511; Thu, 28 Apr 2022 11:43:12 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id y21so6549194edo.2; Thu, 28 Apr 2022 11:43:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zI+9j94q19l63yFihh0+ZsjTI2C5NOx2hP5jr2k4x9k=; b=WK6kihR8b3wSbEull4x65571g240iY3fBAfiTXsaZDlpj/xdgiElV/P43tUu9yXSVX hWkKZvrStyCqJIayhO18QI89R8AHdCsLMnVVefiMboCPUg9jwW8UI371XTLloEYzpnBa B0GUhQiLmGId/z5djVFsZ7AFAUgOKJDiPHULAklgepOzju10xb0RTX4BA1BeUnJ/S377 TjafnXdVqpgpA3pC8zc1MJup7/P2VeO9LxoimierGf1yWwgM8XqY65KnT+hRZSeagjyb oxpyI9c1YV+pNkCdzr9uu3mIs5PfLCToQJgYckJ8Hywf72cLHHacgZsutwe5E7PxhHXF hUSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=zI+9j94q19l63yFihh0+ZsjTI2C5NOx2hP5jr2k4x9k=; b=6rwKrNuSL0XXu0nYcWhXHUxkiJdS2bOd1jVGDf3qfKXkJZAt1lr0w5qDT1PZgbv8M2 z5nwnb92MWy6YKsBRTRFUgit321njLjbuC4dIX+ae9rCQM0jMvzlqJKMi7t1PeTayKwr O5pRZHw+PObWpVMNA3M+9A79AVUoIMs6ffCtCaNsAhaRMJ6J/pXcyu19RBc5FOROfCPX Ivg2olImHdHjHoMnYxXK9mllPBsZ2ukYuoIzklOLR6xIbUIPbRHoJ/IiOLCIrzcR6YpY TCLKTz/EkaR0+vb9jRLIjeTcByibZsIez7LeSMOUplorU2uEHrEaZL6AJmWijEIvm6D3 RCTg== X-Gm-Message-State: AOAM533e7emqyzaBYTne6YYBnvz2WYPjTaC41HrEeAK2VNkYaBhr5D2I Jo5VXboGAbfeCWf36SRCMoY= X-Received: by 2002:aa7:d954:0:b0:425:f621:f77f with SMTP id l20-20020aa7d954000000b00425f621f77fmr18775972eds.363.1651171390413; Thu, 28 Apr 2022 11:43:10 -0700 (PDT) Received: from eldamar (c-82-192-242-114.customer.ggaweb.ch. [82.192.242.114]) by smtp.gmail.com with ESMTPSA id v17-20020a1709060b5100b006f38cf075cbsm273241ejg.104.2022.04.28.11.43.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 11:43:09 -0700 (PDT) Sender: Salvatore Bonaccorso Date: Thu, 28 Apr 2022 20:43:07 +0200 From: Salvatore Bonaccorso To: Thomas Gleixner Cc: Jeremi Piotrowski , 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 , Noah Meyerhans Subject: Re: [tip: irq/urgent] PCI/MSI: Mask MSI-X vectors only on success Message-ID: References: <20211210161025.3287927-1-sr@denx.de> <163948488617.23020.3934435568065766936.tip-bot2@tip-bot2> <43418c23-5efd-4d14-706f-f536c504b75a@denx.de> <87v8uuwhs4.ffs@tglx> <87wnf9uxnw.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wnf9uxnw.ffs@tglx> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 Hi Thomas, On Thu, Apr 28, 2022 at 03:48:03PM +0200, Thomas Gleixner wrote: > 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. Thank you. We are having Noah Meyerhans now testing the patch and he will report back if it works (Cc'ed here now). Regards, Salvatore