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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 71FC7C433DB for ; Thu, 14 Jan 2021 17:21:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 315E723B31 for ; Thu, 14 Jan 2021 17:21:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 315E723B31 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.67455.120426 (Exim 4.92) (envelope-from ) id 1l06Il-0002Ag-LH; Thu, 14 Jan 2021 17:20:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 67455.120426; Thu, 14 Jan 2021 17:20:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l06Il-0002AZ-IB; Thu, 14 Jan 2021 17:20:51 +0000 Received: by outflank-mailman (input) for mailman id 67455; Thu, 14 Jan 2021 17:20:50 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l06Ik-0002AU-E4 for xen-devel@lists.xenproject.org; Thu, 14 Jan 2021 17:20:50 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9bd35fe8-f134-4180-9a82-3ccb74171ea1; Thu, 14 Jan 2021 17:20:48 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9bd35fe8-f134-4180-9a82-3ccb74171ea1 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1610644848; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=SLNvqKq+3Lj2bnj8OKer46Eb5syweNtJP0iai/18Dk0=; b=R7BcRoGKaeeoatHIUfS2YBlj08rnNzLvOYET1ohs5R2MqbMz8UxiYCdd eR66sTyUWowSr1l5EsW7icFWA23L3n2NFlxCF3kFR4rfpOCNce4QQ96TS Iyo7ZSetf6lXmO9XQmkUQ9SzjzPO1bCz+N5ZClyymAaJhscGYIgK6KyP7 c=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: 9ZQPueFL5SfvnqP5fTLMVCi7LSxDQiMvNIbJCzFEdRUKPFgs7Ppr5RE1wUvZqaIBoUx8EJUeQZ qzY8n2CT4uLbaB0rcqdb2E43QYdNBqSZTsz9pbfUctv73YSaGtPGSYR8BgOHJsp45rsOenVFbo guhvRQvmS/EdNzuWtpXEaWSJ+rGkou7p+quC+YevNtkoffIEVDxqfXxrrD2639SXiAPQYeSyds BMtmUuxeh+WdmZyyIQCBJbNztS16T35QoMnlQaHcpT4G5nJXgrwNSWstzOwyDnLBcbNuT2Y6/P 7D8= X-SBRS: 5.2 X-MesageID: 35108176 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.79,347,1602561600"; d="scan'208";a="35108176" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6NARcjxcGJRyNFNuQWIDpHnhXWEvaF0HXzJEs/uUTXhgiW80ciSmEzYZiATID8QfPUcvZ5+2OH8AEtKv/hma5Dw38m+W1pgSkYorAKcOy5VLusA5/UgviM4XwmiE6Lp+4m41r2U3il2iZk3xiZBMMzC7uiGCsnYDj66V8m47vk1gWAMZImeEdMQcKR/L7ku69DQvT9YYAfj3Bk5jMP9X2gkWoJrVpT+htP3K+7txf9jpLpMH/Rkw4qkFEn4NOBBfgVujp+rapRH7TQWww1MN+9Ee7E8DneKDsHVVgXq6P2+HF8NVfHMvCwMABhBpFVzd5rnR6CV1eso8+ceOIWAjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WaYEPe4rX+026KRDnpyMO09TN/kdKnPc59mVZ5N5cLk=; b=a5B31xPFCelsKzf3FIEY4lfs4XVyL6Z3SLJz60oVNTWcp9gqeilVwV1l701PkqXkxfEuhLJlgB0/mgs4kz2GZDh6bkQ9/qdC908fhOPLuSG1CbAojtts56uYR8/ZsPHCA8o9aLmkixZr5QDl4A/xhPINfwVMqrI7wmwCOoCI+eAklTJLMFnQtAQpdYZOSAYs2Q+19TPbIwjAAEkFPLWHIrrYOHARk9ifRDKBf0y3xW3BK1cjAv8tidmgQUHHEYEoy92OWpp1m3g8NM6rXa7eojfyyYVTWzePqyYUkXz4kZQUyoTxb/fa5qPFTBq3JKthZNjYtFX/pJ9RqoqyFY0dPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WaYEPe4rX+026KRDnpyMO09TN/kdKnPc59mVZ5N5cLk=; b=THeG/PZmf9wAd3xUdozvILSffNPnGBngi5JTM1AKdxEKCpX5JRpKGvQSur/4uKNXmVJ72YcbREHeiF7yOVT5d8YfATr3t+BOhvt+JyhR9dTQgSsUblENaLqnCf6tGDapMsILipyCLCV63hazfo4MGbK8kMgSxqfBOZqA6IXReF0= Date: Thu, 14 Jan 2021 18:20:40 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: "Tian, Kevin" CC: "xen-devel@lists.xenproject.org" , "Paul Durrant" , "Cooper, Andrew" , Wei Liu , Jason Andryuk Subject: Re: [PATCH] x86/dpci: remove the dpci EOI timer Message-ID: <20210114172040.2vqo7yfcbgw5lees@Air-de-Roger> References: <20210113131100.p5xiyfgtp5s5rktz@Air-de-Roger> <20210113180558.do2xq4iaur6kyuy4@Air-de-Roger> <20210114102205.ferwl6y7idooqy3y@Air-de-Roger> <20210114123307.aq6ysxggevzfyvwr@Air-de-Roger> <2b9ed9bc-eae2-d4e8-c760-d429c6bedc24@suse.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2b9ed9bc-eae2-d4e8-c760-d429c6bedc24@suse.com> X-ClientProxiedBy: AM5PR0701CA0002.eurprd07.prod.outlook.com (2603:10a6:203:51::12) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc98d8f7-6862-4fa6-8930-08d8b8b0ba60 X-MS-TrafficTypeDiagnostic: DM5PR03MB2921: X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /BOTekLFfLjq0tXZ04wruQOi18b+gDvNqqd4LMdDW+y/EhdJ5Tudl1XQAeYl8LeLRmGoIr+3B3ptGgVEGJFtgmUMElAmM0qrIn2dc8frtWvUI40r/HYeYZG1HW6/nAwTeI24n3cHNVZL9TSCXbadKLsPZymZ2ftXnUo2X5Hk6sRgA8VX5Sm59U+czq7thhZfVzdtM49t1E6rjexLkycwceqlGofFvxouEcN81yhSpT09hx235nfoJZtSTTip2ooczaumamJNO/SMqvsPQT6u/tO+v+ovMe2T77iwsuORlp7Pz1TOe26QVmqXVmB9676pfQfIw6oqjmHa5JVYmRM2ZVcI9x28zJ3gdZSebGkWwueFRtzygEyLD2f7T27Ymi41KdjXSPJIVvOz8fhq/BXrtA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(7916004)(346002)(396003)(39860400002)(136003)(366004)(376002)(6666004)(2906002)(316002)(4326008)(478600001)(6916009)(1076003)(16526019)(26005)(54906003)(66476007)(66556008)(8676002)(83380400001)(8936002)(186003)(6496006)(956004)(9686003)(33716001)(53546011)(6486002)(5660300002)(86362001)(85182001)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?eSt2aStlblo3eDdPdWhac2FFUnFET0IvMnNYek5QQkVVTDVSeFkwNjRqaXRR?= =?utf-8?B?RXlNWG90dy8zUk5iUGlrRVo3QW5rL2ltTmZOenIyLzczOVpQcXNieHpHNEVr?= =?utf-8?B?LzBlUGpHZjRHNkQyM1kvQU9QS2dIbWNqVXlVMGova0x0aEV4RG9veGlPSlhq?= =?utf-8?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bkt6TC80?= =?utf-8?B?eW1ZYUFHaHloWHduQmhsRWZJNVUrckMySldEQWNTV2tMazh4YklVcnBTV3Bj?= =?utf-8?B?OG5kemVmMnNhajN3b1gvU05HbWc4YkY3LzFjZi90MjlVclhNdTY1aDBKcnNj?= =?utf-8?B?L3A5OE81bytVQUt6VVJ5M1ZaRmYxL0VrMEU2bmpWZzJKL2EwMzd6VjJaVmw3?= =?utf-8?B?VmpubGNoWWpNd09ac3RMVm5hOG8zcVBvZENLUVJQbXd3TDNLUW9tVkRuRE1D?= =?utf-8?Q?2mLQqK+vxO6JUz53p5NPrnHo4+yp4UIPQ8?= X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 17:20:45.2553 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-Network-Message-Id: cc98d8f7-6862-4fa6-8930-08d8b8b0ba60 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yPpg8LYbCKt1GFQpXmUR1fB3h0FIWDjeJErMpeNnl5FKa7Q4Bi7lWPKpeGkiDYDbI+Ub5xu3kNEPAc16PRe+6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2921 X-OriginatorOrg: citrix.com On Thu, Jan 14, 2021 at 02:41:29PM +0100, Jan Beulich wrote: > On 14.01.2021 13:33, Roger Pau Monné wrote: > > On Thu, Jan 14, 2021 at 12:45:27PM +0100, Jan Beulich wrote: > >> On 14.01.2021 11:22, Roger Pau Monné wrote: > >>> On Wed, Jan 13, 2021 at 04:31:33PM -0500, Jason Andryuk wrote: > >>>> On Wed, Jan 13, 2021 at 1:34 PM Jason Andryuk wrote: > >>>>> I guess I'd also need to disable MSI for the two devices to ensure > >>>>> they are both using the GSI? > >>>> > >>>> lspci in dom0 shows the USB xhci controller, iwlwifi, and e1000e > >>>> devices all with IRQ 16 and all with MSI disabled ("MSI: Enabled-"). > >>>> The two linux HVMs run with (PV) linux stubdoms, and the HVM kernels > >>>> were started with pci=nosmi. Networking through the iwlwifi device > >>>> works for that VM while a mouse attached to the xhci controller is > >>>> also working in the second VM. Is there something else I should test? > >>> > >>> Not really, I think that test should be good enough, the issue is that > >>> we don't know which OS was seeing the issues noted by Kevin. > >> > >> Why a specific OS? Isn't this also guarding against malice? > > > > No, I don't think this protects against any kind of malice (at least > > that I can think of). It just deasserts the guest virtual line > > periodically if the guest itself hasn't done so. It will also attempt > > to EOI the physical interrupt, but that's already done by the > > eoi_timer in irq_guest_action_t (which would be the part that protects > > against malice IMO). > > Hmm, yes, there's certainly some overlap. And indeed the EOI > timer is set 1ms in the future, while the timer here allows > for 8ms to pass before taking action. > > What I'm uncertain about is the interaction between both: It > would seem to me that the pirq_guest_eoi() invocation from > here could undermine the purpose of the EOI timer. In which > case it would in fact be a win to get rid of this timer here. It's not clear to me either. In any case having two timers for the same irq also seems like a waste of resources. > > It's my understanding that according to what Kevin pointed out this > > was done because when sharing a pirq amongst different guests a guest > > can get interrupts delivered before it has properly setup the device, > > and not deasserting those by Xen would get the guest into some kind of > > stuck state, where it's not deasserting the line for itself. > > > > TBH I'm still trying to figure out how that scenario would look like, > > and why would just deasserting the line fix it. On the vIO-APIC case > > you would need to forcefully clean the IRR bit in order to receive > > further interrupts on that pin, so maybe the issue is that switching a > > vIO-APIC pin from level to trigger mode (which clears the IRR bit) > > should also deassert the line? > > I suppose this was directed at Kevin - I'm struggling as well. Right, was a question for anyone who might know the answer really. I think I will prepare some more stuff to try to clean this up. Let's see if Kevin has some input. Thanks, Roger.