Re: ivshmem-net on zynqmp with hardware based PCIe controller

2021-10-14 Thread Andreas Messerschmid



On 14.10.21 11:43, Jan Kiszka wrote:
> On 06.10.21 11:32, Andreas Messerschmid wrote:
>> Hi all,
>>
>> did anyone already implement an ivshmem-net link between two Linux cells
>> using the ZynqMP PCIe hardware instead of a virtual PCI interface? What
>> about MSI/MSI-X in this case?
>>
>> Any hints/success stories on this?
>>
> 
> I've looked into that topics for a couple of ARM boards, again and
> again, but so far only the (historic) AMD Seattle was fulfilling all
> conditions to allow PCI device partitioning more or less easily (but
> that thing had no IOMMU IIRC, this this was incomplete). On other HW,
> you have a combination of these issues (or even the full list):
> 
>  - missing differentiation of PCI devices on the SMMU in front of the
>host controller
>  - missing way to inject ivshmem interrupts at the point where the OS
>would expect them from a real device
>  - complex PCI host controller, deviating from the generic one,
>requiring extra logic to intercept config space accesses or even more
>  - things I forgot
> 
> Therefore, it is generally easier to add a virtual PCI host controller,
> even if the SOC already has a real one.

Thanks, Jan.

So maybe the easiest way to go is possibly to keep the virtual PCI host
for ivshmem and move the entire hardware PCIe controller to a non-root
cell if PCIe devices need to be served there.

Andreas

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/41502048-c005-69b2-c73e-53e8824a6af2%40linutronix.de.


ivshmem-net on zynqmp with hardware based PCIe controller

2021-10-06 Thread Andreas Messerschmid
Hi all,

did anyone already implement an ivshmem-net link between two Linux cells
using the ZynqMP PCIe hardware instead of a virtual PCI interface? What
about MSI/MSI-X in this case?

Any hints/success stories on this?


Thanks,
Andreas

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/001fe6b2-286e-26b3-c820-6b184cc5c76c%40linutronix.de.


Re: [PATCH 1/3] configs: miriac-sbc-ls1046a: remove mem region numbering

2019-04-03 Thread Andreas Messerschmid
Hi Henning,

On 3/26/19 3:25 PM, Henning Schild wrote:
> Hey,
> 
> the first two commits are purely cosmetic, and p3 fixes an issue i saw
> on a ls1043a-rdb. The whole series is not tested since i do not have
> the hardware to do so.
> 
> Andreas could you please test this. Before the patch you should see a
yes, for sure I can do some tests on this (but I need some days to get
back on this topic).

Andreas

> significant amount of packet loss after "jailhouse enable". Test
> command from a remote machine could be
> 
> "fping -l ls1043 -b 1200 -p 10"
> 
> After the patch the packet loss should get back down to 0% even when
> jailhouse is enabled.
> 
> Henning
> 
> Am Tue, 26 Mar 2019 15:19:57 +0100
> schrieb Henning Schild :
> 
>> From: Henning Schild 
>>
>> This commit just changes the comments and removes the indices from the
>> the region comments. These numbers make it hard to add or remove
>> regions without touching most of the file.
>>
>> Signed-off-by: Henning Schild 
>> ---
>>  configs/arm64/miriac-sbc-ls1046a.c | 100
>> ++--- 1 file changed, 50 insertions(+), 50
>> deletions(-)
>>
>> diff --git a/configs/arm64/miriac-sbc-ls1046a.c
>> b/configs/arm64/miriac-sbc-ls1046a.c index a8fb5b4c..98275d48 100644
>> --- a/configs/arm64/miriac-sbc-ls1046a.c
>> +++ b/configs/arm64/miriac-sbc-ls1046a.c
>> @@ -74,349 +74,349 @@ struct {
>>  },
>>  
>>  .mem_regions = {
>> -/* 0 - DDR memory controller */ {
>> +/* DDR memory controller */ {
>>  .phys_start = 0x0108,
>>  .virt_start = 0x0108,
>>  .size =   0x1000,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 1 - IFC */ {
>> +/* IFC */ {
>>  .phys_start = 0x0153,
>>  .virt_start = 0x0153,
>>  .size =  0x1,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 2 - QSPI */ {
>> +/* QSPI */ {
>>  .phys_start = 0x0155,
>>  .virt_start = 0x0155,
>>  .size = 0x1,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 3 - esdhc */ {
>> +/* esdhc */ {
>>  .phys_start = 0x0156,
>>  .virt_start = 0x0156,
>>  .size = 0x1,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 4 - scfg */ {
>> +/* scfg */ {
>>  .phys_start = 0x0157,
>>  .virt_start = 0x0157,
>>  .size = 0x1,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 5 - crypto */ {
>> +/* crypto */ {
>>  .phys_start = 0x0170,
>>  .virt_start = 0x0170,
>>  .size = 0x10,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 6 - qman */ {
>> +/* qman */ {
>>  .phys_start = 0x0188,
>>  .virt_start = 0x0188,
>>  .size = 0x1,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 7 - bman */ {
>> +/* bman */ {
>>  .phys_start = 0x0189,
>>  .virt_start = 0x0189,
>>  .size = 0x1,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 8 - fman */ {
>> +/* fman */ {
>>  .phys_start = 0x01a0,
>>  .virt_start = 0x01a0,
>>  .size = 0x10,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 9 - qportals */ {
>> +/* qportals */ {
>>  .phys_start = 0x5,
>>  .virt_start = 0x5,
>>  .size = 0x800,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_IO,
>>  },
>> -/* 10 - bportals */ {
>> +/* bportals */ {
>>  .phys_start = 0x50800,
>>  .virt_start = 0x50800,
>>  .size = 0x800,
>>  .flags = JAILHOUSE_MEM_READ |
>> JAILHOUSE_MEM_WRITE 

Re: [PATCH 0/4] Add Microsys miriac SBC-LS1046A board support

2019-03-07 Thread Andreas Messerschmid
Hi Henning,

On 3/7/19 2:32 PM, Henning Schild wrote:
> Hi Andreas,
> 
> for how long did you test running jailhouse on the device? And did you
> operate it via serial or network?
I did not have 'ultra long' test periods but the device was running
overnight without any problems. I was using the serial port and the
network interfaces too. Even migration of the network interfaces to a
Linux guest worked without any problems.

> I am currently enabling an ls1043 and network breaks after just
> creating a second cell, not even loading or starting it. I guess in
> that line i would also like to know which kernel you used and which
> device tree, to understand whether you used DPAA from mainline or the
> SDK-Version from NXP.
I was using mainline Linux 4.19.5-rt4 (Jailhouse patches from
git://git.kiszka.org/linux.git -> queues/jailhouse on top) with the DPAA
driver from there. Devicetree from this series
https://lkml.org/lkml/2018/9/3/482.

Andreas

> 
> In fact a simple offlining of a CPU breaks networking, no jailhouse no
> funny stuff:
> echo 0 > /sys/devices/system/cpu/cpu3/online
> 
> And that would be for LSDK-18.09-V4.14 from
> https://source.codeaurora.org/external/qoriq/qoriq-components/linux
> Using the mainline driver stack.
> 
> regards,
> Henning
> 
> Am Tue, 29 Jan 2019 10:00:24 +0100
> schrieb :
> 
>> From: Andreas Messerschmid 
>>
>> This series adds support for the miriac SBC-LS1046A to Jailhouse.
>>
>> Andreas Messerschmid (4):
>>   configs: miriac-sbc-ls1046a: Add root cell configuration
>>   configs: miriac-sbc-ls1046a: Add GIC demo inmate configuration
>>   configs: miriac-sbc-ls1046a: Add linux inmate demo configuration
>>   configs: miriac-sbc-ls1046a: Add linux inmate demo dts
>>
>>  configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts | 106 ++
>>  configs/arm64/miriac-sbc-ls1046a-gic-demo.c |  74 
>>  configs/arm64/miriac-sbc-ls1046a-linux-demo.c   | 137 +++
>>  configs/arm64/miriac-sbc-ls1046a.c  | 458
>>  4 files changed, 775 insertions(+)
>>  create mode 100644 configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts
>>  create mode 100644 configs/arm64/miriac-sbc-ls1046a-gic-demo.c
>>  create mode 100644 configs/arm64/miriac-sbc-ls1046a-linux-demo.c
>>  create mode 100644 configs/arm64/miriac-sbc-ls1046a.c
>>
> 

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[siemens/jailhouse] ae8b27: x86: vtd: Ignore lower two bits when evaluating VT...

2019-02-01 Thread Andreas Messerschmid
  Branch: refs/heads/master
  Home:   https://github.com/siemens/jailhouse
  Commit: ae8b272f997bc720efc7f18476e5a407e2580ead
  
https://github.com/siemens/jailhouse/commit/ae8b272f997bc720efc7f18476e5a407e2580ead
  Author: Jan Kiszka 
  Date:   2019-01-27 (Sun, 27 Jan 2019)

  Changed paths:
M hypervisor/arch/x86/vtd.c

  Log Message:
  ---
  x86: vtd: Ignore lower two bits when evaluating VTD_REQ_INV_WAIT

If the guest sets the wait request status address to the top of the
page, we crossed the border to the next page and either wrote some bytes
into a guest page that was previously mapped at page 2 in the temporary
mapping range, or we crashed the hypervisor on a fault if nothing was
mapped before.

Fix this by masking out the two lowest bits of the status address which
are actually reserved according to the Intel manual.

Along that, replace the hard-coded shift value with the right symbolic
constant.

Fixes: 20b09b8625d5 ("x86: Emulate interrupt remapping support to enable x2APIC 
usage")
Signed-off-by: Jan Kiszka 


  Commit: 22148e28077358ba16f39264941b977c6f6a6067
  
https://github.com/siemens/jailhouse/commit/22148e28077358ba16f39264941b977c6f6a6067
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/miriac-sbc-ls1046a.c

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add root cell configuration

Add a root cell configuration file for the Microsys
Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
Signed-off-by: Jan Kiszka 


  Commit: 8c9a87fd85dfba2bb80f65c189e6a3bf20d8980c
  
https://github.com/siemens/jailhouse/commit/8c9a87fd85dfba2bb80f65c189e6a3bf20d8980c
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/miriac-sbc-ls1046a-gic-demo.c

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add GIC demo inmate configuration

Add an inmate configuration file for running the GIC demo on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
[Jan: fix-up whitespace errors]
Signed-off-by: Jan Kiszka 


  Commit: 41b0b5f8e7976aa8928c375d729bf349bf4626d2
  
https://github.com/siemens/jailhouse/commit/41b0b5f8e7976aa8928c375d729bf349bf4626d2
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/miriac-sbc-ls1046a-linux-demo.c

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add linux inmate demo configuration

Add an inmate configuration file for running Linux as an inmate on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
[Jan: fix-up whitespace errors]
Signed-off-by: Jan Kiszka 


  Commit: 58786d1a084328861dea929ea8990818630db838
  
https://github.com/siemens/jailhouse/commit/58786d1a084328861dea929ea8990818630db838
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add linux inmate demo dts

Add demo device tree for running Linux as an inmate on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
Signed-off-by: Jan Kiszka 


Compare: 
https://github.com/siemens/jailhouse/compare/3a4f41730235...58786d1a0843

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[siemens/jailhouse] 22148e: configs: miriac-sbc-ls1046a: Add root cell configu...

2019-01-30 Thread Andreas Messerschmid
  Branch: refs/heads/next
  Home:   https://github.com/siemens/jailhouse
  Commit: 22148e28077358ba16f39264941b977c6f6a6067
  
https://github.com/siemens/jailhouse/commit/22148e28077358ba16f39264941b977c6f6a6067
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/miriac-sbc-ls1046a.c

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add root cell configuration

Add a root cell configuration file for the Microsys
Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
Signed-off-by: Jan Kiszka 


  Commit: 8c9a87fd85dfba2bb80f65c189e6a3bf20d8980c
  
https://github.com/siemens/jailhouse/commit/8c9a87fd85dfba2bb80f65c189e6a3bf20d8980c
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/miriac-sbc-ls1046a-gic-demo.c

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add GIC demo inmate configuration

Add an inmate configuration file for running the GIC demo on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
[Jan: fix-up whitespace errors]
Signed-off-by: Jan Kiszka 


  Commit: 41b0b5f8e7976aa8928c375d729bf349bf4626d2
  
https://github.com/siemens/jailhouse/commit/41b0b5f8e7976aa8928c375d729bf349bf4626d2
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/miriac-sbc-ls1046a-linux-demo.c

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add linux inmate demo configuration

Add an inmate configuration file for running Linux as an inmate on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
[Jan: fix-up whitespace errors]
Signed-off-by: Jan Kiszka 


  Commit: 58786d1a084328861dea929ea8990818630db838
  
https://github.com/siemens/jailhouse/commit/58786d1a084328861dea929ea8990818630db838
  Author: Andreas Messerschmid 
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
A configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts

  Log Message:
  ---
  configs: miriac-sbc-ls1046a: Add linux inmate demo dts

Add demo device tree for running Linux as an inmate on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
Signed-off-by: Jan Kiszka 


Compare: 
https://github.com/siemens/jailhouse/compare/ae8b272f997b...58786d1a0843

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH 0/4] Add Microsys miriac SBC-LS1046A board support

2019-01-30 Thread Andreas Messerschmid
Hi Henning,

On 1/29/19 10:25 AM, Henning Schild wrote:
> Hi Andreas,
> 
> thanks for sharing that! Do you happen to know if that will work for an
> fsl-ls1046a as well? I guess a dts diff should give a clue.
> If it does the target should probably be called fsl-ls1046a.
yes, for sure there is sharing potential with other boards which use the
LS1046a-SoC as well and even the LS1043a is similar. On the other hand
there is also information contained in the Jailhouse config files which
is determined by the board manufacturers like available size of DRAM and
usable debug console. So if a board manufacturer decides to route out
DUART2 instead of DUART1 from the LS1046a as the debug console the
config has to be adapted, too.

As most of the generic configs reflect the hardware board name instead
of the SoC name (except imx8m I guess) as of today, I decided to use
that naming scheme as well in this case.

But yes, we could think of adding some more configurable parts in the
configs if that would be the way to go in future.

Andreas

> 
> We talked off list and i have those configs for an fsl-ls1043a. There
> is good config sharing potential between the two. Let us see if that
> gets merged, and thanks for starting the discussion!
> 
> Henning
> 
> On Tue, 29 Jan 2019 10:00:24 +0100
>  wrote:
> 
>> From: Andreas Messerschmid 
>>
>> This series adds support for the miriac SBC-LS1046A to Jailhouse.
>>
>> Andreas Messerschmid (4):
>>   configs: miriac-sbc-ls1046a: Add root cell configuration
>>   configs: miriac-sbc-ls1046a: Add GIC demo inmate configuration
>>   configs: miriac-sbc-ls1046a: Add linux inmate demo configuration
>>   configs: miriac-sbc-ls1046a: Add linux inmate demo dts
>>
>>  configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts | 106 ++
>>  configs/arm64/miriac-sbc-ls1046a-gic-demo.c |  74 
>>  configs/arm64/miriac-sbc-ls1046a-linux-demo.c   | 137 +++
>>  configs/arm64/miriac-sbc-ls1046a.c  | 458
>>  4 files changed, 775 insertions(+)
>>  create mode 100644 configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts
>>  create mode 100644 configs/arm64/miriac-sbc-ls1046a-gic-demo.c
>>  create mode 100644 configs/arm64/miriac-sbc-ls1046a-linux-demo.c
>>  create mode 100644 configs/arm64/miriac-sbc-ls1046a.c
>>
> 

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 1/4] configs: miriac-sbc-ls1046a: Add root cell configuration

2019-01-29 Thread andreas . messerschmid
From: Andreas Messerschmid 

Add a root cell configuration file for the Microsys
Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
---
 configs/arm64/miriac-sbc-ls1046a.c | 458 +
 1 file changed, 458 insertions(+)
 create mode 100644 configs/arm64/miriac-sbc-ls1046a.c

diff --git a/configs/arm64/miriac-sbc-ls1046a.c 
b/configs/arm64/miriac-sbc-ls1046a.c
new file mode 100644
index ..a8fb5b4c
--- /dev/null
+++ b/configs/arm64/miriac-sbc-ls1046a.c
@@ -0,0 +1,458 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Configuration for Microsys miriac SBC-LS1046A board
+ *
+ * Copyright (c) Linutronix GmbH, 2019
+ *
+ * Authors:
+ *  Andreas Messerschmid 
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ * Reservation via device tree: 0xc000..0x
+ */
+
+#include 
+#include 
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
+struct {
+   struct jailhouse_system header;
+   __u64 cpus[1];
+   struct jailhouse_memory mem_regions[50];
+   struct jailhouse_irqchip irqchips[2];
+   struct jailhouse_pci_device pci_devices[1];
+} __attribute__((packed)) config = {
+   .header = {
+   .signature = JAILHOUSE_SYSTEM_SIGNATURE,
+   .revision = JAILHOUSE_CONFIG_REVISION,
+   .flags = JAILHOUSE_SYS_VIRTUAL_DEBUG_CONSOLE,
+   .hypervisor_memory = {
+   .phys_start = 0xc000,
+   .size =   0x00040,
+   },
+
+   .debug_console = {
+   .address = 0x021c0500,
+   .size = 0x100,
+   .type = JAILHOUSE_CON_TYPE_8250,
+   .flags = JAILHOUSE_CON_ACCESS_MMIO |
+   JAILHOUSE_CON_REGDIST_1,
+   },
+
+   .platform_info = {
+   .pci_mmconfig_base = 0x1300,
+   .pci_mmconfig_end_bus = 0,
+   .pci_is_virtual = 1,
+   .pci_domain = -1,
+   .arm = {
+   .gic_version = 2,
+   .gicd_base = 0x141,
+   .gicc_base = 0x142f000,
+   .gich_base = 0x144,
+   .gicv_base = 0x146f000,
+   .maintenance_irq = 25,
+   },
+   },
+   .root_cell = {
+   .name = "miriac SBC-LS1046A",
+
+   .cpu_set_size = sizeof(config.cpus),
+   .num_memory_regions = ARRAY_SIZE(config.mem_regions),
+   .num_irqchips = ARRAY_SIZE(config.irqchips),
+   .num_pci_devices = ARRAY_SIZE(config.pci_devices),
+
+   .vpci_irq_base = 102-32,
+   },
+   },
+
+   .cpus = {
+   0xf,
+   },
+
+   .mem_regions = {
+   /* 0 - DDR memory controller */ {
+   .phys_start = 0x0108,
+   .virt_start = 0x0108,
+   .size =   0x1000,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO,
+   },
+   /* 1 - IFC */ {
+   .phys_start = 0x0153,
+   .virt_start = 0x0153,
+   .size =  0x1,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO,
+   },
+   /* 2 - QSPI */ {
+   .phys_start = 0x0155,
+   .virt_start = 0x0155,
+   .size = 0x1,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO,
+   },
+   /* 3 - esdhc */ {
+   .phys_start = 0x0156,
+   .virt_start = 0x0156,
+   .size = 0x1,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO,
+   },
+   /* 4 - scfg */ {
+   .phys_start = 0x0157,
+   .virt_start = 0x0157,
+   .size = 0x1,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO,
+   },
+   /* 5 - crypto */ {
+   .phys_start = 0x0170,
+   .virt_start = 0x0170,
+   .size = 0x10,
+   .flags = JAILHOUS

[PATCH 2/4] configs: miriac-sbc-ls1046a: Add GIC demo inmate configuration

2019-01-29 Thread andreas . messerschmid
From: Andreas Messerschmid 

Add an inmate configuration file for running the GIC demo on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
---
 configs/arm64/miriac-sbc-ls1046a-gic-demo.c | 74 +
 1 file changed, 74 insertions(+)
 create mode 100644 configs/arm64/miriac-sbc-ls1046a-gic-demo.c

diff --git a/configs/arm64/miriac-sbc-ls1046a-gic-demo.c 
b/configs/arm64/miriac-sbc-ls1046a-gic-demo.c
new file mode 100644
index ..d010ec42
--- /dev/null
+++ b/configs/arm64/miriac-sbc-ls1046a-gic-demo.c
@@ -0,0 +1,74 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * GIC-demo for Microsys miriac SBC-LS1046A board
+ *
+ * Copyright (c) Linutronix GmbH, 2019
+ *
+ * Authors:
+ *  Andreas Messerschmid 
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#include 
+#include 
+
+#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
+
+struct {
+   struct jailhouse_cell_desc cell;
+   __u64 cpus[1];
+   struct jailhouse_memory mem_regions[3];
+} __attribute__((packed)) config = {
+   .cell = {
+   .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
+   .revision = JAILHOUSE_CONFIG_REVISION,
+   .name = "gic-demo",
+   .flags = JAILHOUSE_CELL_PASSIVE_COMMREG,
+
+   .cpu_set_size = sizeof(config.cpus),
+   .num_memory_regions = ARRAY_SIZE(config.mem_regions),
+   .num_irqchips = 0,
+   .pio_bitmap_size = 0,
+   .num_pci_devices = 0,
+
+   .console = {
+   .address = 0x21c0500,
+   .type = JAILHOUSE_CON_TYPE_8250,
+   .flags = JAILHOUSE_CON_ACCESS_MMIO |
+   JAILHOUSE_CON_REGDIST_1,
+   },
+   },
+
+   .cpus = {
+   0x8,
+   },
+
+   .mem_regions = {
+   /* DUART1 */
+   {
+   .phys_start = 0x21c,
+   .virt_start = 0x21c,
+   .size = 0x1000,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO | JAILHOUSE_MEM_ROOTSHARED,
+   },
+   /* RAM */
+   {
+   .phys_start = 0xc040,
+   .virt_start = 0,
+   .size = 0x0001,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
+   },
+   /* communication region */ {
+   .virt_start = 0x8000,
+   .size = 0x1000,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_COMM_REGION,
+   },
+   }
+};
-- 
2.11.0

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 4/4] configs: miriac-sbc-ls1046a: Add linux inmate demo dts

2019-01-29 Thread andreas . messerschmid
From: Andreas Messerschmid 

Add demo device tree for running Linux as an inmate on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
---
 configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts | 106 
 1 file changed, 106 insertions(+)
 create mode 100644 configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts

diff --git a/configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts 
b/configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts
new file mode 100644
index ..05c3220c
--- /dev/null
+++ b/configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts
@@ -0,0 +1,106 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Device tree for Linux inmate on Microsys miriac-LS1046a-SBC,
+ * corresponds to configs/arm64/miriac-sbc-ls1046a-linux-demo.c
+ *
+ * Copyright (c) Linutronix GmbH, 2018
+ *
+ * Authors:
+ *  Andreas Messerschmid 
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#include 
+
+/dts-v1/;
+
+/ {
+   model = "Jailhouse cell on Microsys Miriac-LS1046a-SBC";
+
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   interrupt-parent = <>;
+
+   hypervisor {
+   compatible = "jailhouse,cell";
+   };
+
+   cpus {
+   #address-cells = <2>;
+   #size-cells = <0>;
+
+   cpu@2 {
+   compatible = "arm,cortex-a72", "arm,armv8";
+   device_type = "cpu";
+   reg = <0x0 0x2>;
+   enable-method = "psci";
+   };
+
+   cpu@3 {
+   compatible = "arm,cortex-a72", "arm,armv8";
+   device_type = "cpu";
+   reg = <0x0 0x3>;
+   enable-method = "psci";
+   };
+   };
+
+   psci {
+   compatible = "arm,psci-0.2";
+   method = "smc";
+   };
+
+   timer {
+   compatible = "arm,armv8-timer";
+   interrupts = ,
+,
+,
+;
+   };
+
+   gic: interrupt-controller@141 {
+   compatible = "arm,gic-400";
+   reg = <0x0 0x141 0x0 0x1000>,
+ <0x0 0x142f000 0x0 0x2000>;
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   };
+
+   uartclk: clock {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <2>;
+   };
+
+   uart: serial@21c0500 {
+   compatible = "fsl,ns16550", "ns16550a";
+   reg = <0x00 0x21c0500 0x0 0x100>;
+   interrupts = ;
+   clocks = <>, <>;
+   clock-names = "uart_clk", "pclk";
+   };
+
+   pci@1300 {
+   compatible = "pci-host-ecam-generic";
+   device_type = "pci";
+   bus-range = <0 0>;
+   #address-cells = <3>;
+   #size-cells = <2>;
+   #interrupt-cells = <1>;
+   interrupt-map-mask = <0 0 0 7>;
+   interrupt-map = <0 0 0 1  GIC_SPI 74 IRQ_TYPE_EDGE_RISING>,
+   <0 0 0 2  GIC_SPI 75 IRQ_TYPE_EDGE_RISING>,
+   <0 0 0 3  GIC_SPI 76 IRQ_TYPE_EDGE_RISING>,
+   <0 0 0 4  GIC_SPI 77 IRQ_TYPE_EDGE_RISING>;
+   reg = <0x0 0x1300 0x0 0x10>;
+   ranges =
+   <0x0200 0x00 0x1000 0x0 0x1000 0x00 
0x1>;
+   };
+};
-- 
2.11.0

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 3/4] configs: miriac-sbc-ls1046a: Add linux inmate demo configuration

2019-01-29 Thread andreas . messerschmid
From: Andreas Messerschmid 

Add an inmate configuration file for running Linux as an inmate on
the Microsys Miriac LS1046a SBC.

Signed-off-by: Andreas Messerschmid 
Reviewed-by: Benedikt Spranger 
---
 configs/arm64/miriac-sbc-ls1046a-linux-demo.c | 137 ++
 1 file changed, 137 insertions(+)
 create mode 100644 configs/arm64/miriac-sbc-ls1046a-linux-demo.c

diff --git a/configs/arm64/miriac-sbc-ls1046a-linux-demo.c 
b/configs/arm64/miriac-sbc-ls1046a-linux-demo.c
new file mode 100644
index ..007ede79
--- /dev/null
+++ b/configs/arm64/miriac-sbc-ls1046a-linux-demo.c
@@ -0,0 +1,137 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Configuration for Microsys miriac SBC-LS1046A board
+ * 2 CPUs, ~1G RAM, serial console, intercell-comm
+ *
+ * Copyright (c) Linutronix GmbH, 2019
+ *
+ * Authors:
+ *  Andreas Messerschmid 
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#include 
+#include 
+
+#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
+
+struct {
+   struct jailhouse_cell_desc cell;
+   __u64 cpus[1];
+   struct jailhouse_memory mem_regions[5];
+   struct jailhouse_irqchip irqchips[2];
+   struct jailhouse_pci_device pci_devices[1];
+} __attribute__((packed)) config = {
+   .cell = {
+   .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
+   .revision = JAILHOUSE_CONFIG_REVISION,
+   .name = "linux-demo",
+   .flags = JAILHOUSE_CELL_PASSIVE_COMMREG |
+   JAILHOUSE_CELL_VIRTUAL_CONSOLE_PERMITTED,
+
+   .cpu_set_size = sizeof(config.cpus),
+   .num_memory_regions = ARRAY_SIZE(config.mem_regions),
+   .num_irqchips = ARRAY_SIZE(config.irqchips),
+   .num_pci_devices = ARRAY_SIZE(config.pci_devices),
+
+   .vpci_irq_base = 106-32,
+
+   .console = {
+   .address = 0x21c0500,
+   .type = JAILHOUSE_CON_TYPE_8250,
+   .flags = JAILHOUSE_CON_ACCESS_MMIO |
+   JAILHOUSE_CON_REGDIST_1,
+   },
+   },
+
+   .cpus = {
+   0xc,
+   },
+
+   .mem_regions = {
+   /* DUART1 */
+   {
+   .phys_start = 0x21c,
+   .virt_start = 0x21c,
+   .size = 0x1000,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO | JAILHOUSE_MEM_ROOTSHARED,
+   },
+   /* RAM */
+   {
+   .phys_start = 0xc050,
+   .virt_start = 0,
+   .size = 0x1,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
+   },
+/* RAM */
+{
+.phys_start = 0xc051,
+.virt_start = 0xc051,
+.size = 0x3faf,
+.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
+   JAILHOUSE_MEM_LOADABLE,
+},
+   /* communication region */ {
+   .virt_start = 0x8000,
+   .size = 0x1000,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_COMM_REGION,
+   },
+   /* IVSHMEM shared memory region */ {
+.phys_start = 0xc040,
+.virt_start = 0xc040,
+.size = 0x10,
+.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+JAILHOUSE_MEM_ROOTSHARED,
+},
+   },
+
+   .irqchips = {
+   /* GIC */
+   {
+   .address = 0x141,
+   .pin_base = 32,
+   .pin_bitmap = {
+   (1 << (54 - 32)),
+   (1 << (86 - 64)),
+   (1 << (106 - 96)) | (1 << (107 - 96)) |
+   (1 << (108 - 96)) | (1 << (109 - 96)),
+   0,
+   },
+   },
+   /* GIC */
+   {
+   .address = 0x141,
+   .pin_base = 160,
+   .pin_bitmap = {
+   0,
+   0,
+   0,
+   0,
+   },
+ 

[PATCH 0/4] Add Microsys miriac SBC-LS1046A board support

2019-01-29 Thread andreas . messerschmid
From: Andreas Messerschmid 

This series adds support for the miriac SBC-LS1046A to Jailhouse.

Andreas Messerschmid (4):
  configs: miriac-sbc-ls1046a: Add root cell configuration
  configs: miriac-sbc-ls1046a: Add GIC demo inmate configuration
  configs: miriac-sbc-ls1046a: Add linux inmate demo configuration
  configs: miriac-sbc-ls1046a: Add linux inmate demo dts

 configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts | 106 ++
 configs/arm64/miriac-sbc-ls1046a-gic-demo.c |  74 
 configs/arm64/miriac-sbc-ls1046a-linux-demo.c   | 137 +++
 configs/arm64/miriac-sbc-ls1046a.c  | 458 
 4 files changed, 775 insertions(+)
 create mode 100644 configs/arm64/dts/inmate-miriac-sbc-ls1046a.dts
 create mode 100644 configs/arm64/miriac-sbc-ls1046a-gic-demo.c
 create mode 100644 configs/arm64/miriac-sbc-ls1046a-linux-demo.c
 create mode 100644 configs/arm64/miriac-sbc-ls1046a.c

-- 
2.11.0

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jailhouse enable gets stuck on LS1046a

2018-12-14 Thread Andreas Messerschmid
Hi Jan,

On 12/13/18 9:41 AM, Jan Kiszka wrote:
> On 12.12.18 17:28, Andreas Messerschmid wrote:
>> Hi all,
>>
>> I'm trying to bring up Jailhouse on a NXP Layerscape LS1046a based board
>> with four Cortex-A72 cores. The system gets stuck after issuing the
>> 'jailhouse enable .cell' command.
>>
>> After debugging through the jailhouse loading process everything seems
>> to settle correctly. The system gets stuck in enter_hypervisor() when
>> calling 'arch_entry' via 'err = entry(cpu);'.
>>
>> arch_entry is called for each of the four cpus, but none of these
>> function calls returns and the system is stuck afterwards.
>>
>> I'm using the current Jailhouse master branch and a 4.19 rootcell Linux
>> kernel.
>>
>> Anybody seen this before?
>>
> 
> Yes. A typical reason for such an error pattern is that your UART is not
> correctly configured. Then Jailhouse will enter the early initialization
> steps but gets stuck when trying to issue the first messages on the
> console. So double-checking that configuration is worthwhile.
you are right, setting the correct access type on the UART and aligning
several MMIO addresses with the reference manual memory map solves the
issue. Jailhouse comes up without any error right now.

> 
> Moreover, we have unpublished configs for 1046A evaluation board here,
> but by now about a year old. Henning is currently working on 1043
> configs for the corresponding eval target, apparently they look fairly
> similar. What is your target board? Maybe we should join efforts
> publicly and push things into the repo sooner.
yes, I'll try to come back with some working configs when my system is
completely up and running.

> 
> Jan
> 

Thanks a lot for your help.

Andreas

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


jailhouse enable gets stuck on LS1046a

2018-12-12 Thread Andreas Messerschmid
Hi all,

I'm trying to bring up Jailhouse on a NXP Layerscape LS1046a based board
with four Cortex-A72 cores. The system gets stuck after issuing the
'jailhouse enable .cell' command.

After debugging through the jailhouse loading process everything seems
to settle correctly. The system gets stuck in enter_hypervisor() when
calling 'arch_entry' via 'err = entry(cpu);'.

arch_entry is called for each of the four cpus, but none of these
function calls returns and the system is stuck afterwards.

I'm using the current Jailhouse master branch and a 4.19 rootcell Linux
kernel.

Anybody seen this before?


Best regards
Andreas



-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ivshmem-net PCI devices not available in RootCell

2018-11-06 Thread Andreas Messerschmid
On 11/06/2018 02:45 PM, Jan Kiszka wrote:
> On 06.11.18 14:34, Andreas Messerschmid wrote:
>> On 11/06/2018 12:42 PM, Jan Kiszka wrote:
>>> On 06.11.18 11:26, Henning Schild wrote:
>>>> Am Tue, 6 Nov 2018 10:52:58 +0100
>>>> schrieb Andreas Messerschmid :
>>>>
>>>>> On 11/06/2018 10:48 AM, Henning Schild wrote:
>>>>>> Am Tue, 6 Nov 2018 10:29:08 +0100
>>>>>> schrieb Andreas Messerschmid :
>>>>>>   
>>>>>>> Hi Henning,
>>>>>>>
>>>>>>> On 11/06/2018 10:14 AM, Henning Schild wrote:
>>>>>>>> Am Mon, 5 Nov 2018 17:32:40 +0100
>>>>>>>> schrieb Andreas Messerschmid :
>>>>>>>> 
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I'm trying to bring úp an ivshmem-net based
>>>>>>>>> inter-cell-communication on an Intel-Atom E3950 hardware running
>>>>>>>>> Jailhouse but I can't discover any ivshmem-net virtual PCI
>>>>>>>>> devices in the RootCell. The Hypervisor and Linux inmate are up
>>>>>>>>> and running fine and I can see the ivshmem-net virtual PCI
>>>>>>>>> device in the inmate including the appropriate network interface.
>>>>>>>>>
>>>>>>>>> The hypervisor console states the following:
>>>>>>>>> Reserving 5 interrupt(s) for device 0100 at index 136
>>>>>>>>> Adding PCI device 02:00.0 to cell "RootCell"
>>>>>>>>> Reserving 5 interrupt(s) for device 0200 at index 141
>>>>>>>>> Adding virtual PCI device 00:0a.0 to cell "RootCell"
>>>>>>>>> Page pool usage after late setup: mem 393/15822, remap
>>>>>>>>> 65547/131072 Activating hypervisor
>>>>>>>>> Removing PCI device 01:00.0 from cell "RootCell"
>>>>>>>>> Freeing 5 interrupt(s) for device 0100 at index 136
>>>>>>>>> Adding PCI device 01:00.0 to cell "inmate1"
>>>>>>>>> Reserving 5 interrupt(s) for device 0100 at index 136
>>>>>>>>> Adding virtual PCI device 00:0a.0 to cell "inmate1"
>>>>>>>>> Shared memory connection established: "inmate1" <--> "RootCell"
>>>>>>>>> Created cell "inmate1"
>>>>>>>>
>>>>>>>> All this looks fine to me, the two devices get added and the link
>>>>>>>> gets established.
>>>>>>>> 
>>>>>>>>> But the virtual PCI device 00:0a.0 is not discoverable in the
>>>>>>>>> RootCell.
>>>>>>>>
>>>>>>>> I guess the interface does not appear, which could also be the
>>>>>>>> driver not liking the device. What do lspci or browsing
>>>>>>>> in /sys/bus/pci say?
>>>>>>>
>>>>>>> neither lspci nor /sys/bus/pci/devices in the RootCell show the
>>>>>>> '00:0a.0' device.
>>>>>>
>>>>>> I guess your 4.19 is from here?
>>>>>> http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse
>>>>>>
>>>>>
>>>>> Yes, that's the kernel in use.
>>>>>
>>>>>>
>>>>>> You could try rescanning the PCI bus, but i think the jailhouse
>>>>>> driver should do that when adding a device.
>>>>>>
>>>>>> might cause a trap ... "sync" before
>>>>>> # echo 1 > /sys/bus/pci/rescan
>>>>>
>>>>> Same result, even after rescanning the device does not show up.
>>>>
>>>> In this case i would instrument the hypervisor to check that
>>>> pci_read_config and arch_pci_read_config intercept the accesses. (put a
>>>> few printks in there)
>>>
>>> I suspect, they don't: Check first if I/O ports 0xcf8 and 0xcfc are
>>> intercepted in the root cell's config. Also check (though that would not
>>> explain this issue) if the mmconfig region is not passed through directly.
>>>
>>> We really need a config checker...
>>>
>>
>> Yes, 0xcf8 and 0xcfc weren't intercepted in the RootCells config, that
>> does the trick. If I intercept that I/O ports in the RootCells
>> .pio_bitmap then the ivshmem-net PCI device shows up, at least 'lspci'
>> states this.
>>
>> But when I start the inmate, the RootCell gets stuck:
>>
>> FATAL: Invalid PCI config write, port: cfc, size 2, address port: 800100a8
> 
> Access to the capability at config space address 0xa8 of device 01:00.0 was
> denied. You can work around this by permitting JAILHOUSE_PCICAPS_WRITE via
> .flags in the corresponding capability element:
> 
>   {
>   .id = 0x10,
>   .start = 0xa0,
>   .len = 60,
>   .flags = 0,
>   },
> 
> There might be more after this one, but the patter will be similar. If access 
> is
> safe depends on the use case, though.
> 
> Jan

Working fine now. Thanks a lot for your assistance Jan and Henning.

Andreas

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ivshmem-net PCI devices not available in RootCell

2018-11-06 Thread Andreas Messerschmid
On 11/06/2018 12:42 PM, Jan Kiszka wrote:
> On 06.11.18 11:26, Henning Schild wrote:
>> Am Tue, 6 Nov 2018 10:52:58 +0100
>> schrieb Andreas Messerschmid :
>>
>>> On 11/06/2018 10:48 AM, Henning Schild wrote:
>>>> Am Tue, 6 Nov 2018 10:29:08 +0100
>>>> schrieb Andreas Messerschmid :
>>>>   
>>>>> Hi Henning,
>>>>>
>>>>> On 11/06/2018 10:14 AM, Henning Schild wrote:
>>>>>> Am Mon, 5 Nov 2018 17:32:40 +0100
>>>>>> schrieb Andreas Messerschmid :
>>>>>> 
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm trying to bring úp an ivshmem-net based
>>>>>>> inter-cell-communication on an Intel-Atom E3950 hardware running
>>>>>>> Jailhouse but I can't discover any ivshmem-net virtual PCI
>>>>>>> devices in the RootCell. The Hypervisor and Linux inmate are up
>>>>>>> and running fine and I can see the ivshmem-net virtual PCI
>>>>>>> device in the inmate including the appropriate network interface.
>>>>>>>
>>>>>>> The hypervisor console states the following:
>>>>>>> Reserving 5 interrupt(s) for device 0100 at index 136
>>>>>>> Adding PCI device 02:00.0 to cell "RootCell"
>>>>>>> Reserving 5 interrupt(s) for device 0200 at index 141
>>>>>>> Adding virtual PCI device 00:0a.0 to cell "RootCell"
>>>>>>> Page pool usage after late setup: mem 393/15822, remap
>>>>>>> 65547/131072 Activating hypervisor
>>>>>>> Removing PCI device 01:00.0 from cell "RootCell"
>>>>>>> Freeing 5 interrupt(s) for device 0100 at index 136
>>>>>>> Adding PCI device 01:00.0 to cell "inmate1"
>>>>>>> Reserving 5 interrupt(s) for device 0100 at index 136
>>>>>>> Adding virtual PCI device 00:0a.0 to cell "inmate1"
>>>>>>> Shared memory connection established: "inmate1" <--> "RootCell"
>>>>>>> Created cell "inmate1"
>>>>>>
>>>>>> All this looks fine to me, the two devices get added and the link
>>>>>> gets established.
>>>>>> 
>>>>>>> But the virtual PCI device 00:0a.0 is not discoverable in the
>>>>>>> RootCell.
>>>>>>
>>>>>> I guess the interface does not appear, which could also be the
>>>>>> driver not liking the device. What do lspci or browsing
>>>>>> in /sys/bus/pci say?
>>>>>
>>>>> neither lspci nor /sys/bus/pci/devices in the RootCell show the
>>>>> '00:0a.0' device.
>>>>
>>>> I guess your 4.19 is from here?
>>>> http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse
>>>>
>>>
>>> Yes, that's the kernel in use.
>>>
>>>>
>>>> You could try rescanning the PCI bus, but i think the jailhouse
>>>> driver should do that when adding a device.
>>>>
>>>> might cause a trap ... "sync" before
>>>> # echo 1 > /sys/bus/pci/rescan
>>>
>>> Same result, even after rescanning the device does not show up.
>>
>> In this case i would instrument the hypervisor to check that
>> pci_read_config and arch_pci_read_config intercept the accesses. (put a
>> few printks in there)
> 
> I suspect, they don't: Check first if I/O ports 0xcf8 and 0xcfc are
> intercepted in the root cell's config. Also check (though that would not
> explain this issue) if the mmconfig region is not passed through directly.
> 
> We really need a config checker...
> 

Yes, 0xcf8 and 0xcfc weren't intercepted in the RootCells config, that
does the trick. If I intercept that I/O ports in the RootCells
.pio_bitmap then the ivshmem-net PCI device shows up, at least 'lspci'
states this.

But when I start the inmate, the RootCell gets stuck:

FATAL: Invalid PCI config write, port: cfc, size 2, address port: 800100a8
RIP: 0xa07670b4 RSP: 0xb10a015a7cd0 FLAGS: 46
RAX: 0x2830 RBX: 0x RCX: 0x00a8
RDX: 0x0cfc RSI: 0x0206 RDI: 0xa180fe90
CS: 10 BASE: 0x AR-BYTES: a09b EFER.LMA 1
CR0: 0x80050033 CR3: 0x0002788e4000 CR4: 0x003426f0
EFER: 0x0d01
Parking CPU 0 (Cell: "RootCell")

My rootcell co

Re: ivshmem-net PCI devices not available in RootCell

2018-11-06 Thread Andreas Messerschmid
On 11/06/2018 10:48 AM, Henning Schild wrote:
> Am Tue, 6 Nov 2018 10:29:08 +0100
> schrieb Andreas Messerschmid :
> 
>> Hi Henning,
>>
>> On 11/06/2018 10:14 AM, Henning Schild wrote:
>>> Am Mon, 5 Nov 2018 17:32:40 +0100
>>> schrieb Andreas Messerschmid :
>>>   
>>>> Hi,
>>>>
>>>> I'm trying to bring úp an ivshmem-net based
>>>> inter-cell-communication on an Intel-Atom E3950 hardware running
>>>> Jailhouse but I can't discover any ivshmem-net virtual PCI devices
>>>> in the RootCell. The Hypervisor and Linux inmate are up and
>>>> running fine and I can see the ivshmem-net virtual PCI device in
>>>> the inmate including the appropriate network interface.
>>>>
>>>> The hypervisor console states the following:
>>>> Reserving 5 interrupt(s) for device 0100 at index 136
>>>> Adding PCI device 02:00.0 to cell "RootCell"
>>>> Reserving 5 interrupt(s) for device 0200 at index 141
>>>> Adding virtual PCI device 00:0a.0 to cell "RootCell"
>>>> Page pool usage after late setup: mem 393/15822, remap 65547/131072
>>>> Activating hypervisor
>>>> Removing PCI device 01:00.0 from cell "RootCell"
>>>> Freeing 5 interrupt(s) for device 0100 at index 136
>>>> Adding PCI device 01:00.0 to cell "inmate1"
>>>> Reserving 5 interrupt(s) for device 0100 at index 136
>>>> Adding virtual PCI device 00:0a.0 to cell "inmate1"
>>>> Shared memory connection established: "inmate1" <--> "RootCell"
>>>> Created cell "inmate1"  
>>>
>>> All this looks fine to me, the two devices get added and the link
>>> gets established.
>>>   
>>>> But the virtual PCI device 00:0a.0 is not discoverable in the
>>>> RootCell.  
>>>
>>> I guess the interface does not appear, which could also be the
>>> driver not liking the device. What do lspci or browsing
>>> in /sys/bus/pci say?  
>>
>> neither lspci nor /sys/bus/pci/devices in the RootCell show the
>> '00:0a.0' device.
> 
> I guess your 4.19 is from here?
> http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse

Yes, that's the kernel in use.

> 
> You could try rescanning the PCI bus, but i think the jailhouse driver
> should do that when adding a device.
> 
> might cause a trap ... "sync" before
> # echo 1 > /sys/bus/pci/rescan

Same result, even after rescanning the device does not show up.

Andreas


>>>> My RootCell ivshmem config looks like this:
>>>> { /* IVSHMEM (networking rootcell <-> inmate1) */
>>>>   .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
>>>>   .iommu = 1,
>>>>   .domain = 0x,
>>>>   .bdf = 0x0a << 3,
>>>>   .bar_mask = {
>>>>   0xff00, 0x, 0x,
>>>>   0x, 0xffe0, 0x,
>>>>},
>>>>.num_msix_vectors = 1,
>>>>.shmem_region = 40,
>>>>.shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
>>>> },
>>>>
>>>> RootCell kernel config ist attached.
>>>>
>>>> Did anybody face such an issue before? Any hints?
>>>>
>>>> Best regards
>>>> Andreas
>>>>  
>>>   
>>
> 

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ivshmem-net PCI devices not available in RootCell

2018-11-06 Thread Andreas Messerschmid
Hi Henning,

On 11/06/2018 10:14 AM, Henning Schild wrote:
> Am Mon, 5 Nov 2018 17:32:40 +0100
> schrieb Andreas Messerschmid :
> 
>> Hi,
>>
>> I'm trying to bring úp an ivshmem-net based inter-cell-communication
>> on an Intel-Atom E3950 hardware running Jailhouse but I can't
>> discover any ivshmem-net virtual PCI devices in the RootCell. The
>> Hypervisor and Linux inmate are up and running fine and I can see the
>> ivshmem-net virtual PCI device in the inmate including the
>> appropriate network interface.
>>
>> The hypervisor console states the following:
>> Reserving 5 interrupt(s) for device 0100 at index 136
>> Adding PCI device 02:00.0 to cell "RootCell"
>> Reserving 5 interrupt(s) for device 0200 at index 141
>> Adding virtual PCI device 00:0a.0 to cell "RootCell"
>> Page pool usage after late setup: mem 393/15822, remap 65547/131072
>> Activating hypervisor
>> Removing PCI device 01:00.0 from cell "RootCell"
>> Freeing 5 interrupt(s) for device 0100 at index 136
>> Adding PCI device 01:00.0 to cell "inmate1"
>> Reserving 5 interrupt(s) for device 0100 at index 136
>> Adding virtual PCI device 00:0a.0 to cell "inmate1"
>> Shared memory connection established: "inmate1" <--> "RootCell"
>> Created cell "inmate1"
> 
> All this looks fine to me, the two devices get added and the link gets
> established.
> 
>> But the virtual PCI device 00:0a.0 is not discoverable in the
>> RootCell.
> 
> I guess the interface does not appear, which could also be the driver
> not liking the device. What do lspci or browsing in /sys/bus/pci say?

neither lspci nor /sys/bus/pci/devices in the RootCell show the
'00:0a.0' device.

Andreas

>> My RootCell ivshmem config looks like this:
>> { /* IVSHMEM (networking rootcell <-> inmate1) */
>>   .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
>>   .iommu = 1,
>>   .domain = 0x,
>>   .bdf = 0x0a << 3,
>>   .bar_mask = {
>>   0xff00, 0x, 0x,
>>   0x, 0xffe0, 0x,
>>},
>>.num_msix_vectors = 1,
>>.shmem_region = 40,
>>.shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
>> },
>>
>> RootCell kernel config ist attached.
>>
>> Did anybody face such an issue before? Any hints?
>>
>> Best regards
>> Andreas
>>
> 

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: zynqmp-zcu102 root-cell linux kernel version

2017-04-05 Thread Andreas Messerschmid
On 05.04.2017 12:30, Jan Kiszka wrote:
> On 2017-04-05 12:13, Andreas Messerschmid wrote:
>> Hi,
>>
>> according to the Jailhouse documentation a linux kernel version of
>> 4.7+ is needed for ARM64. The latest release (2016.4) of linux-xlnx is
>> based on 4.6. As Jailhouse supports the zynqmp already I am wondering
>> which kernel-version to use in the root-cell. It seems that the master
>> branch of linux-xlnx which provides 4.9 isn't booting on my zcu102.
>>
>> Any hints?
> 
> Use a recent upstream kernel (+queues/jailhouse from [1]) - unless there
> is a hard need to go for the Xilinx branch. In the latter case, you will
> at least have to backport the patches.
Can you share your kernel config and device tree for the zcu102?

Thx
Andreas

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


zynqmp-zcu102 root-cell linux kernel version

2017-04-05 Thread Andreas Messerschmid
Hi,

according to the Jailhouse documentation a linux kernel version of
4.7+ is needed for ARM64. The latest release (2016.4) of linux-xlnx is
based on 4.6. As Jailhouse supports the zynqmp already I am wondering
which kernel-version to use in the root-cell. It seems that the master
branch of linux-xlnx which provides 4.9 isn't booting on my zcu102.

Any hints?

Andreas

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.