Skip to contentSkip to conversation

HP_SIM with performance monitoring

PATCH Ian Wienand 2 participants 3 messages Aug 26, 2003 – Aug 27, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

I noticed that when trying to boot 2.6.0-test4 in the simulator with perfmon turned on it ended up oopsing with a "General Exception: IA-64 Reserved Register/Field fault" in pfm_init_percpu() when it tried to zero out the PMD registers.

I have no idea if the simulator implements perfmon support, but noticed that there are PMC and PMD registers in the register window. Am I right in saying the simulator has only 8, skipping odd registers, where mckinley has 15 PMC and 17 PMD registers?

I can think of a number of things to fix it but am not sure which is correct -- the GENERIC definitions look kind of correct; maybe CONFIG_PERFMON should be turned off for HP_SIM; or create a dummy PMC/PMD register definition (attached). Any enlightenment appreciated.

-i

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1291 -> 1.1292
# arch/ia64/kernel/perfmon.c 1.56 -> 1.57
# (new) -> 1.1 arch/ia64/kernel/perfmon_hpsim.h
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/26 [email protected] 1.1292
# Update for simulator with perfmon
# --------------------------------------------
#

arch/ia64/kernel/perfmon.c +3 -1
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
@@ -659,7 +659,9 @@
 static void pfm_lazy_save_regs (struct task_struct *ta);
 #endif
 
-#if   defined(CONFIG_ITANIUM)
+#if   defined(CONFIG_IA64_HP_SIM)
+#include "perfmon_hpsim.h"
+#elif defined(CONFIG_ITANIUM)
 #include "perfmon_itanium.h"
 #elif defined(CONFIG_MCKINLEY)
 #include "perfmon_mckinley.h"
arch/ia64/kernel/perfmon_hpsim.h new file +67 -0

67 lines not on this page · raw message

#1 lore raw

Ian,

Quoted 6 lines · Ian Wienand

I noticed that when trying to boot 2.6.0-test4 in the simulator with perfmon turned on it ended up oopsing with a "General Exception: IA-64 Reserved Register/Field fault" in pfm_init_percpu() when it tried to zero out the PMD registers.

That does not surprise me. The simulator does have some PMD and PMC registers but they do not count anything.

Quoted 4 lines

I have no idea if the simulator implements perfmon support, but noticed that there are PMC and PMD registers in the register window. Am I right in saying the simulator has only 8, skipping odd registers, where mckinley has 15 PMC and 17 PMD registers?

Ski seems to have 16 PMCS and 16 PMDS implemented.

Quoted 6 lines

I can think of a number of things to fix it but am not sure which is correct -- the GENERIC definitions look kind of correct; maybe CONFIG_PERFMON should be turned off for HP_SIM; or create a dummy PMC/PMD register definition (attached). Any enlightenment appreciated.

Yes, something along the lines of your patch would be a clean way of fixing the problem. However, I would do something similar to what is in perfmon_generic.h. Simply define the PMDS as counters (PFM_REG_COUNTING). It will not hurt because they actually do not count anything. And create the PMC table as counter (PFM_REG_COUNTING).

Thanks for spotting this problem.

--
-Stephane

#2 lore raw
In reply to Ian Wienand
Quoted 5 lines · Stephane Eranian

Yes, something along the lines of your patch would be a clean way of fixing the problem. However, I would do something similar to what is in perfmon_generic.h. Simply define the PMDS as counters (PFM_REG_COUNTING). It will not hurt because they actually do not count anything. And create the PMC table as counter (PFM_REG_COUNTING).

Ok attached patch does it like that.

-i

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1291 -> 1.1293
# arch/ia64/kernel/perfmon.c 1.56 -> 1.57
# (new) -> 1.2 arch/ia64/kernel/perfmon_hpsim.h
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/26 [email protected] 1.1292
# Update for simulator with perfmon
# --------------------------------------------
# 03/08/27 [email protected] 1.1293
# Update after changes suggested by Stephane
# --------------------------------------------
#

arch/ia64/kernel/perfmon.c +3 -1
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
@@ -659,7 +659,9 @@
 static void pfm_lazy_save_regs (struct task_struct *ta);
 #endif
 
-#if   defined(CONFIG_ITANIUM)
+#if   defined(CONFIG_IA64_HP_SIM)
+#include "perfmon_hpsim.h"
+#elif defined(CONFIG_ITANIUM)
 #include "perfmon_itanium.h"
 #elif defined(CONFIG_MCKINLEY)
 #include "perfmon_mckinley.h"
arch/ia64/kernel/perfmon_hpsim.h new file +73 -0

73 lines not on this page · raw message