[PATCH RFC v3 0/4] x86/bus_lock: Enable bus lock detection

2020-10-30 Thread Fenghua Yu
). RFC v2: - Architecture changed based on feedback from Thomas and PeterZ. #DB is no longer generated for bus lock in ring0. - Split the one single patch into four patches. [RFC v1 can be found at: https://lore.kernel.org/lkml/1595021700-68460-1-git-send-email-fenghua...@intel.com/] Fenghua

[PATCH RFC v3 2/4] x86/bus_lock: Handle warn and fatal in #DB for bus lock

2020-10-30 Thread Fenghua Yu
the first #DB is being handled. So no need to handle #DB for bus lock detected in the kernel. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: RFC v3: - Remove DR6_RESERVED change (PeterZ). arch/x86/include/asm/cpu.h | 10 ++- arch/x86/include/asm/msr-index.h | 1 +

[PATCH v3 4/4] Documentation/admin-guide: Change doc for split_lock_detect parameter

2020-11-20 Thread Fenghua Yu
Since #DB for bus lock detect changes the split_lock_detect parameter, update the documentation for the changes. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v3: - Enable Bus Lock Detection when fatal to handle bus lock from non-WB (PeterZ). v1: - Fix a few wording issues

[PATCH v3 1/4] x86/cpufeatures: Enumerate #DB for bus lock detection

2020-11-20 Thread Fenghua Yu
nel by an #DB trap after a user instruction acquires a bus lock and is executed. This allows the kernel to enforce user application throttling or mitigations. The CPU feature flag to be shown in /proc/cpuinfo will be "bus_lock_detect". Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck

[PATCH v3 2/4] x86/bus_lock: Handle warn and fatal in #DB for bus lock

2020-11-20 Thread Fenghua Yu
rom non-WB triggers #DB. Default option is "warn". Hardware only generates #DB for bus lock detect when CPL>0 to avoid nested #DB from multiple bus locks while the first #DB is being handled. So no need to handle #DB for bus lock detected in the kernel. Signed-off-by: Fenghua Yu Review

[PATCH v3 0/4] x86/bus_lock: Enable bus lock detection

2020-11-20 Thread Fenghua Yu
mentation (Randy). RFC v2: - Architecture changed based on feedback from Thomas and PeterZ. #DB is no longer generated for bus lock in ring0. - Split the one single patch into four patches. [RFC v1 can be found at: https://lore.kernel.org/lkml/1595021700-68460-1-git-send-email-fenghua...@intel.co

[PATCH v3 3/4] x86/bus_lock: Set rate limit for bus lock

2020-11-20 Thread Fenghua Yu
To enforce user application throttling or mitigations, extend the existing split lock detect kernel parameter: split_lock_detect=ratelimit:N It limits bus lock rate to N per second for non-root users. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/intel.c

[PATCH v4 03/17] selftests/resctrl: Rename CQM test as CMT test

2020-11-30 Thread Fenghua Yu
Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/README| 4 +-- tools/testing/selftests/resctrl/cache.c | 4 +-- .../resctrl/{cqm_test.c => cmt_test.c}| 20 +++--- tools/testing/selftests/resctrl/resctrl.h | 10 +++

[PATCH v4 08/17] selftests/resctrl: Ensure sibling CPU is not same as original CPU

2020-11-30 Thread Fenghua Yu
selection by taking the provided/default CPU into account and ensuring a sibling that is a different CPU is selected. Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrlfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/

[PATCH v4 16/17] selftests/resctrl: Fix incorrect parsing of iMC counters

2020-11-30 Thread Fenghua Yu
presents an iMC counter, else, skip the directory. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 22 +-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tool

[PATCH v4 01/17] selftests/resctrl: Fix compilation issues for global variables

2020-11-30 Thread Fenghua Yu
to the functions where they are used. To fix issues for other global variables (e.g: bm_pid, ppid, llc_occup_path and is_amd) that are used across .c files, declare them as extern. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c | 12

[PATCH v4 02/17] selftests/resctrl: Clean up resctrl features check

2020-11-30 Thread Fenghua Yu
Checking resctrl features call strcmp() to compare feature strings (e.g. "mba", "cat" etc). The checkings are error prone and don't have good coding style. Define the constant strings in macros and call strncmp() to solve the potential issues. Suggested-by: Shuah Khan Signe

[PATCH v4 07/17] selftests/resctrl: Use resctrl/info for feature detection

2020-11-30 Thread Fenghua Yu
mbm__bytes Please note that only L3_CAT, L3_CMT, MBA and MBM are supported. CDP and L2 variants can be added later. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl.h | 6 ++- tools/testing/selftests/resctrl/resctrlfs.c | 51

[PATCH v4 06/17] selftests/resctrl: Check for resctrl mount point only if resctrl FS is supported

2020-11-30 Thread Fenghua Yu
at /proc/mounts Steps 2 and 3 will fail if the platform does not support resctrl file system. So, there is no need to check for them if step 1 fails. Fix this by returning immediately if the platform does not support resctrl file system. Signed-off-by: Fenghua Yu --- tools/testing/selftests

[PATCH v4 04/17] selftests/resctrl: Fix printed messages

2020-11-30 Thread Fenghua Yu
From: Reinette Chatre Fix one instance where "not" (without a space) is printed on test failure resulting in output of "notok" on test failure. Add a missing newline to the printed help text to improve readability. Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu

[PATCH v4 10/17] selftests/resctrl: Fix MBA/MBM results reporting format

2020-11-30 Thread Fenghua Yu
value is within 5% (randomly chosen value) of imc_mbm value. If the difference is greater than 5% of imc_mbm value, treat it is a failure. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/mba_test.c | 20 +++- tools/testing/selftests/resctrl/mbm_test.c | 13

[PATCH v4 09/17] selftests/resctrl: Fix missing options "-n" and "-p"

2020-11-30 Thread Fenghua Yu
as invalid options. Fix this by adding them to the list of characters that getopt() recognizes as valid arguments. Please note that the main() function already has the logic to deal with the values passed as part of these arguments and hence no changes are needed there. Signed-off-by: Fenghua Yu

[PATCH v4 00/17] Miscellaneous fixes for resctrl selftests

2020-11-30 Thread Fenghua Yu
https://lore.kernel.org/linux-kselftest/cover.1583657204.git.sai.praneeth.prak...@intel.com/] Fenghua Yu (15): selftests/resctrl: Fix compilation issues for global variables selftests/resctrl: Clean up resctrl features check selftests/resctrl: Rename CQM test as CMT test selftests/resctrl: Add

[PATCH v4 05/17] selftests/resctrl: Add a few dependencies

2020-11-30 Thread Fenghua Yu
't support resctrl file system. Fix this by checking for the return value of check_resctrlfs_support() in the main function. If resctrl file system isn't supported on the platform then exit the test suite gracefully without attempting to run any of resctrl unit tests. Signed-off-by: Fenghua Yu --- too

[PATCH v4 12/17] selftests/resctrl: Don't hard code value of "no_of_bits" variable

2020-11-30 Thread Fenghua Yu
no_of_bits is equal to half of the maximum number of bits in the cbm mask. Please note that CMT test is still hard coded to 5 bits. It will change in subsequent patches that change CMT test. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c | 5 - tools/testing

[PATCH v4 17/17] selftests/resctrl: Fix checking for < 0 for unsigned values

2020-11-30 Thread Fenghua Yu
ter Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 41 +++ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index d6f0688182e8..ce8f0ec15f7b 100

[PATCH v4 14/17] selftests/resctrl: Skip the test if requested resctrl feature is not supported

2020-11-30 Thread Fenghua Yu
s disabled Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c| 3 --- tools/testing/selftests/resctrl/mba_test.c| 3 --- tools/testing/selftests/resctrl/mbm_test.c| 3 --- .../testing/selftests/resctrl/resctrl_te

[PATCH v4 13/17] selftests/resctrl: Modularize resctrl test suite main() function

2020-11-30 Thread Fenghua Yu
() function. Adding these wrapper functions makes it easier to add any logic to each individual test. Please note that this is a preparatory patch for the next one and no functional changes are intended. Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- .../testing/selftests/resctrl

[PATCH v4 11/17] selftests/resctrl: Enable gcc checks to detect buffer overflows

2020-11-30 Thread Fenghua Yu
and enable _FORTIFY_SOURCE gcc check to catch any future buffer overflow errors. Reported-by: David Binderman Suggested-by: David Binderman Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/resctrl/cmt_test.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH v4 15/17] selftests/resctrl: Fix unmount resctrl FS

2020-11-30 Thread Fenghua Yu
resctrl FS to check if mba is enabled on the platform or not and finds that the H/W doesn't support mba and hence will return false to run_mba_test(). This in turn makes the main() function return without unmounting resctrl FS. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl

[PATCH v4 4/4] Documentation/admin-guide: Change doc for split_lock_detect parameter

2020-11-24 Thread Fenghua Yu
Since #DB for bus lock detect changes the split_lock_detect parameter, update the documentation for the changes. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck Acked-by: Randy Dunlap --- Change Log: v4: - Fix a ratelimit wording issue in the doc (Randy). - Patch 4 is acked by Randy (Randy

[PATCH v4 3/4] x86/bus_lock: Set rate limit for bus lock

2020-11-24 Thread Fenghua Yu
To enforce user application throttling or mitigations, extend the existing split lock detect kernel parameter: split_lock_detect=ratelimit:N It limits bus lock rate to N per second for non-root users. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/intel.c

[PATCH v4 2/4] x86/bus_lock: Handle warn and fatal in #DB for bus lock

2020-11-24 Thread Fenghua Yu
rom non-WB triggers #DB. Default option is "warn". Hardware only generates #DB for bus lock detect when CPL>0 to avoid nested #DB from multiple bus locks while the first #DB is being handled. So no need to handle #DB for bus lock detected in the kernel. Signed-off-by: Fenghua Yu Review

[PATCH v4 0/4] x86/bus_lock: Enable bus lock detection

2020-11-24 Thread Fenghua Yu
: https://lore.kernel.org/lkml/1595021700-68460-1-git-send-email-fenghua...@intel.com/] Fenghua Yu (4): x86/cpufeatures: Enumerate #DB for bus lock detection x86/bus_lock: Handle warn and fatal in #DB for bus lock x86/bus_lock: Set rate limit for bus lock Documentation/admin-guide: Change

[PATCH v4 1/4] x86/cpufeatures: Enumerate #DB for bus lock detection

2020-11-24 Thread Fenghua Yu
nel by an #DB trap after a user instruction acquires a bus lock and is executed. This allows the kernel to enforce user application throttling or mitigations. The CPU feature flag to be shown in /proc/cpuinfo will be "bus_lock_detect". Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck

Re: [PATCH RFC v3 2/4] x86/bus_lock: Handle warn and fatal in #DB for bus lock

2020-11-06 Thread Fenghua Yu
Hi, Xiaoyao, On Tue, Nov 03, 2020 at 08:15:27PM +0800, Xiaoyao Li wrote: > On 10/31/2020 8:27 AM, Fenghua Yu wrote: > > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c > > index 3c70fb34028b..1c3442000972 100644 > > --- a/arch/x86/kernel/traps.c > > ++

[PATCH 3/4] x86/bus_lock: Set rate limit for bus lock

2020-11-07 Thread Fenghua Yu
To enforce user application throttling or mitigations, extend the existing split lock detect kernel parameter: split_lock_detect=ratelimit:N It limits bus lock rate to N per second for non-root users. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/intel.c

[PATCH 0/4] x86/bus_lock: Enable bus lock detection

2020-11-07 Thread Fenghua Yu
B is no longer generated for bus lock in ring0. - Split the one single patch into four patches. [RFC v1 can be found at: https://lore.kernel.org/lkml/1595021700-68460-1-git-send-email-fenghua...@intel.com/] Fenghua Yu (4): x86/cpufeatures: Enumerate #DB for bus lock detection x86/bus_lock: Ha

[PATCH 4/4] Documentation/admin-guide: Change doc for split_lock_detect parameter

2020-11-07 Thread Fenghua Yu
Since #DB for bus lock detect changes the split_lock_detect parameter, update the documentation for the changes. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: - Fix a few wording issues (Randy). RFC v2: - Simplify the documentation (Randy). .../admin-guide/kernel

[PATCH 2/4] x86/bus_lock: Handle warn and fatal in #DB for bus lock

2020-11-07 Thread Fenghua Yu
the first #DB is being handled. So no need to handle #DB for bus lock detected in the kernel. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: - Check bus lock bit by its positive polarity (Xiaoyao). RFC v3: - Remove DR6_RESERVED change (PeterZ). arch/x86/include/asm/cpu.h

[PATCH 1/4] x86/cpufeatures: Enumerate #DB for bus lock detection

2020-11-07 Thread Fenghua Yu
ome CPUs have ability to notify the kernel by an #DB trap after a user instruction acquires a bus lock and is executed. This allows the kernel to enforce user application throttling or mitigations. The CPU feature flag to be shown in /proc/cpuinfo will be "bus_lock_detect". Signed-off-b

Re: [PATCH] arch/x86/kernel/cpu/umwait.c - remove unused variable

2019-08-08 Thread Fenghua Yu
On Thu, Aug 08, 2019 at 10:32:38PM +0200, Thomas Gleixner wrote: > Valdis, > > On Thu, 8 Aug 2019, Valdis Klētnieks wrote: > > On Thu, 08 Aug 2019 22:04:03 +0200, Thomas Gleixner said: It isn't > > clear that whatever is doing the device_initcall()s will be able to > > do any reasonable

[RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-13 Thread Fenghua Yu
doesn't support resctrl now. So it's safe to move the X86_FEATURE_CQM_* features to scattered features word 11 for KVM. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/cpufeature.h | 3 +-- arch/x86/include/asm/cpufeatures.h | 17 ++--- arch/x86/kernel/cpu/common.c | 14

[RFC PATCH 3/3] x86/cpufeatures: Enumerate new AVX512 BFLOAT16 instructions

2019-06-13 Thread Fenghua Yu
AVX512_BF16. Detailed information of the CPUID bit and AVX512 BFLOAT16 instructions can be found in the latest Intel Architecture Instruction Set Extensions and Future Features Programming Reference. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/cpufeature.h | 1 + arch/x86/include/asm

[RFC PATCH 0/3] x86/cpufeatures: Re-arrange a few features and enumerate AVX512 BFLOAT16 intructions

2019-06-13 Thread Fenghua Yu
CPUID in resctrl initialization. Fenghua Yu (3): x86/resctrl: Get max rmid and occupancy scale directly from CPUID instead of cpuinfo_x86 x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11 x86/cpufeatures: Enumerate new AVX512 BFLOAT16 instructions arch/x86

[RFC PATCH 1/3] x86/resctrl: Get max rmid and occupancy scale directly from CPUID instead of cpuinfo_x86

2019-06-13 Thread Fenghua Yu
CPU is fine. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/processor.h | 3 --- arch/x86/kernel/cpu/common.c | 28 -- arch/x86/kernel/cpu/resctrl/internal.h | 2 +- arch/x86/kernel/cpu/resctrl/monitor.c | 28 +++--- 4 files

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 02:27:50PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 01:44:10PM +0200, Borislav Petkov wrote: > > On Thu, Jun 13, 2019 at 01:51:03PM -0700, Fenghua Yu wrote: > > > It's a waste for the four X86_FEATURE_CQM_* features to occupy two > > &

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 03:41:23PM +0200, Borislav Petkov wrote: > + Radim and Paolo. See upthread for context. > > On Fri, Jun 14, 2019 at 06:17:02AM -0700, Fenghua Yu wrote: > > > Alternatively - and what I think is the better solution - would be to > > >

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 07:14:24AM -0700, Sean Christopherson wrote: > On Fri, Jun 14, 2019 at 03:41:23PM +0200, Borislav Petkov wrote: > > + Radim and Paolo. See upthread for context. > > > > On Fri, Jun 14, 2019 at 06:17:02AM -0700, Fenghua Yu wrote: > > > >

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 04:26:11PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 07:15:20AM -0700, Fenghua Yu wrote: > > Adding this small patch into patch 0002 will solve the build errors without > > changing the build checks. > > There's no need for that if you re

Re: [RFC PATCH 1/3] x86/resctrl: Get max rmid and occupancy scale directly from CPUID instead of cpuinfo_x86

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 01:16:33PM +0200, Borislav Petkov wrote: > On Thu, Jun 13, 2019 at 01:51:02PM -0700, Fenghua Yu wrote: > > Although x86_cache_max_rmid and x86_cache_occ_scale are read only once > > during resctrl initialization, they are always stored in cpuinfo_x86 on >

Re: [RFC PATCH 1/3] x86/resctrl: Get max rmid and occupancy scale directly from CPUID instead of cpuinfo_x86

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 07:47:01PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 09:55:28AM -0700, Fenghua Yu wrote: > > When this function is called, X86_FEATURE_CQM_LLC must be supported and > > one of X86_FEATURE_CQM_OCCUP_LLC, X86_FEATUR

Re: [RFC PATCH 2/3] x86/cpufeatures: Combine word 11 and 12 into new scattered features word 11

2019-06-14 Thread Fenghua Yu
On Fri, Jun 14, 2019 at 05:02:19PM +0200, Borislav Petkov wrote: > On Fri, Jun 14, 2019 at 07:25:51AM -0700, Fenghua Yu wrote: > > But without this small patch, CPUID_7_EDX is 17 instead of > > NCAPINTS(19)-1=18 in patch 0002. Of course CPUID_7_EDX is 18 correctly > > eve

Re: [PATCH v7 9/9] x86/mmu: Allocate/free PASID

2020-09-03 Thread Fenghua Yu
Hi, Thomas, Andy, et al, On Thu, Aug 27, 2020 at 08:06:34AM -0700, Fenghua Yu wrote: > A PASID is allocated for an "mm" the first time any thread binds > to an SVM capable device and is freed from the "mm" when the SVM is > unbound by the last thread. It's possible f

Re: [PATCH v7 1/9] iommu: Change type of pasid to u32

2020-09-04 Thread Fenghua Yu
drm, iommu: Change type ... > > > On Thu, Aug 27, 2020 at 08:06:26AM -0700, Fenghua Yu wrote: > > PASID is defined as a few different types in iommu including "int", > > "u32", and "unsigned int". To be consistent and to match with uapi &

Re: [PATCH v7 1/9] iommu: Change type of pasid to u32

2020-09-04 Thread Fenghua Yu
Hi, Boris, On Fri, Sep 04, 2020 at 09:45:19PM +0200, Borislav Petkov wrote: > On Fri, Sep 04, 2020 at 04:06:13PM +0000, Fenghua Yu wrote: > > Thank you very much for your review! > > I'm not done with my review yet. > > > Could you please consider to commit the series

[PATCH v3 1/2] x86/resctrl: Enumerate per-thread MBA

2020-08-24 Thread Fenghua Yu
file to know if the feature is supported. Signed-off-by: Fenghua Yu Reviewed-by: Babu Moger Reviewed-by: Reinette Chatre --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/cpuid-deps.c | 1 + arch/x86/kernel/cpu/scattered.c| 1 + 3 files changed, 3 insertions(+) diff --git

[PATCH v3 2/2] x86/resctrl: Enable user to view thread or core throttling mode

2020-08-24 Thread Fenghua Yu
...@amd.com that AMD bandwidth allocation is already at thread level but that the AMD implementation does not use a memory delay throttle mode. So to avoid confusion the thread throttling mode would be UNDEFINED on AMD systems and the "thread_throttle_mode" file will not be visible. Originally-by:

[PATCH v3 0/2] x86/resctrl: Enable user to view thread or core throttling mode

2020-08-24 Thread Fenghua Yu
tor. Change Log: v3: - Rename "get_rdtgroup_rftype_get_by_name()" to "rdtgroup_get_rftype_by_name()" (Boris). - Re-base the patch set to tip:x86/cache (Boris). v2: - Rename "arch_throttle_mode" to "throttle_mode" and "rdtgroup_rftype_by_name()" to "rdtgroup_rftype_g

Re: [PATCH 0/2] x86/resctrl: Enable user to view thread or core throttling mode

2020-08-18 Thread Fenghua Yu
Hi, X86 maintainers, On Thu, Jul 16, 2020 at 10:53:12AM -0700, Fenghua Yu wrote: > This series enumerates Memory Bandwidth Allocation (MBA) per-thread > feature and introduces a new resctrl file "thread_throttle_mode". > The file shows either "per-thread" on newer s

Re: [PATCH v8 0/9] x86: tag application address space for devices

2020-09-17 Thread Fenghua Yu
Hi, Joerg, On Wed, Sep 16, 2020 at 10:06:02AM +0200, Joerg Roedel wrote: > On Tue, Sep 15, 2020 at 09:30:04AM -0700, Fenghua Yu wrote: > > Ashok Raj (1): > > Documentation/x86: Add documentation for SVA (Shared Virtual > > Addressing) > > > > Fenghua Yu (

Re: [PATCH v8 3/9] Documentation/x86: Add documentation for SVA (Shared Virtual Addressing)

2020-09-18 Thread Fenghua Yu
On Thu, Sep 17, 2020 at 07:30:41PM +0200, Borislav Petkov wrote: > On Thu, Sep 17, 2020 at 10:22:39AM -0700, Raj, Ashok wrote: > > s/translation again/translation > > Ok, last one. Now stop looking at that text because you'll find more. > > :-))) Thank you very much for taking care of the

[PATCH RFC v2 4/4] Documentation: Change doc for split_lock_detect parameter

2020-10-28 Thread Fenghua Yu
Since #DB for bus lock detect changes the split_lock_detect parameter, update the documentation for the changes. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- .../admin-guide/kernel-parameters.txt | 47 +++ 1 file changed, 39 insertions(+), 8 deletions(-) diff

[PATCH RFC v2 0/4] x86/bus_lock: Enable bus lock detection

2020-10-28 Thread Fenghua Yu
ger generated for bus lock in ring0. - Split the one single patch into four patches. [RFC v1 can be found at: https://lore.kernel.org/lkml/1595021700-68460-1-git-send-email-fenghua...@intel.com/] Fenghua Yu (4): x86/cpufeatures: Enumerate #DB for bus lock detection x86/bus_lock: Handle warn and

[PATCH] x86/resctrl: Correct MBM total and local values

2020-09-28 Thread Fenghua Yu
/en/documents/specification-updates/xeon-e5-v4-spec-update.pdf The problem is described in details in "3.6 Intel MBM RMID Imbalance": https://software.intel.com/content/www/us/en/develop/articles/intel-resource-director-technology-rdt-reference-manual.html Signed-off-by: Fenghua Yu Revi

[PATCH v2 0/2] x86/resctrl: Workaround MBM errata

2020-10-12 Thread Fenghua Yu
and the correction table in resctrl.rst (Boris). - Address various comments on patch 2 (Boris). - Change the documentation URLs to stable archive.org (Tony). Fenghua Yu (2): Documentation: x86: Rename resctrl_ui.rst and add two errata to the file x86/resctrl: Correct MBM total and local values

[PATCH v2 1/2] Documentation: x86: Rename resctrl_ui.rst and add two errata to the file

2020-10-12 Thread Fenghua Yu
Processors Reference Manual: https://software.intel.com/content/www/us/en/develop/articles/intel-resource-director-technology-rdt-reference-manual.html Suggested-by: Borislav Petkov Signed-off-by: Fenghua Yu --- Change Log: v2: - Document the correction factor table and errata in resctrl.rst (Boris

[PATCH v2 2/2] x86/resctrl: Correct MBM total and local values

2020-10-12 Thread Fenghua Yu
around the errata, MBM total and local readings are corrected using the correction factor table. If rmid > rmid threshold, MBM total and local values should be multiplied by the correction factor. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v2: - Add "const" for

Re: [PATCH v2 1/2] Documentation: x86: Rename resctrl_ui.rst and add two errata to the file

2020-10-12 Thread Fenghua Yu
Hi, Randy, On Mon, Oct 12, 2020 at 07:54:32PM -0700, Randy Dunlap wrote: > On 10/12/20 7:46 PM, Fenghua Yu wrote: > > diff --git a/Documentation/conf.py b/Documentation/conf.py > > index c50310d9..b5b2be8eec22 100644 > > --- a/Documentation/conf.py > > +++ b/Documen

[PATCH v3 2/2] x86/resctrl: Correct MBM total and local values

2020-10-13 Thread Fenghua Yu
around the errata, MBM total and local readings are corrected using the correction factor table. If rmid > rmid threshold, MBM total and local values should be multiplied by the correction factor. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v2: - Add "const" for

[PATCH v3 0/2] x86/resctrl: Work around MBM errata

2020-10-13 Thread Fenghua Yu
in patch 1 (Randy). v2: - Document the errata and the correction table in resctrl.rst (Boris). - Address various comments on patch 2 (Boris). - Change the documentation URLs to stable archive.org (Tony). Fenghua Yu (2): Documentation: x86: Rename resctrl_ui.rst and add two errata

[PATCH v3 1/2] Documentation: x86: Rename resctrl_ui.rst and add two errata to the file

2020-10-13 Thread Fenghua Yu
Processors Reference Manual: https://software.intel.com/content/www/us/en/develop/articles/intel-resource-director-technology-rdt-reference-manual.html Suggested-by: Borislav Petkov Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v3: - Remove unnecessary conf.py change in patch 1 (Randy

Re: [PATCH RFC v3 4/4] Documentation/admin-guide: Change doc for split_lock_detect parameter

2020-11-02 Thread Fenghua Yu
Hi, Randy, On Fri, Oct 30, 2020 at 08:14:15PM -0700, Randy Dunlap wrote: > On 10/30/20 5:27 PM, Fenghua Yu wrote: > > diff --git a/Documentation/admin-guide/kernel-parameters.txt > > b/Documentation/admin-guide/kernel-parameters.txt > > index 526d65d8573a

[PATCH v2 04/10] x86/microcode_intel_lib.c: Early update ucode on Intel's CPU

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Define interfaces microcode_sanity_check() and get_matching_microcode(). They are called both in early boot time and in microcode Intel driver. Signed-off-by: Fenghua Yu --- arch/x86/kernel/microcode_intel_lib.c | 174 + 1 files changed, 174

[PATCH v2 06/10] x86/head_32.S: Early update ucode in 32-bit

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu This updates ucode in 32-bit kernel. At this point, there is no paging and no virtual address yet. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel

[PATCH v2 03/10] x86/microcode_core_early.c: Define interfaces for early loading ucode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Define interfaces load_ucode_bsp() and load_ucode_ap() to load ucode on BSP and AP in early boot time. These are generic interfaces. Internally they call vendor specific implementations. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode.h | 23

[PATCH v2 09/10] x86/mm/init.c: Copy ucode from initrd image to memory

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Before initrd image is freed, copy valid ucode patches from initrd image to kernel virtual memory. The saved ucode will be used to update AP in resume. Signed-off-by: Fenghua Yu --- arch/x86/mm/init.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff

[PATCH v2 10/10] x86/Kconfig: Configurations to enable/disable the feature

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu MICROCODE_INTEL_LIB, MICROCODE_INTEL_EARLY, and MICROCODE_EARLY are three new configurations to enable or disable the feature. Signed-off-by: Fenghua Yu --- arch/x86/Kconfig | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/x86

[PATCH v2 00/11] x86/microcode: Early load microcode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu The problem in current microcode loading method is that we load a microcode way, way too late; ideally we should load it before turning paging on. This may only be practical on 32 bits since we can't get to 64-bit mode without paging on, but we should still do it as early

[PATCH v2 08/10] x86/smpboot.c: Early update ucode on AP

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu This updates ucode on AP. At this point, BSP should store some valid ucode patches in memory if it finds the ucode patches in initrd. AP searches the stored ucode and uploads the ucode. Signed-off-by: Fenghua Yu --- arch/x86/kernel/smpboot.c |7 +++ 1 files changed, 7

[PATCH v2 05/10] x86/microcode_intel_early.c: Early update ucode on Intel's CPU

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Implementation of early update ucode on Intel's CPU. load_ucode_intel_bsp() scans ucode in initrd image file which is a cpio format ucode followed by ordinary initrd image file. The binary ucode file is stored in kernel/x86/microcode/GenuineIntel/microcode.hex in the cpio data

[PATCH v2 02/10] x86/microcode_intel.h: Define functions and macros for early loading ucode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Define some functions and macros that will be used in early loading ucode. Some of them are moved from microcode_intel.c driver in order to be called in early boot phase before module can be called. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode_intel.h | 106

[PATCH v2 01/10] Documentation/x86: Early load microcode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Documenation for early loading microcode methodology. Signed-off-by: Fenghua Yu --- Documentation/x86/early-microcode.txt | 43 + 1 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 Documentation/x86/early-microcode.txt

[PATCH v10 08/14] x86-32, hotplug: Add start_cpu0() entry point to head_32.S

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_32.S for 32-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/x86

[PATCH v10 14/14] x86, topology: Debug CPU00 hotplug

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu CONFIG_DEBUG_HOTPLUG_CPU0 is for debugging the CPU0 hotplug feature. The switch offlines CPU0 as soon as possible and boots userspace up with CPU0 offlined. User can online CPU0 back after boot time. The default value of the switch is off. To debug CPU0 hotplug, you need

[PATCH v10 05/14] x86, hotplug, suspend: Online CPU0 for suspend or hibernate

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Because x86 BIOS requires CPU0 to resume from sleep, suspend or hibernate can't be executed if CPU0 is detected offline. To make suspend or hibernate and further resume succeed, CPU0 must be online. Signed-off-by: Fenghua Yu --- arch/x86/power/cpu.c | 44

[PATCH v10 13/14] x86/i387.c: Initialize thread xstate only on CPU0 only once

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu init_thread_xstate() is only called once to avoid overriding xstate_size during boot time or during CPU hotplug. Signed-off-by: Fenghua Yu --- arch/x86/kernel/i387.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch

[PATCH v10 12/14] x86, hotplug: Handle retrigger irq by the first available CPU

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu The first cpu in irq cfg->domain is likely to be CPU 0 and may not be available when CPU 0 is offline. Instead of using CPU 0 to handle retriggered irq, we use first available CPU which is online and in this irq's domain. Signed-off-by: Fenghua Yu --- arch/x86/kernel/a

[PATCH v10 10/14] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node.

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Previously these functions were not run on the BSP (CPU 0, the boot processor) since the boot processor init would only be executed before this functionality was initialized. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/common.c |5 ++--- 1 files changed, 2

[PATCH v10 11/14] x86, hotplug: The first online processor saves the MTRR state

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Ask the first online CPU to save mtrr instead of asking BSP. BSP could be offline when mtrr_save_state() is called. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/mtrr/main.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel

[PATCH v10 01/14] doc: Add x86 CPU0 online/offline feature

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on, CPU0 is hotpluggable. Otherwise, by default CPU0 is not hotpluggable and kernel parameter cpu0_hotplug enables CPU0 online/offline feature. The documentations point out two known CPU0 dependencies. First, resume from hibernate

[PATCH v10 02/14] x86, Kconfig: Add config switch for CPU0 hotplug

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu New config switch CONFIG_BOOTPARAM_HOTPLUG_CPU0 sets default state of whether the CPU0 hotplug is on or off. If the switch is off, CPU0 is not hotpluggable by default. But the CPU0 hotplug feature can still be turned on by kernel parameter cpu0_hotplug at boot. If the switch

[PATCH v10 09/14] x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Instead of waiting for STARTUP after INITs, BSP will execute the BIOS boot-strap code which is not a desired behavior for waking up BSP. To avoid the boot-strap code, wake up CPU0 by NMI instead. This works to wake up soft offlined CPU0 only. If CPU0 is hard offlined (i.e

[PATCH v10 07/14] x86-64, hotplug: Add start_cpu0() entry point to head_64.S

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_64.S for 64-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_64.S | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/arch

[PATCH v10 06/14] kernel/cpu.c: Add comment for priority in cpu_hotplug_pm_callback

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu cpu_hotplug_pm_callback should have higher priority than bsp_pm_callback which depends on cpu_hotplug_pm_callback to disable cpu hotplug to avoid race during bsp online checking. This is to hightlight the priorities between the two callbacks in case people may overlook

[PATCH v10 0/14] x86: Arbitrary CPU hot(un)plug support

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu CPU0 or BSP (Bootstrap Processor) has been the last processor that can not be hot removed on x86. This patchset implements CPU0 or BSP online and offline and removes this obstacle to CPU hotplug. RAS needs the feature. If socket0 needs to be hotplugged for any reason (any

[PATCH v10 04/14] x86, hotplug: Support functions for CPU0 online/offline

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Add smp_store_boot_cpu_info() to store cpu info for BSP during boot time. Now smp_store_cpu_info() stores cpu info for bringing up BSP or AP after it's offline. Continue to online CPU0 in native_cpu_up(). Continue to offline CPU0 in native_cpu_disable(). Signed-off

[PATCH v10 03/14] x86, topology: Don't offline CPU0 if any PIC irq can not be migrated out of it

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU is turned on, CPU0 hotplug feature is enabled by default. If CONFIG_BOOTPARAM_HOTPLUG_CPU is not turned on, CPU0 hotplug feature is not enabled by default. The kernel parameter cpu0_hotplug can enable CPU0 hotplug feature at boot. Currently

[PATCH v9 03/12] x86, topology: Don't offline CPU0 if any PIC irq can not be migrated out of it

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU is turned on, CPU0 hotplug feature is enabled by default. If CONFIG_BOOTPARAM_HOTPLUG_CPU is not turned on, CPU0 hotplug feature is not enabled by default. The kernel parameter cpu0_hotplug can enable CPU0 hotplug feature at boot. Currently

[PATCH v9 06/12] x86-64, hotplug: Add start_cpu0() entry point to head_64.S

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_64.S for 64-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_64.S | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch

[PATCH v9 01/12] doc: Add x86 CPU0 online/offline feature

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on, CPU0 is hotpluggable. Otherwise, by default CPU0 is not hotpluggable and kernel parameter cpu0_hotplug enables CPU0 online/offline feature. The documentations point out two known CPU0 dependencies. First, resume from hibernate

[PATCH v9 11/12] x86/i387.c: Initialize thread xstate only on CPU0 only once

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu init_thread_xstate() is only called once to avoid overriding xstate_size during boot time or during CPU hotplug. Signed-off-by: Fenghua Yu --- arch/x86/kernel/i387.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch

[PATCH v9 10/12] x86, hotplug: The first online processor saves the MTRR state

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu Ask the first online CPU to save mtrr instead of asking BSP. BSP could be offline when mtrr_save_state() is called. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/mtrr/main.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel

[PATCH v9 08/12] x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu Instead of waiting for STARTUP after INITs, BSP will execute the BIOS boot-strap code which is not a desired behavior for waking up BSP. To avoid the boot-strap code, wake up CPU0 by NMI instead. This works to wake up soft offlined CPU0 only. If CPU0 is hard offlined (i.e

[PATCH v9 09/12] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node.

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu Previously these functions were not run on the BSP (CPU 0, the boot processor) since the boot processor init would only be executed before this functionality was initialized. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/common.c |5 ++--- 1 files changed, 2

<    3   4   5   6   7   8   9   10   11   12   >