From owner-freebsd-xen@freebsd.org Sun May 13 15:16:59 2018 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE985FE1BB2 for ; Sun, 13 May 2018 15:16:58 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2B2883269; Sun, 13 May 2018 15:16:58 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from localhost (cpc92722-cmbg20-2-0-cust481.5-4.cable.virginm.net [82.21.85.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: royger) by smtp.freebsd.org (Postfix) with ESMTPSA id 365FFE92F; Sun, 13 May 2018 15:16:58 +0000 (UTC) (envelope-from royger@FreeBSD.org) Date: Sun, 13 May 2018 16:16:49 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Kai Otto Cc: freebsd-xen@freebsd.org Subject: Re: Linux domU only works with xen_platform_pci=0 ? Message-ID: <20180513151649.4ls73myegkhm3cep@MacBook-Pro-de-Roger.local> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2018 15:16:59 -0000 On Sun, May 13, 2018 at 03:51:36PM +0200, Kai Otto wrote: > Hello, > > I'm trying to set up a FreeBSD 11.1 system as Xen virtualization host. > Following a combination of handbook [1] and wiki [2], I was able to get > get a FreeBSD dom0 in PVH mode, and FreeBSD domU in HVM mode running, > including installation to disk and networking. > > It seemed to me as if the switch 'xen_platform_pci' doesn't have an > effect on FreeBSD domU's, as I see e.g. a xenpci0 and xbd0 in dmesg no > matter if I set it to 1 or 0. > > Do I understand it correctly, that this switch makes the difference > between HVM and PVHVM mode? > According to xl.cfg(5), it 'enables a guest Operating System [...] to > make use of paravirtualization features such as disk and network devices'. > > > Afterwards, I tried to create a Linux domU. Both Centos 7 and Alpine > Linux only detected the harddisk with xen_platform_pci=0. > > For Alpine Linux, with xen_platform_pci=1, I get the following messages > on the console: > > vbd vbd-5632: 19 xenbus_dev_probe on device/vbd/5632 That's ENODEV IIRC, I think there's something wrong with FreeBSD disk backend. > vbd vbd-5632: failed to write error node for device/vbd/5632 (19 > xenbus_dev_probe on device/vbd/5632) > > After waiting for a couple minutes it boots, but doesn't detect the disk. > > Looking in /var/log/xen/qemu-dm-alpine-hvm.log, I see the following > messages: > > xen be core: can't open gnttab device > xen be core: can't open gnttab device > xen be: vkbd-0: initalize() failed > xen be: vkbd-0: initalize() failed > xen be: vkbd-0: initalize() failed > > > > Googling around yielded [3], where someone apparently ran into the same > problem, and used xen_platform_pci=0 as workaround. > > > > So my question is: > Is xen_platform_pci=1 required for PVHVM mode? No, it shouldn't be. > If yes, is PVHVM mode only available for FreeBSD domU's? > If no, how can I enable it for Linux guests? If you boot FreeBSD Dom0 kernel with boot_verbose=YES (in /boot/loader.conf), can you paste the messages you get when trying to boot the PVHVM guest with xen_platform_pci=1? Also, can you paste the output of `xenstore-ls -fp` executed on Dom0 after the PVHVM guest has failed to boot but is still running? > Any response would be appreciated, thanks! > > (Unrelated: I also couldn't get PVH guests to boot, neither FreeBSD nor > Linux. The console stayed blank and CPU went to 100%. But that's a whole > other story I guess.) FreeBSD Dom0 runs in PVH mode, so you are indeed able to boot at least one PVH guest :). Let's look into the PVHVM issue first. > My system: > > OS: FreeBSD-11.1-RELEASE amd64 > xen installed via pkg > Processor: E3-1240 v2, (which supports VT-x, VT-d and EPT) > > > My alpine.cfg: > > builder="hvm" > name="alpine-hvm" > memory=1024 > vcpus=1 > vif = [ 'bridge=bridge0' ] > disk = [ '/dev/zvol/zbulk/vm/alpine-hvm_disk0,raw,hda,rw', > '/zbulk/mediashare/isos/linux/apline-virt-3.7.0-x86_64.iso,raw,hdb:cdrom,r'] > > xen_platform_pci=1 # or 0, see above > vnc = 1 > vnclisten = "0.0.0.0" > serial = "pty" > usbdevice = "tablet" Your domain config file seems OK to me. Roger.