[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Booting the FreeBSD kernel as an zImage file needs a patch upgrade ?.



---> The first step is I would suggest checking if the FreeBSD kernel was built with Xen options.

I've added this to GENERIC kernel of FreeBSD guest :

# Xen HVM Guest Optimizations

# NOTE: XENHVM depends on xenpci. They must be added or removed together.
options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver

Unfortunately,it is not accepted :

unknown option "XENHVM"

Why ? 


On Wed, Jan 10, 2024 at 4:22 PM Mario Marietto <marietto2008@xxxxxxxxx> wrote:
@Warner Losh : I think that you,as a very experienced FreeBSD developer,can give some good suggestions and pointers to what I should do at this point,because we are jumping to fix what's missing in FreeBSD.

On Wed, Jan 10, 2024 at 4:10 PM Mario Marietto <marietto2008@xxxxxxxxx> wrote:
>... the ps output, it seems that ``xl create`` completed and you have the console open. So the freeze you mention is just because your FreeBSD guest is not outputting anything.

>As mentioned earlier, I don't think a lot of testing has been done for 32-bit Arm FreeBSD. So it is quite possible that there are some pieces of code missing.

> The first step is I would suggest checking if the FreeBSD kernel was built with Xen options.

> If they are, then you will need to find out where FreeBSD is stuck (or why the console is not enabled). Unfortunately, we don't have any
support to use GDB on the guest kernel. So you will have to modify FreeBSD a bit to check whether it can stick.

> Assuming you have a debug build of the hypervisor, then you can sprinkle the FreeBSD boot code with the assembly instruction 'hvc 0xfffc'.

> When this is reached, this will issue an hypercall that will print on the Xen console that the given instruction has reached (the PC will be printed). There are other useful 'hvc' calls implemented by Xen for low level debugging. You can look at do_debug_trap() in Xen code.


...this goes beyond my abilities...It needs some advanced FreeBSD system admin / developer to understand what to do. I hope someone can help me...or this project will end here and will be a shame after the time and the efforts that I put in there. Can you tell me if a JTAG debugger can help me to debug what happens on the FreeBSD guest ? Thanks.



On Wed, Jan 10, 2024 at 2:43 PM Julien Grall <julien@xxxxxxx> wrote:
Hi,

On 09/01/2024 22:56, Mario Marietto wrote:
> Maybe it works ? Since I see these two processes enabled...but I don't know
> how to use FreeBSD...

Looking at the rest of the discussion, your script start-freebsd
contains the following lines:

xl create freebsd.cfg
xl console freebsd

 From the logs and ...

>
> # ps ax
> 2606 ?        Ssl    0:00 xl -vvvv create freebsd.cfg
> 2607 pts/0    Sl+    0:00 /usr/lib/xen-4.17/bin/xenconsole 1 --num 0 --type
> pv

... the ps output, it seems that ``xl create`` completed and you have
the console open. So the freeze you mention is just because your FreeBSD
guest is not outputting anything.

As mentioned earlier, I don't think a lot of testing has been done for
32-bit Arm FreeBSD. So it is quite possible that there are some pieces
of code missing.

The first step is I would suggest to check the FreeBSD kernel was built
with Xen options.

If they are, then you will need to find out where FreeBSD is stuck (or
why the console is not enabled). Unfortunately, we don't have any
support to use GDB on the guest kernel. So you will have to modify
FreeBSD a bit to check whether it can stuck.

Assuming you have a debug build of the hypervisor, then you can sprinkle
the FreeBSD boot code with the assembly instruction 'hvc 0xfffc'.

When this is reached, this will issue an hypercall that will print on
Xen console that the given instruction as reached (the PC will be
printed). There are other useful 'hvc' call implemented by Xen for low
level debugging. You can look at do_debug_trap() in Xen code.

I hope this helps.

Cheers,

--
Julien Grall


--
Mario.


--
Mario.


--
Mario.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.