Mailing List Archive

Help on passthrough serial device to BareMetal DOMU
Hello everybody,

we are fairly new to XEN and have a few questions regarding our XEN
setup on Xilinx ZCU102 Board. We want to pass through the UART1 device
to a bare metal guest. The way Xilinx proposed in their documentation to
XEN BareMetal Guests is to add the following via an .dtsi file to the
device tree:

&&uart1 {
   xen,passthrough = <0x1>;
};


Unfortunately, this does not work for us, we don't get any output on our
serial console.

We are using the config file which was provided by xilinx:


#Guest name
  name = "hello_world"
# Kernel image to boot
  kernel = "xapp_hello_world_el1.bin"
# Kernel command line options - Allocate 8MB
  memory = 8
# Number of VCPUS
  vcpus = 1
# Pin to CPU 0
  cpus = [1]
  irqs = [ 54 ]
  iomem = [ "0xff010,1" ]

Maybe someone can give a few tips, which steps are necessary to pass a
device to a bare metal DOMU, or point out where we missed something.

Regards,

Jan


_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Help on passthrough serial device to BareMetal DOMU [ In reply to ]
On 7/26/19 7:27 AM, Jan Cordes wrote:
> Hello everybody,
>
> we are fairly new to XEN and have a few questions regarding our XEN
> setup on Xilinx ZCU102 Board. We want to pass through the UART1 device
> to a bare metal guest. The way Xilinx proposed in their documentation to
> XEN BareMetal Guests is to add the following via an .dtsi file to the
> device tree:
>
> &&uart1 {
>    xen,passthrough = <0x1>;
> };
>
>
> Unfortunately, this does not work for us, we don't get any output on our
> serial console.
>
> We are using the config file which was provided by xilinx:
>
>
> #Guest name
>   name = "hello_world"
> # Kernel image to boot
>   kernel = "xapp_hello_world_el1.bin"
> # Kernel command line options - Allocate 8MB
>   memory = 8
> # Number of VCPUS
>   vcpus = 1
> # Pin to CPU 0
>   cpus = [1]
>   irqs = [ 54 ]
>   iomem = [ "0xff010,1" ]
>
> Maybe someone can give a few tips, which steps are necessary to pass a
> device to a bare metal DOMU, or point out where we missed something.

I'm not sure, but if I had this problem myself I would investigate whether Xen might be treating the serial port differently since Xen has a serial
console. You could test syntax with a different device Xen doesn't have drivers for, or try changing the serial settings in the Xen boot arguments.

--Sarah

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Help on passthrough serial device to BareMetal DOMU [ In reply to ]
(+ Stefano)

Hi,

On 26/07/2019 16:35, Sarah Newman wrote:
> On 7/26/19 7:27 AM, Jan Cordes wrote:
>> Hello everybody,
>>
>> we are fairly new to XEN and have a few questions regarding our XEN
>> setup on Xilinx ZCU102 Board. We want to pass through the UART1 device
>> to a bare metal guest. The way Xilinx proposed in their documentation to
>> XEN BareMetal Guests is to add the following via an .dtsi file to the
>> device tree:
>>
>> &&uart1 {
>>     xen,passthrough = <0x1>;
>> };
>>
>>
>> Unfortunately, this does not work for us, we don't get any output on our
>> serial console.
>>
>> We are using the config file which was provided by xilinx:
>>
>>
>> #Guest name
>>    name = "hello_world"
>> # Kernel image to boot
>>    kernel = "xapp_hello_world_el1.bin"
>> # Kernel command line options - Allocate 8MB
>>    memory = 8
>> # Number of VCPUS
>>    vcpus = 1
>> # Pin to CPU 0
>>    cpus = [1]
>>    irqs = [ 54 ]
>>    iomem = [ "0xff010,1" ]
>>
>> Maybe someone can give a few tips, which steps are necessary to pass a
>> device to a bare metal DOMU, or point out where we missed something.
>
> I'm not sure, but if I had this problem myself I would investigate whether Xen
> might be treating the serial port differently since Xen has a serial console.
> You could test syntax with a different device Xen doesn't have drivers for, or
> try changing the serial settings in the Xen boot arguments.

As long as the serial port is not used by Xen, then you should be able to
passthrough to a guest. If Xen were using the UART, then I would expect libxl to
fail creating the domain.

A couple of questions regarding the setup:
- Which version of Xen are you using?
- What is your Xen command line?
- Do you have any output from Xen and Dom0? If so, can you paste it?

Cheers,

--
Julien Grall

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Help on passthrough serial device to BareMetal DOMU [ In reply to ]
On Tue, 30 Jul 2019, Julien Grall wrote:
> (+ Stefano)
>
> Hi,
>
> On 26/07/2019 16:35, Sarah Newman wrote:
> > On 7/26/19 7:27 AM, Jan Cordes wrote:
> > > Hello everybody,
> > >
> > > we are fairly new to XEN and have a few questions regarding our XEN
> > > setup on Xilinx ZCU102 Board. We want to pass through the UART1 device
> > > to a bare metal guest. The way Xilinx proposed in their documentation to
> > > XEN BareMetal Guests is to add the following via an .dtsi file to the
> > > device tree:
> > >
> > > &&uart1 {
> > >     xen,passthrough = <0x1>;
> > > };

Yes, this is the only change required to the host device tree (with only
one '&'). You can also add "xen,passthrough = <0x1>;" by hand under the
uart node that you want to assign to the baremetal guest:

serial@ff010000 {
u-boot,dm-pre-reloc;
compatible = "cdns,uart-r1p12", "xlnx,xuartps";
status = "okay";
interrupt-parent = <0x4>;
interrupts = <0x0 0x16 0x4>;
reg = <0x0 0xff010000 0x0 0x1000>;
clock-names = "uart_clk", "pclk";
power-domains = <0x26 0x22>;
clocks = <0x3 0x39 0x3 0x1f>;
pinctrl-names = "default";
pinctrl-0 = <0x38>;
cts-override;
device_type = "serial";
port-number = <0x1>;
xen,passthrough = <0x1>;
};

and recompile the device tree with:

dtc -I dts -O dtb mpsoc.dts > mpsoc.dtb


> > > Unfortunately, this does not work for us, we don't get any output on our
> > > serial console.
> > >
> > > We are using the config file which was provided by xilinx:
> > >
> > >
> > > #Guest name
> > >    name = "hello_world"
> > > # Kernel image to boot
> > >    kernel = "xapp_hello_world_el1.bin"
> > > # Kernel command line options - Allocate 8MB
> > >    memory = 8
> > > # Number of VCPUS
> > >    vcpus = 1
> > > # Pin to CPU 0
> > >    cpus = [1]
> > >    irqs = [ 54 ]
> > >    iomem = [ "0xff010,1" ]
> > >
> > > Maybe someone can give a few tips, which steps are necessary to pass a
> > > device to a bare metal DOMU, or point out where we missed something.

This is correct.

My guess is that the device tree change above wasn't applied correctly
somehow?