• M
    arm64: perf: avoid PMXEV* indirection · d55eae51
    Mark Rutland 提交于
    hulk inclusion
    category: feature
    bugzilla: 12804
    CVE: NA
    
    -------------------------------------------------
    
    Currently we access the counter registers and their respective type
    registers indirectly. This requires us to write to PMSELR, issue an ISB,
    then access the relevant PMXEV* registers.
    
    This is unfortunate, because:
    
    * Under virtualization, accessing one registers requires two traps to
      the hypervisor, even though we could access the register directly with
      a single trap.
    
    * We have to issue an ISB which we could otherwise avoid the cost of.
    
    * When we use NMIs, the NMI handler will have to save/restore the select
      register in case the code it preempted was attempting to access a
      counter or its type register.
    
    We can avoid these issues by directly accessing the relevant registers.
    This patch adds helpers to do so.
    Signed-off-by: NMark Rutland <mark.rutland@arm.com>
    [Julien T.: Don't inline read/write functions to avoid big code-size
    	increase, remove unused read_pmevtypern function.]
    Signed-off-by: NJulien Thierry <julien.thierry@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: NWei Li <liwei391@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    d55eae51
perf_event.c 42.6 KB