Problem with initializing crossbar on bb-x15 in dom0
Hello,
I am trying to run xen and I have a problem:
https://pastebin.com/U0gch9us on line 190-193
So, it seems that Linux can't discover the irq domaing for crossbar interrupt controller when running in dom0, but it has no problem when running baremetal.
Here is the DT log with xen:
https://drive.google.com/open?id=15YTsCKYUTbG2i-siWezJXKWuG0H1VfQz
(an older version with another mistake) It can be seen that external interrupts are connected to the crossbar interrupt controller.
I found some information about irq domains and crossbars:
https://www.kernel.org/doc/Documentation/IRQ-domain.txt
it seems to me that it is possible to give control on the crossbar to dom0, though, I don't really understand what's happening.
Signature · 1 line
Regards, Denis Obrezkov
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi Denis,
That is about as far as I got....
The driver to handle crossbar is
https://github.com/torvalds/linux/blob/master/drivers/irqchip/irq-crossbar.c
The documentation is
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/arm/omap/crossbar.txt
This is a TI specific driver as far as I know so Xen will probably not understand it.
Iain
Quoted 14 lines · Denis Obrezkov
Hello,
I am trying to run xen and I have a problem:
https://pastebin.com/U0gch9us on line 190-193So, it seems that Linux can't discover the irq domaing for crossbar interrupt controller when running in dom0, but it has no problem when running baremetal.
Here is the DT log with xen:
https://drive.google.com/open?id=15YTsCKYUTbG2i-siWezJXKWuG0H1VfQz
(an older version with another mistake) It can be seen that external interrupts are connected to the crossbar interrupt controller.
Quoted 9 lines
I found some information about irq domains and crossbars:
https://www.kernel.org/doc/Documentation/IRQ-domain.txtit seems to me that it is possible to give control on the crossbar to dom0, though, I don't really understand what's happening.
--
Regards, Denis Obrezkov
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi Iain,
Quoted 7 lines · Iain Hunter
Hi Denis,
That is about as far as I got....The driver to handle crossbar is
https://github.com/torvalds/linux/blob/master/drivers/irqchip/irq-crossbar.c
The documentation is
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/arm/omap/crossbar.txt
Julien recommended me to look at the tegra example:
https://lists.xenproject.org/archives/html/xen-devel/2017-04/msg00991.html
And I believe that Stefano proposed to implement a virtualized crossbar control register.
I am going to try to expose the whole crossbar to the dom0 by mapping it into dom0 and after that to unmap it and restrict the use of the control register via register_mmio_handler. Don't know whether this will work.
Signature · 1 line
Regards, Denis Obrezkov
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
So,
Quoted 4 lines
I am going to try to expose the whole crossbar to the dom0 by mapping it into dom0 and after that to unmap it and restrict the use of the control register via
register_mmio_handler. Don't know whether this will work.
I tried and write now now visible progress:
xen/arch/arm/platforms/omap5.c +4 -0
@@ -23,6 +23,8 @@#include <xen/vmap.h> #include <asm/io.h> +#define OMAP5_CTRL_CORE_MPU_IRQ 0x00000A48 +void omap5_init_secondary (void ); asm ( ".text \n\t"
@@ -124,6 +126,8 @@ static int omap5_specific_mapping(struct domain *d)map_mmio_regions (d,gaddr_to_gfn (OMAP5_SRAM_PA ),32 ,maddr_to_mfn (OMAP5_SRAM_PA )); +map_mmio_regions (d,gaddr_to_gfn (OMAP5_CTRL_CORE_MPU_IRQ ),300 , +maddr_to_mfn (OMAP5_CTRL_CORE_MPU_IRQ ));return 0 ; }
Signature · 1 line
Regards, Denis Obrezkov
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
Quoted 22 lines · Denis Obrezkov
So,
Quoted 4 lines
I am going to try to expose the whole crossbar to the dom0 by mapping it into dom0 and after that to unmap it and restrict the use of the control register via
register_mmio_handler. Don't know whether this will work.I tried and write now now visible progress:
xen/arch/arm/platforms/omap5.c +2
-0@@ -23,6 +23,8 @@#include <xen/vmap.h> #include <asm/io.h> +#define OMAP5_CTRL_CORE_MPU_IRQ 0x00000A48 +void omap5_init_secondary (void ); asm ( ".text \n\t"
xen/arch/arm/platforms/omap5.c static int omap5_specific_mapping(struct domain *d) · line 133
Quoted 8 lines
xen/arch/arm/platforms/omap5.c +2
-0@@ -124,6 +126,8 @@ static int omap5_specific_mapping(struct domain *d)map_mmio_regions (d,gaddr_to_gfn (OMAP5_SRAM_PA ),32 ,maddr_to_mfn (OMAP5_SRAM_PA )); +map_mmio_regions (d,gaddr_to_gfn (OMAP5_CTRL_CORE_MPU_IRQ ),300 , +maddr_to_mfn (OMAP5_CTRL_CORE_MPU_IRQ ));return 0 ; }
I can see there is a mistake in OMAP5_CTRL_CORE_MPU_IRQ address, so, I tried the right address for the MPU crossbar cotrol registers and I also tried to expose the whole control CTRL register but unsurprisingly haven't succeeded.
Signature · 1 line
Regards, Denis Obrezkov
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi Denis,
Quoted 25 lines · Denis Obrezkov
Quoted 24 lines · Denis Obrezkov
So,
Quoted 4 lines
I am going to try to expose the whole crossbar to the dom0 by mapping it into dom0 and after that to unmap it and restrict the use of the control register via
register_mmio_handler. Don't know whether this will work.I tried and write now now visible progress:
xen/arch/arm/platforms/omap5.c +2
-0@@ -23,6 +23,8 @@#include <xen/vmap.h> #include <asm/io.h> +#define OMAP5_CTRL_CORE_MPU_IRQ 0x00000A48 +void omap5_init_secondary (void ); asm ( ".text \n\t"@@ -124,6 +126,8 @@ static int omap5_specific_mapping(struct domain *d)map_mmio_regions (d,gaddr_to_gfn (OMAP5_SRAM_PA ),32 ,maddr_to_mfn (OMAP5_SRAM_PA ));
Quoted 11 lines
xen/arch/arm/platforms/omap5.c static int omap5_specific_mapping(struct domain *d) · line 133
Quoted 6 lines
xen/arch/arm/platforms/omap5.c +2
-0+map_mmio_regions (d,gaddr_to_gfn (OMAP5_CTRL_CORE_MPU_IRQ ),300 , +maddr_to_mfn (OMAP5_CTRL_CORE_MPU_IRQ ));return 0 ; }I can see there is a mistake in
OMAP5_CTRL_CORE_MPU_IRQaddress, so, I tried the right address for the MPU crossbar cotrol registers and I also tried to expose the whole control CTRL register but unsurprisingly haven't succeeded.
The crossbar is described in the Device-Tree, Xen should already map the crossbar in Dom0.
I wasn't able to find any clue in the log (from your first e-mail) that the crossbar is not mapped to Dom0. Actually, per the log, the mapping should have been done:
(XEN) handle /ocp/crossbar@4a002a48
(XEN) dt_irq_number: dev=/ocp/crossbar@4a002a48
(XEN) /ocp/crossbar@4a002a48 passthrough = 1 nirq = 0 naddr = 1 (XEN) DT: ** translation for device /ocp/crossbar@4a002a48 ** (XEN) DT: bus is default (na=1, ns=1) on /ocp
(XEN) DT: translating address:<3> 4a002a48<3>
(XEN) DT: parent bus is default (na=2, ns=2) on / (XEN) DT: walking ranges...
(XEN) DT: default map, cp=0, s=c0000000, da=4a002a48 (XEN) DT: parent translation for:<3> 00000000<3> 00000000<3> (XEN) DT: with offset: 4a002a48
(XEN) DT: one level translation:<3> 00000000<3> 4a002a48<3> (XEN) DT: reached root node
(XEN) - MMIO: 004a002a48 - 004a002b78 P2MType=5
(XEN) handle /ocp/dss@58000000
(XEN) dt_irq_number: dev=/ocp/dss@58000000
(XEN) /ocp/dss@58000000 passthrough = 1 nirq = 0 naddr = 5 (XEN) DT: ** translation for device /ocp/dss@58000000 **
Looking towards the end of the log:
(XEN) traps.c:1998:d0v0 HSR=0x93800007 pc=0xc012bd5c gva=0xfa243404 gpa=0x00000048243404
This means Linux is trying to access the address 0x00000048243404 which was not mapped in the stage-2. This does not seem to belong to the crossbar but PRCM_MPU. The function omap5_specific_mapping() should do the mapping for you. Is it called for your platform?
On a side note, I am not convinced exposing directly (i.e without emulation) the crossbar to dom0 will help us. Per the log, the UART will also use the crossbar:
(XEN) omap-uart: Unable to retrieve the IRQ
(XEN) Unable to initialize dtuart: -22
(XEN) Bad console= option 'dtuart'
So Xen needs to be able to control it. To make things easier, it would probably better to first focus on getting a small crossbar driver in Xen and verify you can use the UART in Xen (such as receiving characters).
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
Quoted 86 lines · Julien Grall
Hi Denis,
Quoted 27 lines · Denis Obrezkov
Quoted 26 lines · Denis Obrezkov
So,
Quoted 6 lines
I am going to try to expose the whole crossbar to the dom0 by mapping it
into dom0 and after that to unmap it and restrict the use of the control
register viaregister_mmio_handler. Don't know whether this will work.I tried and write now now visible progress:
xen/arch/arm/platforms/omap5.c +2
-0@@ -23,6 +23,8 @@ #include <xen/vmap.h> #include <asm/io.h> +#define OMAP5_CTRL_CORE_MPU_IRQ 0x00000A48 + void omap5_init_secondary(void);asm (
".text \n\t"xen/arch/arm/platforms/omap5.c +0
-0@@ -124,6 +126,8 @@ static int omap5_specific_mapping(struct domain *d) map_mmio_regions(d, gaddr_to_gfn(OMAP5_SRAM_PA), 32, maddr_to_mfn(OMAP5_SRAM_PA));Quoted 11 lines
xen/arch/arm/platforms/omap5.c static int omap5_specific_mapping(struct domain *d) · line 133
Quoted 6 lines
xen/arch/arm/platforms/omap5.c +2
-0+ map_mmio_regions(d, gaddr_to_gfn(OMAP5_CTRL_CORE_MPU_IRQ), 300, + maddr_to_mfn(OMAP5_CTRL_CORE_MPU_IRQ)); return 0; }I can see there is a mistake in
OMAP5_CTRL_CORE_MPU_IRQaddress, so, I tried the right address for the MPU crossbar cotrol registers and I also tried to expose the whole control CTRL register but unsurprisingly haven't succeeded.The crossbar is described in the Device-Tree, Xen should already map the crossbar in Dom0.
I wasn't able to find any clue in the log (from your first e-mail) that the crossbar is not mapped to Dom0. Actually, per the log, the mapping should have been done:
(XEN) handle /ocp/crossbar@4a002a48
(XEN)dt_irq_number: dev=/ocp/crossbar@4a002a48
(XEN) /ocp/crossbar@4a002a48 passthrough = 1 nirq = 0 naddr = 1 (XEN) DT: ** translation for device /ocp/crossbar@4a002a48 ** (XEN) DT: bus is default (na=1, ns=1) on /ocp
(XEN) DT: translating address:<3> 4a002a48<3>
(XEN) DT: parent bus is default (na=2, ns=2) on / (XEN) DT: walking ranges...
(XEN) DT: default map, cp=0, s=c0000000, da=4a002a48 (XEN) DT: parent translation for:<3> 00000000<3> 00000000<3> (XEN) DT: with offset:4a002a48
(XEN) DT: one level translation:<3> 00000000<3> 4a002a48<3> (XEN) DT: reached root node
(XEN) - MMIO:004a002a48-004a002b78P2MType=5 (XEN) handle /ocp/dss@58000000
(XEN)dt_irq_number: dev=/ocp/dss@58000000
(XEN) /ocp/dss@58000000 passthrough = 1 nirq = 0 naddr = 5 (XEN) DT: ** translation for device /ocp/dss@58000000 **Looking towards the end of the log:
(XEN) traps.c:1998:d0v0 HSR=0x93800007 pc=0xc012bd5c gva=0xfa243404 gpa=0x00000048243404
This means Linux is trying to access the address
0x00000048243404which was not mapped in the stage-2. This does not seem to belong to the crossbar butPRCM_MPU. The functionomap5_specific_mapping()should do the mapping for you. Is it called for your platform?On a side note, I am not convinced exposing directly (i.e without emulation) the crossbar to dom0 will help us. Per the log, the UART will also use the crossbar:
(XEN) omap-uart: Unable to retrieve the IRQ
(XEN) Unable to initialize dtuart: -22
(XEN) Bad console= option 'dtuart'
Quoted 6 lines
So Xen needs to be able to control it. To make things easier, it would probably better to first focus on getting a small crossbar driver in Xen and verify you can use the UART in Xen (such as receiving characters).
Cheers,
sorry for confusing you, I share a bit outdated log but only to show the output of xen about device tree. We already overcome that error about omap specific mapping (applied one of Iain's patches).
I tried to replicate the tegra version of legacy irq controller support you mentioned in the irq:
https://github.com/embeddedden/xen/commit/180af7ffc8abbbc3ed41dcbc9abc6e8b12daa57a
Now, I have an error:
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading d0 kernel from boot module @ 0000000082000000
(XEN) Loading ramdisk from boot module @ 0000000084000000
(XEN) Allocating 1:1 mappings totalling 512MB for dom0:
(XEN) BANK[0] 0x000000a0000000-0x000000c0000000 (512MB)
(XEN) Grant table range: 0x00000085000000-0x00000085040000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading zImage from 0000000082000000 to
00000000a7c00000-00000000a7fdea20
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to copy the kernel in the hwdom memory
(XEN) ****************************************
Probably, I messed something with remapping.
Signature · 6 lines
Regards, Denis Obrezkov _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 3 lines · Denis Obrezkov
sorry for confusing you, I share a bit outdated log but only to show the output of xen about device tree. We already overcome that error about omap specific mapping (applied one of Iain's patches).
I actually misread the first e-mail and didn't notice the "an older version". Sorry for the noise.
Quoted 4 lines
I tried to replicate the tegra version of legacy irq controller support you mentioned in the irq:
https://github.com/embeddedden/xen/commit/180af7ffc8abbbc3ed41dcbc9abc6e8b12daa57a
rc = unmap_mmio_regions(d, _gfn(pfn_start),
pfn_end + pfn_start + 1, _mfn(pfn_start));
You are not computing correctly the number of pages. I think you want "pfn_end - pfn_start + 1".
But this feels weird to map then unmap the mmio. Instead, you should blacklist the crossbar device. Have a look at the field blacklist_dev in platform_desc.
Cheers,
Signature · 5 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
Quoted 9 lines · Julien Grall
rc = unmap_mmio_regions(d,
_gfn(pfn_start),
pfn_end+pfn_start+ 1,_mfn(pfn_start));You are not computing correctly the number of pages. I think you want "
pfn_end-pfn_start+ 1".
Ok, I changed it and was able to boot to the previous error. I think a logical next step would be to set up the uart somehow?
Quoted 4 lines
But this feels weird to map then unmap the mmio. Instead, you should blacklist the crossbar device. Have a look at the field
blacklist_devinplatform_desc.
Hm, I can see that in the device tree the crossbar has a phandle property <0x00000008> and the main node has an interrupt-parent property 0x00000008. So, all the interrupts seems to be mapped to the crossbar. Wouldn't be that a problem if we blacklist the device? Also, the tegra implementation blacklist only a uart.
Signature · 6 lines
Regards, Denis Obrezkov _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 1 line · Denis Obrezkov
Hi,
Hi Denis,
Quoted 13 lines · Julien Grall
Quoted 9 lines
rc = unmap_mmio_regions(d,
_gfn(pfn_start),
pfn_end+pfn_start+ 1,_mfn(pfn_start));You are not computing correctly the number of pages. I think you want "
pfn_end-pfn_start+ 1".Ok, I changed it and was able to boot to the previous error. I think a logical next step would be to set up the uart somehow?
Do you mean the UART used by Xen?
Quoted 8 lines
Quoted 4 lines
But this feels weird to map then unmap the mmio. Instead, you should blacklist the crossbar device. Have a look at the field
blacklist_devinplatform_desc.Hm, I can see that in the device tree the crossbar has a phandle property <
0x00000008> and the main node has an interrupt-parent property0x00000008. So, all the interrupts seems to be mapped to the crossbar. Wouldn't be that a problem if we blacklist the device?
The Device is owned by Xen, so technically Dom0 does not see the hardware one. Instead it sees a virtual and therefore the node should be created to reflect it.
The purpose of recreating the node is you can alter it to match what we actually exposed to the domain (property values may differ). It may happen that a lot of information are exactly the same as the hardware and can just be copied.
This is, for instance, what we do for the GIC and timer.
Quoted 2 lines
Also, the tegra
implementation blacklist only a uart.
I don't understand this.
Cheers,
Signature · 5 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines
Quoted 2 lines
Ok, I changed it and was able to boot to the previous error. I think a logical next step would be to set up the uart somehow?
Do you mean the UART used by Xen?
Yes, to be able to switch between xen and dom0, to download a produced dt for dom0 for example.
Quoted 15 lines
Quoted 9 lines
Quoted 5 lines
But this feels weird to map then unmap the mmio. Instead, you should blacklist the crossbar device. Have a look at the field
blacklist_devinplatform_desc.Hm, I can see that in the device tree the crossbar has a phandle property <
0x00000008> and the main node has an interrupt-parent property0x00000008. So, all the interrupts seems to be mapped to the crossbar. Wouldn't be that a problem if we blacklist the device?The Device is owned by Xen, so technically Dom0 does not see the hardware one. Instead it sees a virtual and therefore the node should be created to reflect it.
Quoted 6 lines
The purpose of recreating the node is you can alter it to match what we actually exposed to the domain (property values may differ). It may happen that a lot of information are exactly the same as the hardware and can just be copied.
This is, for instance, what we do for the GIC and timer.
I mean if we expose only GIC to the dom0 then we need to change the interrupt-parent property to make all nodes have GIC's phandle as their interrupt-parent. And when dom0 tries to modify irq connections then xen should modify the crossbar. It seems to be a bit error prone approach.
Quoted 5 lines
Quoted 3 lines
Also, the tegra
implementation blacklist only a uart.I don't understand this.
In here [1] you can find that only uart is blacklisted (in tegra_blacklist_dev[]). So, in tegra they didn't blacklist their version of the crossbar.
[1]
https://lists.xenproject.org/archives/html/xen-devel/2017-04/msg00993.html
Signature · 6 lines
Regards, Denis Obrezkov _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi Denis,
Quoted 6 lines · Denis Obrezkov
Quoted 4 lines
Quoted 2 lines
Ok, I changed it and was able to boot to the previous error. I think a logical next step would be to set up the uart somehow?
Do you mean the UART used by Xen?
Yes, to be able to switch between xen and dom0, to download a produced dt for dom0 for example.
Yes it would be sensible to try to implement a crossbar driver in Xen and test with the UART. Looking at the driver in Linux, this should not be too difficult.
Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 5 lines
But this feels weird to map then unmap the mmio. Instead, you should blacklist the crossbar device. Have a look at the field
blacklist_devinplatform_desc.Hm, I can see that in the device tree the crossbar has a phandle property <
0x00000008> and the main node has an interrupt-parent property0x00000008. So, all the interrupts seems to be mapped to the crossbar. Wouldn't be that a problem if we blacklist the device?The Device is owned by Xen, so technically Dom0 does not see the hardware one. Instead it sees a virtual and therefore the node should be created to reflect it.
The purpose of recreating the node is you can alter it to match what we actually exposed to the domain (property values may differ). It may happen that a lot of information are exactly the same as the hardware and can just be copied.
Quoted 5 lines
Quoted 1 line
This is, for instance, what we do for the GIC and timer.
I mean if we expose only GIC to the dom0 then we need to change the interrupt-parent property to make all nodes have GIC's phandle as their interrupt-parent. And when dom0 tries to modify irq connections then xen should modify the crossbar. It seems to be a bit error prone approach.
I don't think I ever suggested to not expose the crossbar to Dom0. Instead, I suggested to virtualize for Dom0, so it can be used by Xen as well.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Also, the tegra
implementation blacklist only a uart.I don't understand this.
In here [1] you can find that only uart is blacklisted (in tegra_blacklist_dev[]). So, in tegra they didn't blacklist their version of the crossbar.
This series has not been merged. In other word, the code is not yet matching the expectations of the maintainers.
I pointed you to this series, because I think some of the idea could be re-used for implementing the crossbar.
In this particular case, it has been suggested to use blacklist_dev rather than unmapping (see [2]).
Cheers,
[2] https://lists.xenproject.org/archives/html/xen-devel/2017-04/msg01979.html
Quoted 1 line
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
Quoted 4 lines · Julien Grall
Yes it would be sensible to try to implement a crossbar driver in Xen and test with the UART. Looking at the driver in Linux, this should not be too difficult.
I don't understand why xen doesn't react on triple Ctrl+a. It probably means that UART's interrupts doesn't work. But I was able to type in u-boot so the uart should be already configured. Or not? Should I set up it in a crossbar first?
Quoted 16 lines
Quoted 2 lines
Quoted 2 lines
I don't think I ever suggested to not expose the crossbar to Dom0. Instead, I suggested to virtualize for Dom0, so it can be used by Xen as well.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Also, the tegra
implementation blacklist only a uart.I don't understand this.
In here [1] you can find that only uart is blacklisted (in tegra_blacklist_dev[]). So, in tegra they didn't blacklist their version of the crossbar.
Quoted 9 lines
This series has not been merged. In other word, the code is not yet matching the expectations of the maintainers.
I pointed you to this series, because I think some of the idea could be re-used for implementing the crossbar.
In this particular case, it has been suggested to use
blacklist_devrather than unmapping (see [2]).
Hm, I thought that idea behind the patch was that they unmap the control register and intercept the calls from Linux to that control register. At the same time they preserved the crossbar in the device tree. And, I thought that you wanted to demonstrate this exact thing. Could you describe how in general the approach with blacklisting should work?
Signature · 6 lines
Regards, Denis Obrezkov _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Denis Obrezkov
Hi,
Quoted 1 line · Julien Grall
Quoted 7 lines
Quoted 3 lines
Yes it would be sensible to try to implement a crossbar driver in Xen and test with the UART. Looking at the driver in Linux, this should not be too difficult.
I don't understand why xen doesn't react on triple Ctrl+a. It probably means that UART's interrupts doesn't work. But I was able to type in u-boot so the uart should be already configured. Or not? Should I set up it in a crossbar first?
Xen is not able to deal with the crossbar. It means it cannot translate the interrupt and therefore cannot initialize the UART:
(XEN) omap-uart: Unable to retrieve the IRQ
(XEN) Unable to initialize dtuart: -22
(XEN) Bad console= option 'dtuart'
From my understanding, even if you are able to translate it, you don't
know how U-boot configured the crossbar. In other words, you don't know which GIC Interrupt ID was used for the UART. So, you still need to configure the crossbar in Xen.
Quoted 22 lines
Quoted 22 lines
Quoted 2 lines
Quoted 2 lines
I don't think I ever suggested to not expose the crossbar to Dom0. Instead, I suggested to virtualize for Dom0, so it can be used by Xen as well.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Also, the tegra
implementation blacklist only a uart.I don't understand this.
In here [1] you can find that only uart is blacklisted (in tegra_blacklist_dev[]). So, in tegra they didn't blacklist their version of the crossbar.
This series has not been merged. In other word, the code is not yet matching the expectations of the maintainers.
I pointed you to this series, because I think some of the idea could be re-used for implementing the crossbar.
Quoted 8 lines
Quoted 3 lines
In this particular case, it has been suggested to use
blacklist_devrather than unmapping (see [2]).Hm, I thought that idea behind the patch was that they unmap the control register and intercept the calls from Linux to that control register. At the same time they preserved the crossbar in the device tree. And, I thought that you wanted to demonstrate this exact thing.
I think unmapping something you just mapped is a gross hack. It would be best if this can be avoided.
Also, I am also not entirely convince we want to fully preserve the crossbar node in the DT. It will depend how the crossbar will be virtualized for Dom0.
From my understanding, the crossbar is able to handle N irqs. For each
irqs, there will be a corresponding register.
The simplest approach would be to expose exactly the same crossbar to Dom0 and trap all the access. Any access to registers associated to IRQs used by Xen would just be ignored. In this approach, we would probably want to update ti-irqs-skip/ti,irqs-reserved.
Quoted 2 lines
Could you
describe how in general the approach with blacklisting should work?
I didn't fully thought through so far.
On a second thought, this may not work correctly. We want to keep the crossbar node path the same to avoid issue with aliasing (see /aliases).
So probably the best would be to match the crossbar compatible and then alter anything we want. See how we deal with the GIC in make_gic_node.
In summary:
1) A platform callback (maybe platform_specific_mapping) will hook
the handlers for the crossbar
2) handle_node is extended to catch the crossbar node. For now, ,
you could hack domain_build.c to match the callback. This allows you to focus on virtualizing the crossbar. We can discuss a better approach later on.
Cheers,
Signature · 5 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 63 lines · Julien Grall
Quoted 5 lines · Denis Obrezkov
Hi,
Quoted 1 line · Julien Grall
Quoted 7 lines
Quoted 3 lines
Yes it would be sensible to try to implement a crossbar driver in Xen and test with the UART. Looking at the driver in Linux, this should not be too difficult.
I don't understand why xen doesn't react on triple Ctrl+a. It probably means that UART's interrupts doesn't work. But I was able to type in u-boot so the uart should be already configured. Or not? Should I set up it in a crossbar first?
Xen is not able to deal with the crossbar. It means it cannot translate the interrupt and therefore cannot initialize the UART:
(XEN) omap-uart: Unable to retrieve the IRQ
(XEN) Unable to initialize dtuart: -22
(XEN) Bad console= option 'dtuart'From my understanding, even if you are able to translate it, you don't
know how U-boot configured the crossbar. In other words, you don't know which GIC Interrupt ID was used for the UART. So, you still need to configure the crossbar in Xen.Quoted 22 lines
Quoted 22 lines
Quoted 2 lines
Quoted 2 lines
I don't think I ever suggested to not expose the crossbar to Dom0. Instead, I suggested to virtualize for Dom0, so it can be used by Xen as well.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Also, the tegra
implementation blacklist only a uart.I don't understand this.
In here [1] you can find that only uart is blacklisted (in tegra_blacklist_dev[]). So, in tegra they didn't blacklist their version of the crossbar.
This series has not been merged. In other word, the code is not yet matching the expectations of the maintainers.
I pointed you to this series, because I think some of the idea could be re-used for implementing the crossbar.
Quoted 8 lines
Quoted 3 lines
In this particular case, it has been suggested to use
blacklist_devrather than unmapping (see [2]).Hm, I thought that idea behind the patch was that they unmap the control register and intercept the calls from Linux to that control register. At the same time they preserved the crossbar in the device tree. And, I thought that you wanted to demonstrate this exact thing.
I think unmapping something you just mapped is a gross hack. It would be best if this can be avoided.
Also, I am also not entirely convince we want to fully preserve the crossbar node in the DT. It will depend how the crossbar will be virtualized for Dom0.
Quoted 7 lines
From my understanding, the crossbar is able to handle N irqs. For each
irqs, there will be a corresponding register.The simplest approach would be to expose exactly the same crossbar to Dom0 and trap all the access. Any access to registers associated to IRQs used by Xen would just be ignored. In this approach, we would probably want to update ti-irqs-skip/ti,irqs-reserved.
This is similar to what I suggested to Denis on IRC. Denis, is you still have the logs, you should find some more pointers in the same direction.
Quoted 11 lines
Quoted 2 lines
Could you
describe how in general the approach with blacklisting should work?I didn't fully thought through so far.
On a second thought, this may not work correctly. We want to keep the crossbar node path the same to avoid issue with aliasing (see /aliases).
So probably the best would be to match the crossbar compatible and then alter anything we want. See how we deal with the GIC in
make_gic_node.
Quoted 7 lines
In summary:
1) A platform callback (maybeplatform_specific_mapping) will hook
the handlers for the crossbar
2)handle_nodeis extended to catch the crossbar node. For now, ,
you could hackdomain_build.cto match the callback. This allows you to focus on virtualizing the crossbar. We can discuss a better approach later on.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel