Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8
On Fri, May 30, 2014 at 08:55:55PM -0500, Suravee Suthikulpanit wrote: > > > On 05/30/2014 08:33 AM, Frederic Weisbecker wrote: > >>diff --git a/arch/x86/include/asm/debugreg.h > >>b/arch/x86/include/asm/debugreg.h > >>>index 4b528a9..145b009 100644 > >>>--- a/arch/x86/include/asm/debugreg.h > >>>+++ b/arch/x86/include/asm/debugreg.h > >>>@@ -114,5 +114,10 @@ static inline void debug_stack_usage_inc(void) { } > >>> static inline void debug_stack_usage_dec(void) { } > >>> #endif /* X86_64 */ > >>> > >>>+#ifdef CONFIG_CPU_SUP_AMD > >>>+extern void set_dr_addr_mask(unsigned long mask, int dr); > >>>+#else > >>>+static inline void set_dr_addr_mask(unsigned long mask, int dr) { } > >>>+#endif > >I see this symbol in the code but it's not defined anywhere in a Kconfig > >file. > >Maybe you (or I) forgot to include a file in your patches? > > > >Thanks. > > If you are referring to the CONFIG_CPU_SUP_AMD, this is in > arch/x86/Kconfig.cpu Ah I thought it was created in the patchset. Nevermind. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len HW_BREAKPOINT_LEN_8
On Fri, May 30, 2014 at 08:55:55PM -0500, Suravee Suthikulpanit wrote: On 05/30/2014 08:33 AM, Frederic Weisbecker wrote: diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h index 4b528a9..145b009 100644 --- a/arch/x86/include/asm/debugreg.h +++ b/arch/x86/include/asm/debugreg.h @@ -114,5 +114,10 @@ static inline void debug_stack_usage_inc(void) { } static inline void debug_stack_usage_dec(void) { } #endif /* X86_64 */ +#ifdef CONFIG_CPU_SUP_AMD +extern void set_dr_addr_mask(unsigned long mask, int dr); +#else +static inline void set_dr_addr_mask(unsigned long mask, int dr) { } +#endif I see this symbol in the code but it's not defined anywhere in a Kconfig file. Maybe you (or I) forgot to include a file in your patches? Thanks. If you are referring to the CONFIG_CPU_SUP_AMD, this is in arch/x86/Kconfig.cpu Ah I thought it was created in the patchset. Nevermind. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8
On 05/30/2014 08:33 AM, Frederic Weisbecker wrote: diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h >index 4b528a9..145b009 100644 >--- a/arch/x86/include/asm/debugreg.h >+++ b/arch/x86/include/asm/debugreg.h >@@ -114,5 +114,10 @@ static inline void debug_stack_usage_inc(void) { } > static inline void debug_stack_usage_dec(void) { } > #endif /* X86_64 */ > >+#ifdef CONFIG_CPU_SUP_AMD >+extern void set_dr_addr_mask(unsigned long mask, int dr); >+#else >+static inline void set_dr_addr_mask(unsigned long mask, int dr) { } >+#endif I see this symbol in the code but it's not defined anywhere in a Kconfig file. Maybe you (or I) forgot to include a file in your patches? Thanks. If you are referring to the CONFIG_CPU_SUP_AMD, this is in arch/x86/Kconfig.cpu Suravee -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8
Hi Jacob, Suravee, On Thu, May 29, 2014 at 05:26:50PM +0200, Frederic Weisbecker wrote: > From: Jacob Shin > > Implement hardware breakpoint address mask for AMD Family 16h and > above processors. CPUID feature bit indicates hardware support for > DRn_ADDR_MASK MSRs. These masks further qualify DRn/DR7 hardware > breakpoint addresses to allow matching of larger addresses ranges. > > Valuable advice and pseudo code from Oleg Nesterov > > Signed-off-by: Jacob Shin > Signed-off-by: Suravee Suthikulpanit > Cc: Arnaldo Carvalho de Melo > Cc: Ingo Molnar > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Oleg Nesterov > Cc: Peter Zijlstra > Cc: xiakaixu > Signed-off-by: Frederic Weisbecker > --- > arch/x86/include/asm/cpufeature.h | 2 ++ > arch/x86/include/asm/debugreg.h | 5 + > arch/x86/include/asm/hw_breakpoint.h | 1 + > arch/x86/include/uapi/asm/msr-index.h | 4 > arch/x86/kernel/cpu/amd.c | 19 +++ > arch/x86/kernel/hw_breakpoint.c | 20 > 6 files changed, 47 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/include/asm/cpufeature.h > b/arch/x86/include/asm/cpufeature.h > index e265ff9..6bd564d 100644 > --- a/arch/x86/include/asm/cpufeature.h > +++ b/arch/x86/include/asm/cpufeature.h > @@ -170,6 +170,7 @@ > #define X86_FEATURE_TOPOEXT (6*32+22) /* topology extensions CPUID leafs */ > #define X86_FEATURE_PERFCTR_CORE (6*32+23) /* core performance counter > extensions */ > #define X86_FEATURE_PERFCTR_NB (6*32+24) /* NB performance counter > extensions */ > +#define X86_FEATURE_BPEXT(6*32+26) /* data breakpoint extension */ > #define X86_FEATURE_PERFCTR_L2 (6*32+28) /* L2 performance counter > extensions */ > > /* > @@ -338,6 +339,7 @@ extern const char * const x86_power_flags[32]; > #define cpu_has_cx16 boot_cpu_has(X86_FEATURE_CX16) > #define cpu_has_eager_fpuboot_cpu_has(X86_FEATURE_EAGER_FPU) > #define cpu_has_topoext boot_cpu_has(X86_FEATURE_TOPOEXT) > +#define cpu_has_bpextboot_cpu_has(X86_FEATURE_BPEXT) > > #ifdef CONFIG_X86_64 > > diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h > index 4b528a9..145b009 100644 > --- a/arch/x86/include/asm/debugreg.h > +++ b/arch/x86/include/asm/debugreg.h > @@ -114,5 +114,10 @@ static inline void debug_stack_usage_inc(void) { } > static inline void debug_stack_usage_dec(void) { } > #endif /* X86_64 */ > > +#ifdef CONFIG_CPU_SUP_AMD > +extern void set_dr_addr_mask(unsigned long mask, int dr); > +#else > +static inline void set_dr_addr_mask(unsigned long mask, int dr) { } > +#endif I see this symbol in the code but it's not defined anywhere in a Kconfig file. Maybe you (or I) forgot to include a file in your patches? Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len HW_BREAKPOINT_LEN_8
Hi Jacob, Suravee, On Thu, May 29, 2014 at 05:26:50PM +0200, Frederic Weisbecker wrote: From: Jacob Shin jacob.w.s...@gmail.com Implement hardware breakpoint address mask for AMD Family 16h and above processors. CPUID feature bit indicates hardware support for DRn_ADDR_MASK MSRs. These masks further qualify DRn/DR7 hardware breakpoint addresses to allow matching of larger addresses ranges. Valuable advice and pseudo code from Oleg Nesterov o...@redhat.com Signed-off-by: Jacob Shin jacob.w.s...@gmail.com Signed-off-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Cc: Arnaldo Carvalho de Melo a...@ghostprotocols.net Cc: Ingo Molnar mi...@kernel.org Cc: Jiri Olsa jo...@redhat.com Cc: Namhyung Kim namhy...@kernel.org Cc: Oleg Nesterov o...@redhat.com Cc: Peter Zijlstra pet...@infradead.org Cc: xiakaixu xiaka...@huawei.com Signed-off-by: Frederic Weisbecker fweis...@gmail.com --- arch/x86/include/asm/cpufeature.h | 2 ++ arch/x86/include/asm/debugreg.h | 5 + arch/x86/include/asm/hw_breakpoint.h | 1 + arch/x86/include/uapi/asm/msr-index.h | 4 arch/x86/kernel/cpu/amd.c | 19 +++ arch/x86/kernel/hw_breakpoint.c | 20 6 files changed, 47 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index e265ff9..6bd564d 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -170,6 +170,7 @@ #define X86_FEATURE_TOPOEXT (6*32+22) /* topology extensions CPUID leafs */ #define X86_FEATURE_PERFCTR_CORE (6*32+23) /* core performance counter extensions */ #define X86_FEATURE_PERFCTR_NB (6*32+24) /* NB performance counter extensions */ +#define X86_FEATURE_BPEXT(6*32+26) /* data breakpoint extension */ #define X86_FEATURE_PERFCTR_L2 (6*32+28) /* L2 performance counter extensions */ /* @@ -338,6 +339,7 @@ extern const char * const x86_power_flags[32]; #define cpu_has_cx16 boot_cpu_has(X86_FEATURE_CX16) #define cpu_has_eager_fpuboot_cpu_has(X86_FEATURE_EAGER_FPU) #define cpu_has_topoext boot_cpu_has(X86_FEATURE_TOPOEXT) +#define cpu_has_bpextboot_cpu_has(X86_FEATURE_BPEXT) #ifdef CONFIG_X86_64 diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h index 4b528a9..145b009 100644 --- a/arch/x86/include/asm/debugreg.h +++ b/arch/x86/include/asm/debugreg.h @@ -114,5 +114,10 @@ static inline void debug_stack_usage_inc(void) { } static inline void debug_stack_usage_dec(void) { } #endif /* X86_64 */ +#ifdef CONFIG_CPU_SUP_AMD +extern void set_dr_addr_mask(unsigned long mask, int dr); +#else +static inline void set_dr_addr_mask(unsigned long mask, int dr) { } +#endif I see this symbol in the code but it's not defined anywhere in a Kconfig file. Maybe you (or I) forgot to include a file in your patches? Thanks. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len HW_BREAKPOINT_LEN_8
On 05/30/2014 08:33 AM, Frederic Weisbecker wrote: diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h index 4b528a9..145b009 100644 --- a/arch/x86/include/asm/debugreg.h +++ b/arch/x86/include/asm/debugreg.h @@ -114,5 +114,10 @@ static inline void debug_stack_usage_inc(void) { } static inline void debug_stack_usage_dec(void) { } #endif /* X86_64 */ +#ifdef CONFIG_CPU_SUP_AMD +extern void set_dr_addr_mask(unsigned long mask, int dr); +#else +static inline void set_dr_addr_mask(unsigned long mask, int dr) { } +#endif I see this symbol in the code but it's not defined anywhere in a Kconfig file. Maybe you (or I) forgot to include a file in your patches? Thanks. If you are referring to the CONFIG_CPU_SUP_AMD, this is in arch/x86/Kconfig.cpu Suravee -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8
On Wed, Dec 11, 2013 at 06:28:23AM -0600, suravee.suthikulpa...@amd.com wrote: > @@ -295,11 +301,17 @@ static int arch_build_bp_info(struct perf_event *bp) > break; > #endif > default: > - return -EINVAL; > + if (!is_power_of_2(bp->attr.bp_len)) > + return -EINVAL; > + if (!cpu_has_bpext) > + return -EOPNOTSUPP; > + info->mask = bp->attr.bp_len - 1; > + info->len = X86_BREAKPOINT_LEN_1; I think I asked this before but I can't remember. So dr7 must have length as LEN_1 for breakpoint extension? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] perf/x86/amd: AMD support for bp_len HW_BREAKPOINT_LEN_8
On Wed, Dec 11, 2013 at 06:28:23AM -0600, suravee.suthikulpa...@amd.com wrote: @@ -295,11 +301,17 @@ static int arch_build_bp_info(struct perf_event *bp) break; #endif default: - return -EINVAL; + if (!is_power_of_2(bp-attr.bp_len)) + return -EINVAL; + if (!cpu_has_bpext) + return -EOPNOTSUPP; + info-mask = bp-attr.bp_len - 1; + info-len = X86_BREAKPOINT_LEN_1; I think I asked this before but I can't remember. So dr7 must have length as LEN_1 for breakpoint extension? -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/