Page MenuHomeFreeBSD

D45527.id140210.diff
No OneTemporary

D45527.id140210.diff

diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c
--- a/sys/dev/hwpmc/hwpmc_arm64.c
+++ b/sys/dev/hwpmc/hwpmc_arm64.c
@@ -34,6 +34,7 @@
#include <machine/pmc_mdep.h>
#include <machine/cpu.h>
+#include <machine/machdep.h>
#include "opt_acpi.h"
@@ -186,10 +187,18 @@
switch (a->pm_caps & (PMC_CAP_SYSTEM | PMC_CAP_USER)) {
case PMC_CAP_SYSTEM:
+ /* Exclude EL0 */
config |= PMEVTYPER_U;
+ if (in_vhe()) {
+ /* If in VHE we need to include EL2 and exclude EL1 */
+ config |= PMEVTYPER_NSH | PMEVTYPER_P;
+ }
break;
case PMC_CAP_USER:
+ /* Exclude EL1 */
config |= PMEVTYPER_P;
+ /* Exclude EL2 */
+ config &= ~PMEVTYPER_NSH;
break;
default:
/*
@@ -197,6 +206,10 @@
* (default setting) or if both flags are specified
* (user explicitly requested both qualifiers).
*/
+ if (in_vhe()) {
+ /* If in VHE we need to include EL2 */
+ config |= PMEVTYPER_NSH;
+ }
break;
}

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 11, 8:16 PM (13 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29549617
Default Alt Text
D45527.id140210.diff (953 B)

Event Timeline