|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 18/22] xen/arm: p2m: Rework the context switch to another VTTBR in flush_tlb_domain
Hi Stefano, On 27/07/16 02:12, Stefano Stabellini wrote: On Wed, 20 Jul 2016, Julien Grall wrote:The current implementation of flush_tlb_domain is relying on the domain to have a single p2m. With the upcoming feature altp2m, a single domain may have different p2m. So we would need to switch to the correct p2m in order to flush the TLBs. Rather than checking whether the domain is not the current domain, check whether the VTTBR is different. The resulting assembly code is much smaller: from 38 instructions (+ 2 functions call) to 22 instructions.That's true but SYSREG reads are more expensive than regular instructions. This argument is not really true. The ARM ARM (D7-1879 in ARM DDI 0487A.j) says: "Reads of the System registers can occur out of order with respect to earlier instructions executed on the same PE, provided that any data dependencies between the instructions are respected". So It will depend on how the micro-architecture implemented access to SYSREG. However, the current code already contains plenty of SYSREG read access (via the macro current using TPIDR_EL2). So the number of SYSREG accesses stay exactly the same. I also forgot to mention that the number of instructions in the function call (10 instructions). So we are down from 58 instructions to 22 instructions. Therefore, smaller code and likely better performance.
I should be able, however I think it will not bring much more optimization here but obfuscating a bit more the code. Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |