This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

armv8 cache issue with virtualization

I am now writing a hyper-visor based on arm-v8 aarch64. and now Linux kernel can boot  successfully on this hyper-visor. and I test the code on DS5. But there is a cache issue.

The issue is:

after Linux kernel modify the content of translation table (such as called io_remap to map some device memory), it need to flush the related cache, otherwise when accessing the memory space which mapped by io_remap will cause an EL1 data abort.

I found in the DS5 cache view, when executed in EL1, only the content of translation table are cached, but other EL1 memory are not. so question is:

 

1: what the EL1 cache state when EL2 is implemented?

2: why it is need do cache flush after change the translation table ? what am I missing ?

the issue seems that CPU think the cache is disabled in EL1, but the translation table content is cached, so when do translation walk, cpu will not fetch content from the cache.

Thanks

Parents
  • Hi Lemin,

    So, why the translation table will cached even if I disable the stage 2 translation cache, does it is a normal behavior ?

    HCR_EL2.CD

    For the Non-secure EL1&0 translation regime, forces all stage 2 translations for data accesses and translation table walks to Normal memory to be Non-cacheable.

    Non-cacheable only for translation table walks to Normal memory.

    From KVM implementation for aarch64, HCR_EL2.ID, HCR_EL2.CD set to 0.

Reply
  • Hi Lemin,

    So, why the translation table will cached even if I disable the stage 2 translation cache, does it is a normal behavior ?

    HCR_EL2.CD

    For the Non-secure EL1&0 translation regime, forces all stage 2 translations for data accesses and translation table walks to Normal memory to be Non-cacheable.

    Non-cacheable only for translation table walks to Normal memory.

    From KVM implementation for aarch64, HCR_EL2.ID, HCR_EL2.CD set to 0.

Children
No data