[Xen-devel] 答复: PCI passthrough will cause unknown device appearance in device manager of Windows OS via xenstore keys

2017-04-11 Thread lidonglin
>The patch, unchanged from before, is 
>https://github.com/xenserver/xen-4.7.pg/blob/master/master/0001-libxl-Don-t-insert-PCI-device-into-xenstore-for-HVM-.patch

This patch means that no xenstore keys will be created for HVM. For this, I 
have one question that :
libxl__device_pci_add  --> libxl_pcidev_assignable --> 
libxl_device_pci_assignable_list --> get_all_assigned_devices

this call stack will happen when creating pci passthrough vm.  If no backend 
keys exist in xenstore, get_all_assigned_devices() will not work. Because 
get_all_assigned_devices needs to get info from backend xenstore keys.

So am I right?
发件人: Andrew Cooper [mailto:andrew.coop...@citrix.com]
发送时间: 2017年4月10日 20:46
收件人: Wei Liu ; Ian Jackson 
抄送: lidonglin ; xen-devel@lists.xen.org; Xuquan (Quan Xu) 
; sstabell...@kernel.org; Wei Liu (wei.l...@citrix.com) 
; Yanqiangjun ; Fanhenglong 
; dengkai (A) 
主题: Re: [Xen-devel] PCI passthrough will cause unknown device appearance in 
device manager of Windows OS via xenstore keys

On 10/04/17 12:24, lidonglin wrote:
Hi all:
I have one question about PCI passthrough. I found that if I 
created a VM with host pci device(cfg file as below), there were some xenstore 
keys exsiting in /local/domain/0 and /local/domain/DomID/. Besides I found one 
unknown device in device manager of Windows OS with Class ID FF80 from vendor 
ID 5853. My questions  are as below:


1.   Why do we create frontend and backend key pairs in xenstore?  I think  
Passthrough is not PV,  was it possible that we just used these keys to record 
something?

2.After review the code, I think backend keys are used to record state 
of hostdev, some codes will query something using these keys. But for frontend 
keys, can we delete them?

3.   if frontend keys exist in xenstore, then unknown device will appear in 
device manager. Can we fix this?  For  an obsessive,  he can’t stand for this.

This is a libxl bug which has been reported before, but nothing happened.

libxl must not start a PV pci-back when doing HVM PCI passthrough using qemu, 
because absolutely nothing good can come of having two different ways of poking 
at PCI state.

The patch, unchanged from before, is 
https://github.com/xenserver/xen-4.7.pg/blob/master/master/0001-libxl-Don-t-insert-PCI-device-into-xenstore-for-HVM-.patch

~Andrew
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] PCI passthrough will cause unknown device appearance in device manager of Windows OS via xenstore keys

2017-04-10 Thread lidonglin
Hi all:
I have one question about PCI passthrough. I found that if I 
created a VM with host pci device(cfg file as below), there were some xenstore 
keys exsiting in /local/domain/0 and /local/domain/DomID/. Besides I found one 
unknown device in device manager of Windows OS with Class ID FF80 from vendor 
ID 5853. My questions  are as below:


1.   Why do we create frontend and backend key pairs in xenstore?  I think  
Passthrough is not PV,  was it possible that we just used these keys to record 
something?

2.After review the code, I think backend keys are used to record state 
of hostdev, some codes will query something using these keys. But for frontend 
keys, can we delete them?

3.   if frontend keys exist in xenstore, then unknown device will appear in 
device manager. Can we fix this?  For  an obsessive,  he can't stand for this.

Cfg file as below:
builder = "hvm"
name = "win2008_server_r2_sp1_64"
viridian = 1
memory = 8192
maxmem = 8192
vcpus = 4
disk = [ '/mnt /win2008_server_ent_r2_sp1_64_gputhrough_vhd,vhd,xvda,rw' ]
vnc = 1
vnclisten = 'xxx.xxx.xxx.xxx'
vncdisplay = 0
usb = 1
usbdevice = ['tablet']
pci = [":06:00.0"]

I use xen-4.8.0 version.

Xenstore keys
For domU
/local/domain/5/device/vkbd/0/backend = "/local/domain/0/backend/vkbd/5/0"
/local/domain/5/device/vkbd/0/backend-id = "0"
/local/domain/5/device/vkbd/0/state = "1"
/local/domain/5/device/pci = ""
/local/domain/5/device/pci/0 = ""
/local/domain/5/device/pci/0/backend = "/local/domain/0/backend/pci/5/0"
/local/domain/5/device/pci/0/backend-id = "0"
/local/domain/5/device/pci/0/state = "1"
/local/domain/5/control = ""

For dom0
/local/domain/0/backend/vkbd/5/0/feature-abs-pointer = "1"
/local/domain/0/backend/vkbd/5/0/hotplug-status = "connected"
/local/domain/0/backend/pci = ""
/local/domain/0/backend/pci/5 = ""
/local/domain/0/backend/pci/5/0 = ""
/local/domain/0/backend/pci/5/0/frontend = "/local/domain/5/device/pci/0"
/local/domain/0/backend/pci/5/0/frontend-id = "5"
/local/domain/0/backend/pci/5/0/online = "1"
/local/domain/0/backend/pci/5/0/state = "3"
/local/domain/0/backend/pci/5/0/domain = "win2008_server_r2_sp1_64"
/local/domain/0/backend/pci/5/0/key-0 = ":06:00.0"
/local/domain/0/backend/pci/5/0/dev-0 = ":06:00.0"
/local/domain/0/backend/pci/5/0/vdevfn-0 = "20"
/local/domain/0/backend/pci/5/0/opts-0 = 
"msitranslate=0,power_mgmt=0,permissive=0"
/local/domain/0/backend/pci/5/0/state-0 = "3"
/local/domain/0/backend/pci/5/0/num_devs = "1"
/local/domain/0/backend/pci/5/0/vdev-0 = ":00:00.00"
/local/domain/0/backend/pci/5/0/root-0 = ":00"
/local/domain/0/backend/pci/5/0/root_num = "1"
/local/domain/5 = ""
/local/domain/5/vm = "/vm/81296e36-1576-4b58-bb6e-17dc2b4ea1f6"


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] Question about PEX boot on Xen with OVMF as bios

2015-05-24 Thread lidonglin
Hi all:
Recentlly, I want to use PXE boot on Xen with OVMF as bios. At 
beginning, I just add rtl8139 as guest nic device, and I compile a release 
ovmf. When I enter into uefi, I can't find network boot menu.  According to 
edk2/OvmfPkg/README file, I know there is a virtio-net driver build into ovmf. 
So I replace rtl8139 with virtio-net. When I enter into uefi boot menu again. I 
see the network boot entry, I'm very happy. But after I choose network boot 
entry, uefi can't display pxe boot process, only black sceen with one while dot 
at the beginning of the screen. I try e1000 according to edk2/OvmfPkg/README 
file, and I get the same result. Except e1000 and virtio-net, I can't see the 
network boot entry if I use any other nics. Who can tell me how to use pxe boot 
on Xen with ovmf. Thanks.


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [edk2] Windows 8 64bit Guest BSOD when using OVMF to boot and *install* from CDROM(when configured with more than 4G memory)

2015-05-10 Thread lidonglin
Hi all:
Did you encounter this BSOD problem ? I try 
git://xenbits.xen.org/ovmf.git and other ovmf repos. I found installing win8 
64bit os (memory > 4G) with OVMF on xen hypervisor always failed with BSOD. I 
also tried to do some thing on kvm, there is no this problem. 
I don't what's the difference.



> -Original Message-
> From: Ian Campbell [mailto:ian.campb...@citrix.com]
> Sent: 2015年5月8日 20:05
> To: Wei Liu
> Cc: Laszlo Ersek; Maoming; wangxin (U); edk2-de...@lists.sourceforge.net;
> lidonglin; xen-devel@lists.xen.org; Fanhenglong; Herongguang (Stephen)
> Subject: Re: [Xen-devel] [edk2] Windows 8 64bit Guest BSOD when using OVMF
> to boot and *install* from CDROM(when configured with more than 4G
> memory)
> 
> On Fri, 2015-05-08 at 13:00 +0100, Wei Liu wrote:
> > On Fri, May 08, 2015 at 10:39:43AM +0100, Ian Campbell wrote:
> > > On Fri, 2015-05-08 at 07:31 +0100, Wei Liu wrote:
> > > > On Thu, May 07, 2015 at 10:29:55AM +0100, Ian Campbell wrote:
> > > > > On Thu, 2015-05-07 at 09:02 +0200, Laszlo Ersek wrote:
> > > > > > (Plus, you are cloning a git repo that may or may not be
> > > > > > identical to the (semi-)official edk2 git repo.)
> > > > >
> > > > > FWIW git://xenbits.xen.org/ovmf.git is a direct descendant of the
> > > >
> > > > The most up to date tested branch is
> > > >
> > > >  git://xenbits.xen.org/osstest/ovmf.git xen-tested-master
> > >
> > > Which branch is the default if you just clone the repo?
> > >
> >
> > The xen-tested-master is the only branch in that tree, so checking out
> > that repo without specifying a branch will leave you in detached head
> > state.
> 
> OK, that's better than some random untested version from whenever the
> tree was created at least!
> 
> Ian
> 

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [edk2] Windows 8 64bit Guest BSOD when using OVMF to boot and *install* from CDROM(when configured with more than 4G memory)

2015-05-07 Thread lidonglin
I just git clone ovmf from official edk2 git repo ang git latest qemu 2.3.50. 
But the issue still exists. Besides, I find windows server 2012 has the same 
BSOD issue but windows 8.1 works normally.



-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com] 
Sent: 2015年5月7日 15:03
To: lidonglin
Cc: edk2-de...@lists.sourceforge.net; wangxin (U); Fanhenglong; Herongguang 
(Stephen); Maoming; xen-devel@lists.xen.org
Subject: Re: [edk2] Windows 8 64bit Guest BSOD when using OVMF to boot and 
*install* from CDROM(when configured with more than 4G memory)

On 05/07/15 08:47, lidonglin wrote:
> Dear all:
>   New issue:
>   Guest BSOD and restart when using OVMF to boot and install windows8 
> 64bit OS(which owns more than 4G memmory)。
> My environment as below:
> xen 4.5.0
> qemu 2.2.1
> ovmf git clone from git://xenbits.xen.org/ovmf.git (commit 
> a065efc7c7ce8bb3e5cb3e463099d023d4a92927)
> 
> I just git clone xen from git://xenbits.xen.org/xen.git. configure it and 
> parameters as below:
> ./configure --prefix=/usr/ --libdir=/usr/lib/  --enable-ovmf then make && 
> make install, after that I reboot my host OS(SuSE 11.3).
> I write a cfg file win8.cfg as below:
> builder = "hvm"
> name = "win8"
> memory = 2048
> maxmem = 2048
> vcpus = 4
> bios = "ovmf"
> boot = "d"
> disk = [ 
> '/test/Windows8-ReleasePreview-64bit-ChineseSimplified.iso,,hdc,cdrom','/test/win8.img,raw,xvda,rw'
>  ] usb = 1 usbdevice="tablet"
> vnc = 1
> vnclisten = '9.61.1.3'
> vncdisplay = 0
> 
> # xl create win8.cfg
> after the command I use vnc client to connect guest, win8 guest works 
> normally.
> then I modify the memory size and change it to 8192MB, save and start win8 
> guest again.
> after ovmf bios logo, windows8 logo appears, go on for a while, the guest 
> stops and restart, then stop (sometimes BSOD,but no error code on the screen) 
> and restart repeat the process
> 
> I tried some different memory sizes, the result is guest can work normally 
> when it has 4320MB memory at most, but it stop and restart when it has lager 
> than 4320MB memory

CC'ing the xen-devel mailing list, as I have no environment to reproduce
this in. (Plus, you are cloning a git repo that may or may not be
identical to the (semi-)official edk2 git repo.)

Thanks
Laszlo

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] Windows 8 64bit Guest BSOD when using OVMF to boot and *install* from CDROM(when configured with more than 4G memory)

2015-05-06 Thread lidonglin
Dear all:
New issue:
Guest BSOD and restart when using OVMF to boot and install windows8 
64bit OS(which owns more than 4G memmory)。
My environment as below:
xen 4.5.0
qemu 2.2.1

I just git clone xen from git://xenbits.xen.org/xen.git. configure it and 
parameters as below:
./configure --prefix=/usr/ --libdir=/usr/lib/  --enable-ovmf then make && make 
install, after that I reboot my host OS(SuSE 11.3).
I write a cfg file win8.cfg as below:
builder = "hvm"
name = "win8"
memory = 2048
maxmem = 2048
vcpus = 4
bios = "ovmf"
boot = "d"
disk = [ 
'/test/Windows8-ReleasePreview-64bit-ChineseSimplified.iso,,hdc,cdrom','/test/win8.img,raw,xvda,rw'
 ] usb = 1 usbdevice="tablet"
vnc = 1
vnclisten = '9.61.1.3'
vncdisplay = 0

# xl create win8.cfg
after the command I use vnc client to connect guest, win8 guest works normally.
then I modify the memory size and change it to 8192MB, save and start win8 
guest again.
after ovmf bios logo, windows8 logo appears, go on for a while, the guest stops 
and restart, then stop (sometimes BSOD,but no error code on the screen) and 
restart repeat the process

I tried some different memory sizes, the result is guest can work normally when 
it has 4320MB memory at most, but it stop and restart when it has lager than 
4320MB memory


Li Donglin

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel