kata-containers / agent

Kata Containers version 1.x agent (for version 2.x see https://github.com/kata-containers/kata-containers). Virtual Machine agent for hardware virtualized containers
https://katacontainers.io/
Apache License 2.0
242 stars 113 forks source link

rootBusPath: create rootBusPath dynamically. #860

Closed jongwu closed 3 years ago

jongwu commented 4 years ago

Currently, rootBusPath is set as a constant value. Bus this pcie bus path is not alway static, eg. the rootBus on arm64 is "/devices/platform/4010000000.pcie/pci0000:00". The address part of "4010000000.pcie" may vary with the maxMem in qemu so it should not be a fixed value.

For exmaple: HIGH PCIE address reserved in qemu on virt is from 0 to 512G. The lower part of address may be allocated to normal memory. In general, normal memory is largely less than 256G, so the base address of HIGH PCIE can be 256G. But, in case the maxmem is large enough, like around 256G, the base address of HIGH PCIE must be increase, eg. 300G. In the current implementation of kata-runtime, the maxmem in qemu is the host memory size. So if the host memory size is large enough, the prefix of the pci device path name will be different from rootBusPath set in kata-agent which can lead to failure on device hotplug.

This patch offer a mechanism to create rootBusPath dynamically but only give implemention for arm64 and return the default value of rootBusPath for other arch.

Fixes: #859 Signed-off-by: Jianyong Wu jianyong.wu@arm.com

@jodh-intel @devimc

codecov[bot] commented 4 years ago

Codecov Report

Merging #860 (d66fcb8) into master (5cfb8ec) will increase coverage by 0.08%. The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master     #860      +/-   ##
==========================================
+ Coverage   57.72%   57.81%   +0.08%     
==========================================
  Files          17       19       +2     
  Lines        2370     2375       +5     
==========================================
+ Hits         1368     1373       +5     
  Misses        840      840              
  Partials      162      162              
alicefr commented 4 years ago

cc @jschintag

devimc commented 4 years ago

/test

jodh-intel commented 4 years ago

/test

jodh-intel commented 4 years ago

@jongwu - Travis is failing - looks like you need to update the tests for the latest changes.

jongwu commented 4 years ago

thanks @jodh-intel , I have fixed it. now could you please retrigger ci again?

jodh-intel commented 4 years ago

/test

jongwu commented 4 years ago

hello @jodh-intel -, I can't see ARM CI, could please trigger it?

jodh-intel commented 4 years ago

/test-arm

@jongwu - I've added you to the runtime + agent repos so you should be able to trigger builds yourself from now on. Also, are you planning to port this to the new 2.0 rust agent?

amshinde commented 4 years ago

/test-arm

amshinde commented 4 years ago

Dont see an ARM CI. @chavafg Is it not enabled for the agent?

chavafg commented 4 years ago

hmm, yeah, it seems that arm CI has not been enabled for this repo. @jongwu could you help adding it? let me know if you need help.

jongwu commented 4 years ago

/test-arm

jongwu commented 4 years ago

/test

jongwu commented 4 years ago

/test

jongwu commented 4 years ago

/test

jongwu commented 4 years ago

Thanks @jodh-intel -, I have composed the rust version of this patch, see rust. It's not easy for me to write rust code.

jodh-intel commented 4 years ago

Thanks @jongwu! No problem - we can help if necessary :smile:

jongwu commented 4 years ago

thanks @jodh-intel .

jongwu commented 3 years ago

Hello @jodh-intel @chavafg, all tests pass. isn't time to merge this?