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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 2AC65C433DF for ; Thu, 18 Jun 2020 15:16:51 +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 057BE206F7 for ; Thu, 18 Jun 2020 15:16:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 057BE206F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlwHF-0005ji-UX; Thu, 18 Jun 2020 15:16:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlwHE-0005jd-QB for xen-devel@lists.xenproject.org; Thu, 18 Jun 2020 15:16:28 +0000 X-Inumbo-ID: ae5430b8-b176-11ea-8496-bc764e2007e4 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ae5430b8-b176-11ea-8496-bc764e2007e4; Thu, 18 Jun 2020 15:16:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8E85CADE3; Thu, 18 Jun 2020 15:16:26 +0000 (UTC) Subject: Re: [PATCH for-4.14 2/8] x86/hvm: don't force vCPU 0 for IRQ 0 when using fixed destination mode To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <20200612155640.4101-1-roger.pau@citrix.com> <20200612155640.4101-3-roger.pau@citrix.com> <20200618134841.GQ735@Air-de-Roger> <20200618141805.GR735@Air-de-Roger> <69de3bdb-b521-798b-a727-fd8f20ee6294@suse.com> <20200618144936.GS735@Air-de-Roger> From: Jan Beulich Message-ID: Date: Thu, 18 Jun 2020 17:16:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200618144936.GS735@Air-de-Roger> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: xen-devel@lists.xenproject.org, Andrew Cooper , Wei Liu , paul@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 18.06.2020 16:49, Roger Pau Monné wrote: > On Thu, Jun 18, 2020 at 04:29:59PM +0200, Jan Beulich wrote: >> On 18.06.2020 16:18, Roger Pau Monné wrote: >>> On Thu, Jun 18, 2020 at 04:08:28PM +0200, Jan Beulich wrote: >>>> On 18.06.2020 15:48, Roger Pau Monné wrote: >>>>> On Thu, Jun 18, 2020 at 03:43:00PM +0200, Jan Beulich wrote: >>>>>> On 12.06.2020 17:56, Roger Pau Monne wrote: >>>>>>> When the IO APIC pin mapped to the ISA IRQ 0 has been configured to >>>>>>> use fixed delivery mode do not forcefully route interrupts to vCPU 0, >>>>>>> as the OS might have setup those interrupts to be injected to a >>>>>>> different vCPU, and injecting to vCPU 0 can cause the OS to miss such >>>>>>> interrupts or errors to happen due to unexpected vectors being >>>>>>> injected on vCPU 0. >>>>>>> >>>>>>> In order to fix remove such handling altogether for fixed destination >>>>>>> mode pins and just inject them according to the data setup in the >>>>>>> IO-APIC entry. >>>>>>> >>>>>>> Signed-off-by: Roger Pau Monné >>>>>> >>>>>> Technically >>>>>> Reviewed-by: Jan Beulich >>>>>> >>>>>> I wonder though why this was done in the first place - it very much >>>>>> feels like a workaround for certain guest behavior, and hence >>>>>> getting rid of it may mean a certain risk of regressions. Not a >>>>>> very good point in time to make risky changes ... >>>>> >>>>> We can defer to after the release I guess, but I will still ask for >>>>> the changes to be backported. >>>> >>>> That's fine, albeit if we decide to delay it until 4.15 was branched, >>>> then I think we want to also wait longer than usual until it would hit >>>> the stable trees. Unfortunately c8e79412c001's description is of no >>>> help to understand what or why "time jumps" may result from delivering >>>> the interrupt as requested. >>> >>> Yes, I've also looked at the original commit and have no idea what it >>> was actually trying to fix, and why delivering to vCPU 0 fixed it. >>> FWIW, I tried delivering to a different vCPU and it seems to work >>> fine. >> >> Right, I too was thinking that delivering to a "stable" CPU might be >> all that's needed. In patch 3 this may then call for latching that >> CPU, and preferring it over what vlapic_lowest_prio() produces. > > Yes, I also considered that route for the lowest priority mode (which > is dealt with in the next patch), but for fixed mode we need to > delivered to the listed vCPUs, there's no trick we can play here > IMO. The set may still be empty, in which case the lowest-prio consideration (of falling back to CPU0) may still apply here as well. But of course there's nothing to latch here, as fixed mode means multi-cast if more than one destination matches. Jan