On 11/09/2023 07:25, bot crack wrote:
hi,
Now I change my a configuration to:
/.platform_info = {
.pci_mmconfig_base = 0xe0000000, // virt address
.pci_mmconfig_end_bus = 0,
.pci_is_virtual = 1,
.pci_domain = 1,
/
/............./

Then I didn’t see the error log
/[   35.130190] pci-host-generic e0000000.pci: host bridge /pci@0 ranges:
[   35.130241] pci-host-generic e0000000.pci:      MEM 0x00e0100000..0x00e0101fff -> 0x00e0100000 [   35.130295] pci-host-generic e0000000.pci: ECAM at [mem 0xe0000000-0xe00fffff] for [bus 00]
[   35.130457] pci-host-generic e0000000.pci: PCI host bridge to bus 0001:00
[   35.130470] pci_bus 0001:00: root bus resource [bus 00]
[   35.130480] pci_bus 0001:00: root bus resource [mem 0xe0100000-0xe0101fff]
[   35.130519] pci 0001:00:00.0: [110a:4106] type 00 class 0xff0000
[   35.130545] pci 0001:00:00.0: reg 0x10: [mem 0x00000000-0x00000fff]
[   35.137255] pci 0001:00:00.0: BAR 0: assigned [mem 0xe0100000-0xe0100fff]
/
/[   35.137602] The Jailhouse is opening.
[   35.251548] vcc3v3_lcd1_n: disabling
[   35.285180] psci: CPU3 killed (polled 0 ms)
/


Then I insert uio_ivshmem.ko (build from https://github.com/henning-schild-work/ivshmem-guest-code/tree/jailhouse)
/[   35.287908] Created Jailhouse cell "inmate-demo"
[   50.988039] uio_ivshmem 0001:00:00.0: ivshmem_pci_proben
[   50.988085] uio_ivshmem 0001:00:00.0: enabling device (0000 -> 0002)
[   50.988548] uio_ivshmem 0001:00:00.0: using jailhouse mode/
/
/
/
/
Then run /usr/local/sbin/ivshmem-demo and it will show mmap failure.
ID = 0
Maximum peers = 3
/usr/local/sbin/ivshmem-demo: mmap(state): No such device

I never used uio-ivshmem, so I don't know internals. You could use strace to see which mmap fails and why.

  Ralf



Why does mmap fail?
On Saturday, September 9, 2023 at 7:38:59 PM UTC+8 Ralf Ramsauer wrote:



    On 09/09/2023 08:04, bot crack wrote:
     > Hi, everybody
     >
     > I encountered some problems when using ivshmem-demo. How should I
    set
     > the value of pci_mmconfig_base?

    Set it to a region where it does physically not collide with any other
    IO/Memory.

     >
     > my rootcell:
     > /.platform_info = {
     > .pci_mmconfig_base = 0x7BC00000,
     > .pci_mmconfig_end_bus = 0,
     > .pci_is_virtual = 1,
     > .pci_domain = 1,
     > .arm = {
     > .gic_version = 3,/
     >
     > .......
     >
     >
     > my linux dts:
     > /&reserved_memory {
     >
     > jailhouse: jailhouse@0x70000000{
     > reg = <0x0 0x70000000 0x0 0xBC00000>;
     > alignment = <0x1000>;
     > no-map;
     > status = "okay";
     > };
     >
     > pci_reserved: pci@0x7BC00000{
     > reg = <0x0 0x7BC00000 0x0 0x00200000>;
     > alignment = <0x1000>;
     > no-map;
     > status = "okay";
     > };

    There's no need to reserve it via device tree, because it isn't backed
    with anything in any case.

     >
     > };
     > /
     > Kernel output after inserting jailhouse.ko
     > /[  264.612191] jailhouse: loading out-of-tree module taints kernel.
     > [  264.624958] pci-host-generic 7bc00000.pci: host bridge /pci@0
    ranges:
     > [  264.625007] pci-host-generic 7bc00000.pci:      MEM
     > 0x007bd00000..0x007bd01fff -> 0x007bd00000
     > [  264.625028] pci-host-generic 7bc00000.pci: *resource
    collision: [mem
     > 0x7bd00000-0x7bd01fff] conflicts with reserved [mem
    0x70000000-0x7bdfffff]*

    This happens due to your device tree reservation. If there's nothing
    behind 0x7bc..., then simply go without reservation.

     > [  264.625051] pci-host-generic: probe of 7bc00000.pci failed
    with error -12
     > [  264.625475] The Jailhouse is opening.
     > [  264.792429] psci: CPU3 killed (polled 0 ms)
     > [  264.794210] Created Jailhouse cell "inmate-demo"
     > /
     > The operating environment is arm64, linux5.10.160
     >
     > *How should I set the value of pci_mmconfig_base?*

    See above, a free (ideally aligned) memory region in your physical
    address space.

    Ralf

     >
     > --
     > You received this message because you are subscribed to the Google
     > Groups "Jailhouse" group.
     > To unsubscribe from this group and stop receiving emails from it,
    send
     > an email to [email protected]
     > <mailto:[email protected]>.
     > To view this discussion on the web visit
     >
    
https://groups.google.com/d/msgid/jailhouse-dev/3ffc8cc2-0592-463f-ab65-bd51c2d0ed83n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/3ffc8cc2-0592-463f-ab65-bd51c2d0ed83n%40googlegroups.com>
 
<https://groups.google.com/d/msgid/jailhouse-dev/3ffc8cc2-0592-463f-ab65-bd51c2d0ed83n%40googlegroups.com?utm_medium=email&utm_source=footer
 
<https://groups.google.com/d/msgid/jailhouse-dev/3ffc8cc2-0592-463f-ab65-bd51c2d0ed83n%40googlegroups.com?utm_medium=email&utm_source=footer>>.

--
You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/c9479468-1514-439a-a775-5eb2d25877f3n%40googlegroups.com <https://groups.google.com/d/msgid/jailhouse-dev/c9479468-1514-439a-a775-5eb2d25877f3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/17cc3819-f515-4be0-8302-16333e580a22%40oth-regensburg.de.

Reply via email to