[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VGA Passthrough
From: |
Jd Lyons |
Subject: |
Re: VGA Passthrough |
Date: |
Fri, 20 Mar 2020 18:49:46 -0400 |
Also qemu-system-ppc64:
sudo qemu-system-ppc64 -M pseries \
-m 2048 \
-cpu power8 \
-drive file=IBM.img,if=scsi,index=0 \
-drive file=/home/jam/os9/qemu-img,if=scsi,index=1 \
-device vfio-pci,host=25:00.0,multifunction=on \
-prom-env auto-boot?='false' \
-usb -device usb-host,vendorid=0x413c,productid=0x2105 \
-nographic \
-vga none
I get this error:
qemu-system-ppc64: vfio/eeh: EEH_PE_OP 0x1 failed: Inappropriate ioctl for
device
If anyone knows what that means it would likely move us a long way?
0 > include evaluator.fs ok
0 > dev /pci/@1 ok
0 > load disk1:,\ragepci
Trying to load: from: /vdevice/v-scsi@71000003/disk@8100000000000000:,\ragepci
... ok
0 > " /pci/@1" open-dev to my-self ok
0 > 403f 1 byte-load ok
0 > dev /pci/@1 .properties
driver,AAPL,MacOS,PowerPC 4a6f7921 70656666 70777063 00000001
b344099b 00000000 00000000 00000000
00030002 00000000 ffffffff 00000000
0000baf4 0000baf4 0000baf4 00000620
00040400 ffffffff 00000000 00002b71
000026d3 00001c2f 0000c120 02010400
ffffffff 00000000 00000000 00000000
0000059c 00000080 04040400 00000000
ffffffff 00000000 ffffffff 00000000
ffffffff 00000000 00000005 0000002a
00000001 00000164 000001d0 00000578
00000001 00000002 00000000 00000000
00000000 00000014 00000000 00000000
00000012 00000000 00000000 00000001
00000014 00000000 0000001f 00000000
00000000 0000000c 00000015 00000000
0000002f 00000000 00000000 00000005
00000021 00000000 00000036 00000000
00000001 00000004 00000026 40000000
02000047 0200005a 0200006d 02000076
0200008b 0200009c 020000aa 020000c4
020000dc 020000e4 020000f8 020000ff
02000107 0200011a 02000130 02000146
0200014e 0200015d 02000167 0200017d
02000190 020001a2 020001b9 020001d1
020001e8 020001ff 02000213 02000227
0200023b 02000253 02000272 02000289
020002a7 020002bf 020002d4 020002e4
020002f4 0200030a 8200031f 82000336
82000351 82000367 00010000 00000036
00000000 4a294274 00848073 464e80c7
400a8a8b 420084ff 420b1392 09c9803f
40208673 42030303 00c20102 01020102
01020102 01020102 01020102 01020102
01020102 01020102 01020102 01020102
01020102 01020102 01020102 01020102
01020102 01020102 01020102 01020102
44726976 65725365 72766963 65734c69
6200496e 74657266 6163654c 6962004e
616d6552 65676973 7472794c 69620050
43494c69 62005669 64656f53 65727669
6365734c 69620047 65745061 6765496e
666f726d 6174696f 6e004475 72617469
6f6e546f 4162736f 6c757465 00435374
72436f70 7900506f 6f6c416c 6c6f6361
74655265 73696465 6e740044 656c6179
466f7248 61726477 61726500 53796e63
68726f6e 697a6549 4f00496e 7374616c
6c496e74 65727275 70744675 6e637469
6f6e7300 4162736f 6c757465 44656c74
61546f44 75726174 696f6e00 43537472
43617400 494f436f 6d6d616e 64497343
6f6d706c 65746500 55705469 6d650043
5374724c 656e0044 656c6574 65496e74
65727275 70745365 74004164 64447572
6174696f 6e546f41 62736f6c 75746500
53657450 726f6365 73736f72 43616368
654d6f64 65004353 7472436d 7000506f
6f6c4465 616c6c6f 63617465 00426c6f
636b436f 70790047 6574496e 74657272
75707446 756e6374 696f6e73 00437265
61746549 6e746572 72757074 53657400
43616c6c 556e6976 65727361 6c50726f
63005265 67697374 72795072 6f706572
636b01
ATY,Fcode 1.66
312e3636 00
ATY,Card# 109-57400-00
3130392d 35373430 302d3030 00
ATY,Rom# 113-57405-104
3131332d 35373430 352d3130 3400
model ATY,Rage128
4154592c 52616765 31323800
name ATY,Rage128o
4154592c 52616765 3132386f 00
reg 00000800 00000000 00000000 00000000
00000000 02000830 00000000 00000000
00000000 00020000 42000810 00000000
00000000 00000000 04000000 02000818
00000000 00000000 00000000 00004000
character-set ISO8859-1
49534f38 3835392d 3100
device_type display
64697370 6c617900
linebytes 00000280
depth 00000008
height 000001e0
width 00000280
ATY,Flags 07170000
ATY,Status 00000000
assigned-addresses 82000830 00000000 88020000 00000000
00020000 c2000810 00000000 84000000
00000000 04000000 81000814 00000000
00000100 00000000 00000100 82000818
00000000 88000000 00000000 00004000
vendor-id 00001002
device-id 00005246
revision-id 00000000
class-code 00030000
interrupts 00000001
subsystem-id 00000408
subsystem-vendor-id 0000b530
cache-line-size 00000000
devsel-speed 00000200
fast-back-to-back
66mhz-capable
ibm,loc-code vfio_vfio-pci:0000:00:01.0
7666696f 5f766669 6f2d7063 693a3030
30303a30 303a3031 2e3000
ibm,my-drc-index 40000008
min-grant 00000008
max-latency 00000000 ok
0 >
If I boot linux next the host crashes hard just after we see again:
qemu-system-ppc64: vfio/eeh: EEH_PE_OP 0x1 failed: Inappropriate ioctl for
device
Requiring a hard reset of the host computer.
> On Mar 20, 2020, at 3:00 PM, Jd Lyons <address@hidden> wrote:
>
> I’m using a version of Openbios that has the ATI code rom word patches.
>
> The situation with PCI Passthrough is complicated, I’m using a PCI-E to PCI
> bridge, and I’m not sure how a VGA card needs to access it’s PCI bridge. With
> a PCI Firewire card in the same bridge, everything works as expected in
> qemu-system-ppc via PCI Passthrough.
>
> However, there maybe something about VGA Passthrough that requires some
> bridge functions?
>
> VFIO-PCI doesn’t support bridges, so their is no way to pass the
> bridge/adapter to Qemu.
>
> Here is the host MMUIO group:
>
> IOMMU Group 21 24:00.0 PCI bridge [0604]: ASMedia Technology Inc.
> ASM1083/1085 PCIe to PCI Bridge [1b21:1080] (rev 04)
> IOMMU Group 21 25:00.0 VGA compatible controller [0300]: Advanced Micro
> Devices, Inc. [AMD/ATI] Rage Fury/Xpert 128/Xpert 2000 AGP 2x [1002:5246]
>
> And here is what I’m doing with qemu:
>
> sudo 'qemu-system-ppc' -m 1024 -hda 'XP.img' -prom-env
> 'vga-ndrv?=false' -prom-env 'boot-args=-v debug=0xffe kdp=2' -prom-env
> 'auto-boot?=false' -net nic,model=sungem -net user -device
> vfio-pci,host=25:00.0 -bios
> '/home/jam/openbios-qemu-activedevice-sungem-pci-map-in-rage128.elf' -cdrom
> '/home/jam/Downloads/debian-31r8-powerpc-netinst.iso' -boot d -prom-env
> aapl,debug=3000000 -usb -device usb-host,hostbus=1,hostaddr=5 -device
> usb-host,hostbus=1,hostaddr=7 -hdb '/home/jam/os9/os9.2.img' -M g3beige
> -nographic -vga none
> C>> annot manage 'VGA controller' PCI device type 'display':
>>> 1002 5246 (3 0 0)
>
>>> =============================================================
>>> OpenBIOS 1.1 [Aug 16 2019 21:49]
>>> Configuration device id QEMU version 1 machine id 2
>>> CPUs: 1
>>> Memory: 1024M
>>> UUID: 00000000-0000-0000-0000-000000000000
>>> CPU type PowerPC,750
> milliseconds isn't unique.
> Welcome to OpenBIOS v1.1 built on Aug 16 2019 21:49
>
> 0 > dev /pci/@4 ok
> 0 > load /pci/mac-io/@20000/@1:,\ppc\ragepci ok
> 0 > " /pci/@4" select-dev ok
> 0 > 400003f 1 byte-load open isn't unique.
> close isn't unique.
> ok
> 0 > boot hd:2,\yaboot >> switching to new context:
>
>
>> On Mar 20, 2020, at 2:41 PM, BALATON Zoltan <address@hidden> wrote:
>>
>> On Fri, 20 Mar 2020, Jd Lyons wrote:
>>> I’ve been trying to get VGA Passthrough working on a Rage128 PCI Mac
>>> addition with system-ppc.
>>>
>>> When booting to Mac OS X basic VGA functions work, however trying to enable
>>> 2d or 3d acceleration causes display corruption and makes the system
>>> unusable.
>>>
>>> This also happens with Linux guests, fbdev works for both the tty and the
>>> x-server, but trying to enable DRI with the X11 “ati” driver results in
>>> display corruption and makes the system unusable.
>>>
>>> I’m not sure how to debug this to figure out the corruption issue with
>>> VGA(PCI) Passthrough?
>>
>> (Also cc-ing Gerd Hoffmann who is VGA and USB maintainer so may have more
>> knowledge about this.)
>>
>> I'm not sure either how to debug pci passthrough but maybe you should give
>> more details on what did you did (what versions you used, command line,
>> other things necessary to reproduce what you did) and what errors you see
>> otherwise people probably could only give vague answers at best.
>>
>> I've found this doc about passing through GPU but don't know how useful or
>> accurate is it:
>>
>> https://github.com/intel/nemu/wiki/Testing-VFIO-with-GPU
>>
>> You also may need to run the card ROM from OpenBIOS with my patches by hand
>> to correctly init the card which is not done automatically. We've done this
>> before while testing ati-vga with MacOS so I think you know about it and did
>> that. If the ROM is not run, the card may not be in the state expected by
>> the OS drivers.
>>
>> Also the symptoms you get: works with frame buffer but not when enabling DRI
>> is similar to what I get with the incomplete ati-vga emulation and the
>> reason for that is not being able to use memory buffers accessed via bus
>> master DMA:
>>
>> https://osdn.net/projects/qmiga/ticket/40018
>>
>> So maybe your case is similar, the real card of course has this capability
>> but maybe bus master DMA or accessing the memory buffers is not working for
>> some reason but I don't know how to check that. Maybe somebody has an idea
>> here?
>>
>> Regards,
>> BALATON Zoltan
>