Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3622171iob; Mon, 2 May 2022 00:56:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz645De8QfaFvxsjcHNbhiWiZmBx+sMcT8sbyaF2GiT6eFLaGYgoIrGr3xcA7EiuyOfCXW3 X-Received: by 2002:a2e:9c14:0:b0:24d:d63a:d6b with SMTP id s20-20020a2e9c14000000b0024dd63a0d6bmr7044878lji.493.1651478205989; Mon, 02 May 2022 00:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651478205; cv=none; d=google.com; s=arc-20160816; b=ZYfLzO4vW2ekLqe3DnP+YKkIgVNwbcljLtR9xT9LbGY7sxPu2yR7Azz7XuPoM3hrYm 67TrfM5+HxAp7IOt+9DTjiu+5R7C1euQyPx5mwY7AyQvWQ37ZLLC8w65+aynfmI+wawv NvfbE1yzECGBDN/mE1pA2OlYKgd7nEpqAsoe03XzSM28FDXxYrMZPsJfjs4YEz+yDMs1 eIGkqzeC2HLXeoAvRsYsCk7q4YCkvKtr3X9M+QfIl0Wjq1K5IteqCcj0iLeAGtYJniX7 OX2T2m7lYKVTGKtWHmuDKw82kSrM64ODoNtqivLU7EwwZoabrUkGI3cMDwQi2fJRqJ+6 he9A== 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=nCh6oNjAx5FSblxx+ha1zviQ3WYAVbuqIr2sZ2uR4I4=; b=rpqT3ryF8qDNd1wcWlNpTD2UV6tAzE2ZgS16pIyQooy7BeIdNpkjvr8lrybECCTB0j wD8A3c8/mzqUIXSecCNVpYStzQBinuXk/LGqPX4KqwHM2Oo7mpRb4Al7WXF96Lyum1YM ghvOYRP3mJ0cOIDgqUltmLxPIMaMrCG+208eKOqVfzoJtldjs0VWXG48cWVa4gGMR9KS 2IOd2+CPjQIxRKbQeATsSiR26Ays4xlphoiNZmyAX6/1QvU42de5eXuEqy+x/QEMbJHq A/tGDNdoo0ZB5dTWbjCRjCSZ6JnvVL895Hr1QEit5YeI6+4WXduJsLleJJPiLJHBhJXd hWbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iHgEG3Ti; 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 p9-20020a056512138900b00471fb592d3bsi14355602lfa.543.2022.05.02.00.56.08; Mon, 02 May 2022 00:56:45 -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=iHgEG3Ti; 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 S1354505AbiD2Gkz (ORCPT + 99 others); Fri, 29 Apr 2022 02:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232281AbiD2Gkw (ORCPT ); Fri, 29 Apr 2022 02:40:52 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC68B8982; Thu, 28 Apr 2022 23:37:34 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id d6so7928073ede.8; Thu, 28 Apr 2022 23:37:34 -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=nCh6oNjAx5FSblxx+ha1zviQ3WYAVbuqIr2sZ2uR4I4=; b=iHgEG3TivvCfzr52JvRgNAZju6J95yv92A2qoKNoJMXpUMbwf9Kc39zMa3n4qUnk2L A2klT0lUGRgnXnD8WbpULxdkEojyi3XscpGE+CqbZ7Bj7BnqviQXWRrDtqSxWul6LTqi 2HROOAwn1q/uNuAE6NB/pkUtTDf9G1VJhkaKy9ov4/oqylfUUZZcY6PD3h13SOMFHgqU 4zq5Cwl1Snm5q+rLMbeuNcuNULvA71Xr/XD0+/bP4bnTQLwA4CJ4P7cr0xHtsRt3isBQ cHLn1jr5cl4wTa2e0fZvGnfD44XUm7/tvaS8NvQOlZotNo9ODdaysiz7zDsD/Dok680F 286g== 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=nCh6oNjAx5FSblxx+ha1zviQ3WYAVbuqIr2sZ2uR4I4=; b=zzAKdnixOUD/0GYf6xtbsfevPKvvmNbGUj6BPC0eIqXxlPnuANtbCQrjMQJXFKh2IN hboTC5RJlBwcxDuef8uAPHrSUWMFiJMNb2caHS7AvEFVOE5kMqvVrLaAXfShDrNgBXh6 g/dQWLEzGa+qJ4YjKHnsla6fJE4WrYvT8wqnr07eBS+/52Nr0UZCRMTWqXVxZVKSv5HE J3WOyR3xPq2+cOUTueHD/v4rkPfBC398qgK3MadMpzyBArXxgCHUdPlClE6HiFIAaZSJ GGk1OJHhddhqQobqMW2eIkIQXYGYnyhq6IH0T9FWvr5Q688Qiq4MalfFudIhf5/WWqzG OpmA== X-Gm-Message-State: AOAM5312tQF4iiQTMHStPGWHymas4TXZ6mZV1OUo0bgUMvhfuzD/MHjj 448i3u4bD/LhxmcwqTW30gw= X-Received: by 2002:aa7:d9d9:0:b0:425:fcc7:d132 with SMTP id v25-20020aa7d9d9000000b00425fcc7d132mr17610649eds.89.1651214253014; Thu, 28 Apr 2022 23:37:33 -0700 (PDT) Received: from eldamar (c-82-192-242-114.customer.ggaweb.ch. [82.192.242.114]) by smtp.gmail.com with ESMTPSA id z15-20020aa7d40f000000b0042617ba63b9sm2577858edq.67.2022.04.28.23.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 23:37:31 -0700 (PDT) Sender: Salvatore Bonaccorso Date: Fri, 29 Apr 2022 08:37:30 +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: 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 08:43:10PM +0200, Salvatore Bonaccorso wrote: > 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). To confirm: Noah tested the patch on various different Xen (and other VM configurations) and works well. Regards, Salvatore