Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755479AbcDMTMI (ORCPT ); Wed, 13 Apr 2016 15:12:08 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:21229 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754764AbcDMTMF (ORCPT ); Wed, 13 Apr 2016 15:12:05 -0400 Subject: Re: Xen regression, Was: [PATCH] x86/irq: Probe for PIC presence before allocating descs for legacy IRQs To: Stefano Stabellini References: <1446470676-1877-1-git-send-email-vkuznets@redhat.com> <570CF69A.1020701@oracle.com> <570D4645.20004@oracle.com> <570D69FE.6090200@oracle.com> <570D77D1.7080701@oracle.com> <570DA089.6060507@oracle.com> <570E838A.7000104@oracle.com> Cc: Vitaly Kuznetsov , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Jiang Liu , "K. Y. Srinivasan" , linux-kernel@vger.kernel.org, konrad.wilk@oracle.com, david.vrabel@citrix.com, jgross@suse.com, "Luis R. Rodriguez" From: Boris Ostrovsky Message-ID: <570E99AF.1020705@oracle.com> Date: Wed, 13 Apr 2016 15:10:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <570E838A.7000104@oracle.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2015 Lines: 47 On 04/13/2016 01:36 PM, Boris Ostrovsky wrote: > On 04/12/2016 09:27 PM, Boris Ostrovsky wrote: >> On 04/12/2016 07:15 PM, Stefano Stabellini wrote: >>> On Tue, 12 Apr 2016, Boris Ostrovsky wrote: >>>> On 04/12/2016 05:56 PM, Stefano Stabellini wrote: >>>>> I am not sure, maybe you didn't have CONFIG_SPARSE_IRQ? >>>>> But I am certain that 4.6-rc2, with the attached config, fails as >>>>> Dom0 >>>>> on QEMU with the following sequence of calls: >>>> I did have CONFIG_SPARSE_IRQ and I just rebuilt 4.5.0 with your config >>>> (4.6-rc3 doesn't build for me for some reason) and that booted dom0 >>>> as well. >>>> >>>> BTW, what do you mean by "dom0 on QEMU"? >>> I am running Xen and Linux inside a QEMU x86_64 emulated machine >>> (nested >>> virt). >> >> This I, of course, never tried. >> >> But given that things work in a single-level virt, doesn't this imply >> that perhaps there is something in the emulation that's not quite right? > > OK, so this *is* broken on single level virt as well. It's just that > we always end up using AHCI so lack of irq 14 (and 15) does not affect > the system. And I guess in QEMU case it's IDE only, right? > > You patch does fix this but I wonder if we could change something in > probe_8259A() so that we can continue using nr_legacy_irqs(). Using > nr_legacy_irqs() and NR_IRQS_LEGACY at the same time is inconsistent > and may cause us headaches in the future. > I think we could use paravirt_has() feature that was added for similar reason when we had a problem with RTC (commit d8c98a1d1488747625ad6044d423406e17e99b7a). So we add paravirt_has(PIC) which will only be set by dom0 and then probe_8259A() will not set legacy_pic to null_legacy_pic when this flag is set. Note that paravirt_has() is being removed by http://lists.xenproject.org/archives/html/xen-devel/2016-04/msg01415.html so presumably we'd use new struct x86_legacy_features instead (copying Luis so that if this is acceptable he could add it to his next spin). -boris ||