From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Wilson Subject: Re: [BUG] Xen vm kernel crash in get_free_entries. Date: Mon, 21 Oct 2013 11:29:52 +0100 Message-ID: <20131021102952.GA12019@u109add4315675089e695.ant.amazon.com> References: <525FA61A.9080907@rat.ru> <526034BD.90709@rat.ru> <20131017192808.GM2924@reaktio.net> <5260FFFF.8070204@citrix.com> <1382089564.18128.103.camel@kazak.uk.xensource.com> <20131018141554.GN2924@reaktio.net> <1382105942.18128.124.camel@kazak.uk.xensource.com> <1746041225.20131019011459@eikelenboom.it> <5262642A.2060609@rat.ru> <1382180597.28188.9.camel@dagon.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1382180597.28188.9.camel@dagon.hellion.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Stefano Stabellini , xen-devel@lists.xen.org, Sander Eikelenboom , Astarta , David Vrabel , Matt Wilson List-Id: xen-devel@lists.xenproject.org On Sat, Oct 19, 2013 at 12:03:17PM +0100, Ian Campbell wrote: > On Sat, 2013-10-19 at 14:51 +0400, Astarta wrote: > > On 10/19/2013 03:14 AM, Sander Eikelenboom wrote: > > > > makes a HVM guest (qemu-xen-traditional) with xen_platform_pci=0 boot again using xl, haven't tested it with xend. > > > > > Great catch! > > I also confirm that 3.11.5 kernel boots just fine after reverting of > > 'correctly initialize grant table version 1' patch. > > This could just be down to that patch adding some BUG_ONs to catch bad > things going on, e.g. the one in gnttab_expand which I think is being > hit here. Indeed, the BUG_ON was added to ensure that the grant table system is initialized before we attempt to expand the grant table space. > I have a feeling that it is still wrong (but just more benign) to be > hitting that call chain in a configuration where there is no platform > device driver running. IOW reverting that patch removes the obvious > symptom (blowing up) but not the root cause, i.e. the patch is doing its > job. The initialization of the grant table is deferred when running on a HVM guest. drivers/xen/grant-table.c: static int __gnttab_init(void) { /* Delay grant-table initialization in the PV on HVM case */ if (xen_hvm_domain()) return 0; if (!xen_pv_domain()) return -ENODEV; return gnttab_init(); } The Xen platform PCI driver initializes it when it binds to the PCI device: drivers/xen/platform-pci.c: static int platform_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent) { ... max_nr_gframes = gnttab_max_grant_frames(); xen_hvm_resume_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); ret = gnttab_init(); if (ret) goto out; xenbus_probe(NULL); return 0; ... Lots of initialization depends on the presence of the Xen platform PCI device, I don't see how PV enlightenment can be expected to work if you don't enable the PCI device. --msw