diff --git a/Readme.md b/Readme.md index 1960a264c822db1789b0d8f6148be195a5227c72..62ba3adcc59cb68f443331bdee592ea881d5a732 100755 --- a/Readme.md +++ b/Readme.md @@ -303,26 +303,124 @@ e2000q上通过下面命令创建non-root cell并在此cell上运行linux: ![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_usb.png) #### 4.4.3.5 pcie测试 -针对PCIE设备的测试,我们以常见设Intel e1000e网卡作为实例。在配置文件“e2000q.c”以及“e2000q-linux-demo.c“中已加入相关配置,并用宏进行控制,若需要使用,请自行定义相关宏以使用: +说明: 针对PCIE设备的测试,我们以Intel e1000e网卡作为实例。在配置文件“e2000q.c”以及“e2000q-linux-demo.c“中用宏进行控制,若需要使用,请自行定义相关宏。 -![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_add_e1000e_config.png) +(1)首先要在root cell里加入PCIE的相关配置 -e2000q上通过下面命令创建non-root cell并在此cell上运行linux: +在configs/arm64/e2000q.c中加入如下内容: - # jailhouse enable e2000q.cell - # jailhouse cell linux -i initrd.ext2 -d e2000q.dtb e2000q-linux-demo.cell /boot/Image -c "console=ttyAMA1,115200 earlycon=pl011,0x2800d000 root=/dev/ram0 ramdisk_size=0x1000000 rw swiotlb=force" +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_rootcell_config_1.png) -然后在分配给non-root cell的串口通过命令来使用e1000e网卡,效果如下所示: +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_rootcell_config_2.png) -![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_e1000e.png) +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_rootcell_config_3.png) +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_rootcell_config_4.png) -# 5 Non-root linux实时性测试 +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_rootcell_config_5.png) + +(2)然后需要在non-root cell里加入PCIE的相关配置 + +在configs/arm64/e2000q-linux-demo.c中加入如下内容: + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_non_rootcell_config_1.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_non_rootcell_config_2.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_non_rootcell_config_3.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_non_rootcell_config_4.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_non_rootcell_config_5.png) + +(3)添加pcie legacy中断 + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_non_rootcell_config_6.png) + +(4)在phytium-jailhouse/src/jailhouse/下执行: + +注意:下面的命令中的路径请根据自己的情况进行调整。 + + # make && rm -rf /lib/firmware/jailhouse.bin && cp hypervisor/jailhouse.bin /lib/firmware/ && sync + # insmod driver/jailhouse.ko + # jailhouse enable configs/arm64/e2000q.cell + # ./tools/jailhouse-cell-linux \ + # -i ./initrd_new.img \ /* 该image如有需要,请联系飞腾嵌入式软件部 */ + # -d configs/arm64/dts/inmate-phytium-e2000q.dtb \ + # -c "console=ttyAMA1,115200 earlycon=pl011, 0x2800d000 root=/dev/ram0 rw loglevel=8 pci=nomsi" \ + # configs/arm64/e2000q-linux-demo.cell \ + # /root/linux-kernel/arch/arm64/boot/Image \ /* e2000内核代码详见飞腾官方,只在4.19内核版本测试通过 */ + +(5)测试结果 + +注意:下面的命令均在guest os里运行 + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_output_1.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_output_2.png) + +下面的截图是从其他主机上ping jailhouse的虚拟机IP地址: + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_pcie_output_3.png) + +测试通过 + +#### 4.4.3.6 smmu测试 +(1)前置条件 +root-cell 和 non-root cell 的配置和PCIE测试中保持一致,要求PCIE测试能通过。 + +需要对宿主机的内核配置进行处理,禁用smmu。 + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_1.png) + +(2)使能和配置SMMU-V3 + +non-root cell 配置文件加入以下内容: + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_non_root_cell_config_1.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_non_root_cell_config_2.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_non_root_cell_config_3.png) + +root cell 配置文件加入以下内容: + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_root_cell_config_1.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_root_cell_config_2.png) + +(3)测试步骤 + +smmu-v3使能前提下,pci legacy中断功能测试。 + +注意:下面的命令中的路径请根据自己的情况进行调整。 + + # make && rm -rf /lib/firmware/jailhouse.bin && cp hypervisor/jailhouse.bin /lib/firmware/ && sync + # insmod driver/jailhouse.ko + # jailhouse enable configs/arm64/e2000q.cell + # ./tools/jailhouse-cell-linux \ + # -i ./initrd_new.img \ /* 该image如有需要,请联系飞腾嵌入式软件部 */ + # -d configs/arm64/dts/inmate-phytium-e2000q.dtb \ + # -c "console=ttyAMA1,115200 earlycon=pl011, 0x2800d000 root=/dev/ram0 rw loglevel=8 pci=nomsi" \ + # configs/arm64/e2000q-linux-demo.cell \ + # /root/linux-kernel/arch/arm64/boot/Image \ /* e2000内核代码详见飞腾官方,只在4.19内核版本测试通过 */ + + +(4) 测试结果: + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_output_1.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_output_2.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_output_3.png) + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000_linux_smmu_output_4.png) + +# 5 Non-root linux实时性测试 测试使用了stress和while循环脚本(均运行四个进程)来增加系统负载,命令如下: $ stress -c 4 - $ while true; do ifconfig lo up; done & diff --git a/pic/e2000_linux_pcie_non_rootcell_config_1.png b/pic/e2000_linux_pcie_non_rootcell_config_1.png new file mode 100755 index 0000000000000000000000000000000000000000..b9fd9d86d98993afe1c4a6907fce1417da511173 Binary files /dev/null and b/pic/e2000_linux_pcie_non_rootcell_config_1.png differ diff --git a/pic/e2000_linux_pcie_non_rootcell_config_2.png b/pic/e2000_linux_pcie_non_rootcell_config_2.png new file mode 100755 index 0000000000000000000000000000000000000000..5a788b4d01de0aebd3919aa8c4fdc73b43125c22 Binary files /dev/null and b/pic/e2000_linux_pcie_non_rootcell_config_2.png differ diff --git a/pic/e2000_linux_pcie_non_rootcell_config_3.png b/pic/e2000_linux_pcie_non_rootcell_config_3.png new file mode 100755 index 0000000000000000000000000000000000000000..e442403317f0f41ba7dc135ed4fd7e522fb531cc Binary files /dev/null and b/pic/e2000_linux_pcie_non_rootcell_config_3.png differ diff --git a/pic/e2000_linux_pcie_non_rootcell_config_4.png b/pic/e2000_linux_pcie_non_rootcell_config_4.png new file mode 100755 index 0000000000000000000000000000000000000000..e6035300fddf4d2706cf5e932f2f5b471bed98ae Binary files /dev/null and b/pic/e2000_linux_pcie_non_rootcell_config_4.png differ diff --git a/pic/e2000_linux_pcie_non_rootcell_config_5.png b/pic/e2000_linux_pcie_non_rootcell_config_5.png new file mode 100755 index 0000000000000000000000000000000000000000..8adbed4d98e378910102a487fd45b97df4af9a92 Binary files /dev/null and b/pic/e2000_linux_pcie_non_rootcell_config_5.png differ diff --git a/pic/e2000_linux_pcie_non_rootcell_config_6.png b/pic/e2000_linux_pcie_non_rootcell_config_6.png new file mode 100755 index 0000000000000000000000000000000000000000..dab7ca4f07c9924d32618782e709c3e1fb12d704 Binary files /dev/null and b/pic/e2000_linux_pcie_non_rootcell_config_6.png differ diff --git a/pic/e2000_linux_pcie_output_1.png b/pic/e2000_linux_pcie_output_1.png new file mode 100755 index 0000000000000000000000000000000000000000..6ae88540f7c469ce3d93735745a0ea387d3f606b Binary files /dev/null and b/pic/e2000_linux_pcie_output_1.png differ diff --git a/pic/e2000_linux_pcie_output_2.png b/pic/e2000_linux_pcie_output_2.png new file mode 100755 index 0000000000000000000000000000000000000000..cee9b2edd0347b969933fddf4f8e2ca662ab0b25 Binary files /dev/null and b/pic/e2000_linux_pcie_output_2.png differ diff --git a/pic/e2000_linux_pcie_output_3.png b/pic/e2000_linux_pcie_output_3.png new file mode 100755 index 0000000000000000000000000000000000000000..19e4491330aff761b39f5650d0bb1b07c53ecab5 Binary files /dev/null and b/pic/e2000_linux_pcie_output_3.png differ diff --git a/pic/e2000_linux_pcie_rootcell_config_1.png b/pic/e2000_linux_pcie_rootcell_config_1.png new file mode 100755 index 0000000000000000000000000000000000000000..4677a8c63dba36b07d2bdd1b127204230ff64ea9 Binary files /dev/null and b/pic/e2000_linux_pcie_rootcell_config_1.png differ diff --git a/pic/e2000_linux_pcie_rootcell_config_2.png b/pic/e2000_linux_pcie_rootcell_config_2.png new file mode 100755 index 0000000000000000000000000000000000000000..24781cdfe4c6ff8fd4c512ad862b1bd5c024c1a5 Binary files /dev/null and b/pic/e2000_linux_pcie_rootcell_config_2.png differ diff --git a/pic/e2000_linux_pcie_rootcell_config_3.png b/pic/e2000_linux_pcie_rootcell_config_3.png new file mode 100755 index 0000000000000000000000000000000000000000..54880ad80de01ee33e5fd5b73eaea933413c00e9 Binary files /dev/null and b/pic/e2000_linux_pcie_rootcell_config_3.png differ diff --git a/pic/e2000_linux_pcie_rootcell_config_4.png b/pic/e2000_linux_pcie_rootcell_config_4.png new file mode 100755 index 0000000000000000000000000000000000000000..b30ea2dab7131e05ec9f02cd53670fc5c2c4af32 Binary files /dev/null and b/pic/e2000_linux_pcie_rootcell_config_4.png differ diff --git a/pic/e2000_linux_pcie_rootcell_config_5.png b/pic/e2000_linux_pcie_rootcell_config_5.png new file mode 100755 index 0000000000000000000000000000000000000000..c0228220862ee11d191caa303de17226ada23d6b Binary files /dev/null and b/pic/e2000_linux_pcie_rootcell_config_5.png differ diff --git a/pic/e2000_linux_smmu_1.png b/pic/e2000_linux_smmu_1.png new file mode 100755 index 0000000000000000000000000000000000000000..3c67f3ba23825c0239d49d42055963ea88413261 Binary files /dev/null and b/pic/e2000_linux_smmu_1.png differ diff --git a/pic/e2000_linux_smmu_non_root_cell_config_1.png b/pic/e2000_linux_smmu_non_root_cell_config_1.png new file mode 100755 index 0000000000000000000000000000000000000000..02446b38babbe9ccc1044bd88dcc27d7a684b3a8 Binary files /dev/null and b/pic/e2000_linux_smmu_non_root_cell_config_1.png differ diff --git a/pic/e2000_linux_smmu_non_root_cell_config_2.png b/pic/e2000_linux_smmu_non_root_cell_config_2.png new file mode 100755 index 0000000000000000000000000000000000000000..0da5c3421b290169870dde0ad9cabbaab1c2e4f0 Binary files /dev/null and b/pic/e2000_linux_smmu_non_root_cell_config_2.png differ diff --git a/pic/e2000_linux_smmu_non_root_cell_config_3.png b/pic/e2000_linux_smmu_non_root_cell_config_3.png new file mode 100755 index 0000000000000000000000000000000000000000..6baba5f4b009154d6a0c8496ffe46ed1e5ce35fc Binary files /dev/null and b/pic/e2000_linux_smmu_non_root_cell_config_3.png differ diff --git a/pic/e2000_linux_smmu_output_1.png b/pic/e2000_linux_smmu_output_1.png new file mode 100755 index 0000000000000000000000000000000000000000..6a4ae872406da88f5793f0617ff4e2979ad091a0 Binary files /dev/null and b/pic/e2000_linux_smmu_output_1.png differ diff --git a/pic/e2000_linux_smmu_output_2.png b/pic/e2000_linux_smmu_output_2.png new file mode 100755 index 0000000000000000000000000000000000000000..8e9d0e85e55f751bda35f1c631bea133d9ad6371 Binary files /dev/null and b/pic/e2000_linux_smmu_output_2.png differ diff --git a/pic/e2000_linux_smmu_output_3.png b/pic/e2000_linux_smmu_output_3.png new file mode 100755 index 0000000000000000000000000000000000000000..f447dc1ad1c96cc941dbbcd54c28cde5fa18020e Binary files /dev/null and b/pic/e2000_linux_smmu_output_3.png differ diff --git a/pic/e2000_linux_smmu_output_4.png b/pic/e2000_linux_smmu_output_4.png new file mode 100755 index 0000000000000000000000000000000000000000..8e5bf6f583a33b114b7869d01807439252b0fe4b Binary files /dev/null and b/pic/e2000_linux_smmu_output_4.png differ diff --git a/pic/e2000_linux_smmu_root_cell_config_1.png b/pic/e2000_linux_smmu_root_cell_config_1.png new file mode 100755 index 0000000000000000000000000000000000000000..1766f7d09e17b51919b6727b8f524f41bf8cdfa6 Binary files /dev/null and b/pic/e2000_linux_smmu_root_cell_config_1.png differ diff --git a/pic/e2000_linux_smmu_root_cell_config_2.png b/pic/e2000_linux_smmu_root_cell_config_2.png new file mode 100755 index 0000000000000000000000000000000000000000..ed1d12e68dd5c3294111a4bc4af5085dea0c5f3f Binary files /dev/null and b/pic/e2000_linux_smmu_root_cell_config_2.png differ