re: radeon RV730 in iMac troubleshooting

2023-11-13 Thread matthew green
ah, i am reminded of this channge that went in recently:

   https://mail-index.netbsd.org/source-changes/2023/11/06/msg148463.html

can you try a -current snapshot and see if it works less badly?


.mrg.


re: radeon RV730 in iMac troubleshooting

2023-11-13 Thread matthew green
some random ideas/info about this, no real help yet.

Josh Moyer writes:
> I hacked kern/init_main.c to panic on line 739 before the display goes dark 
> and the last two dmesgs are:
> 
> pci_mem_find: void region (dev/pci/pci_map.c)

hmm, this one happens when the mapping size is 0.  can you post the
output of "pcictl pciN dump -d 0", for whatever "radeon0 at pciN"
matches the dmesg logs, for a boot that disabled radeon0.

> radeon0: map 5 failed (could not find corresponding source file)

this comes from sys/external/bsd/drm2/pci/drm_pci.c:

115 if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, reg, type,
116 >bm_base, >bm_size, >bm_flags) != 0) {
117 aprint_debug_dev(self, "map %u failed\n", unit);

which is basically reporting the same error.  BAR5 has no size.

this may be related to it not doing a POST properly, and our code
isn't properly doing that first.. eg, radeon_r300.c:r300_init()
calls radeon_boot_test_post_card(), which will do POST if it has
not been done... though it relies upon vbios being found.


.mrg.


radeon RV730 in iMac troubleshooting

2023-11-13 Thread Josh Moyer
Hi Tech-Kern,
Sadly, the radeon DRM2 driver must be disabled with userconf in order to 
successfully boot a mid 2010 21.5" iMac (Radeon HD 4670 256MB/RV730) -- 
otherwise the screen goes black when the kernel is switching to userland/init.  
I'm using 10_RC1 and also had this problem in the beta and also in 9, I think.

I hacked kern/init_main.c to panic on line 739 before the display goes dark and 
the last two dmesgs are:

pci_mem_find: void region (dev/pci/pci_map.c)
radeon0: map 5 failed (could not find corresponding source file)

Oddly, ddb isn't invoked, despite ddb.onpanic=1, so I can't generate a kernel 
memory dump.

I tried getting more debug output by using various config options, including 
the following without much luck: DIAGNOSTIC, DEBUG, DRM_DEBUG, DRM2_DEBUG, 
RADEON_DEBUG

I even tried to comment out radeon and uncomment radeondrm in the config, but 
get a lot of errors at link time complaining about undefined references in the 
radeondrm code.

Before I start hacking at pci_map.c, I wanted to check if anyone has any 
insights or experience or suggestions in this area.

Thanks in advance for your help.  Really want that hardware acceleration -- 
surprise, surprise! ;-)

_
   | * * |   Josh Moyer (he/him) 
   |*(*)*|   http://jmoyer.nodomain.net/
\ - /http://www.nodomain.net/
 \// 
 Love, Responsibility, Justice
 Liebe, Verantwortung, Gerechtigkeit
 
 Please don't eat the animals.
 Thanks.



Re: PVH boot with qemu

2023-11-13 Thread Manuel Bouyer
On Mon, Nov 13, 2023 at 06:37:01AM +0100, Emile `iMil' Heitor wrote:
> 
> I first asked guidance in port-xen@ but the topic doesn't seem to have much
> success, I'll try my chances here.
> 
> I am trying to make NetBSD/amd64 boot in PVH mode with qemu, using qemu's
> -kernel flag. The kernel does start executing thanks to the first step
> explained here 
> https://www.daemonology.net/blog/2022-10-18-FreeBSD-Firecracker.html
> i.e. adding PVH entry point to the kernel ELF notes.
> 
>#define ELFNOTE(name, type, desctype, descdata...) \
>   -.pushsection .note.name;   \
>   +.pushsection .note.name, "a", @note;   \
>  .align 4 ;   \
>  .long 2f - 1f/* namesz */;   \
>  .long 4f - 3f/* descsz */;   \
>   @@ -588,6 +603,8 @@ next:   pop %edi
>   movl%eax,(%ebp)
> 
> The start_xen32 entrypoint is then found, and the kernel start, but falls in
> an infinite loop in locore.S when mapping symbols and preloaded modules,
> more precisely, in the fillkpt_nox macro. I assume %ecx is wrong or the region
> corrupted for some reason. 
> https://github.com/NetBSD/src/blob/trunk/sys/arch/amd64/amd64/locore.S#L738

I don't think you can use start_xen32 as is, as it expects a Xen environnemwnt.
You may need to write a new start routine, or make a difference between Xen
vs non-Xen in the existing one.

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--