From: Greg Kroah-Hartman Date: Wed, 16 Oct 2019 13:40:55 +0000 (-0700) Subject: 5.3-stable patches X-Git-Tag: v4.4.197~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=62b9a201a5166f952c5b099902a8cb9ed6cc4478;p=thirdparty%2Fkernel%2Fstable-queue.git 5.3-stable patches added patches: arm64-sve-fix-wrong-free-for-task-thread.sve_state.patch drm-i915-bump-skl-max-plane-width-to-5k-for-linear-x-tiled.patch drm-i915-mark-contents-as-dirty-on-a-write-fault.patch drm-i915-whitelist-common_slice_chicken2.patch drm-msm-use-the-correct-dma_sync-calls-harder.patch fix-the-locking-in-dcache_readdir-and-friends.patch ftrace-get-a-reference-counter-for-the-trace_array-on-filter-files.patch hwmon-fix-hwmon_p_min_alarm-mask.patch media-stkwebcam-fix-runtime-pm-after-driver-unbind.patch mtd-rawnand-au1550nd-fix-au_read_buf16-prototype.patch tracing-get-trace_array-reference-for-available_tracers-files.patch tracing-hwlat-don-t-ignore-outer-loop-duration-when-calculating-max_latency.patch tracing-hwlat-report-total-time-spent-in-all-nmis-during-the-sample.patch x86-asm-fix-mwaitx-c-state-hint-value.patch --- diff --git a/queue-5.3/arm64-sve-fix-wrong-free-for-task-thread.sve_state.patch b/queue-5.3/arm64-sve-fix-wrong-free-for-task-thread.sve_state.patch new file mode 100644 index 00000000000..bc84b007839 --- /dev/null +++ b/queue-5.3/arm64-sve-fix-wrong-free-for-task-thread.sve_state.patch @@ -0,0 +1,123 @@ +From 4585fc59c0e813188d6a4c5de1f6976fce461fc2 Mon Sep 17 00:00:00 2001 +From: Masayoshi Mizuma +Date: Mon, 30 Sep 2019 16:56:00 -0400 +Subject: arm64/sve: Fix wrong free for task->thread.sve_state + +From: Masayoshi Mizuma + +commit 4585fc59c0e813188d6a4c5de1f6976fce461fc2 upstream. + +The system which has SVE feature crashed because of +the memory pointed by task->thread.sve_state was destroyed +by someone. + +That is because sve_state is freed while the forking the +child process. The child process has the pointer of sve_state +which is same as the parent's because the child's task_struct +is copied from the parent's one. If the copy_process() +fails as an error on somewhere, for example, copy_creds(), +then the sve_state is freed even if the parent is alive. +The flow is as follows. + +copy_process + p = dup_task_struct + => arch_dup_task_struct + *dst = *src; // copy the entire region. +: + retval = copy_creds + if (retval < 0) + goto bad_fork_free; +: +bad_fork_free: +... + delayed_free_task(p); + => free_task + => arch_release_task_struct + => fpsimd_release_task + => __sve_free + => kfree(task->thread.sve_state); + // free the parent's sve_state + +Move child's sve_state = NULL and clearing TIF_SVE flag +to arch_dup_task_struct() so that the child doesn't free the +parent's one. +There is no need to wait until copy_process() to clear TIF_SVE for +dst, because the thread flags for dst are initialized already by +copying the src task_struct. +This change simplifies the code, so get rid of comments that are no +longer needed. + +As a note, arm64 used to have thread_info on the stack. So it +would not be possible to clear TIF_SVE until the stack is initialized. +From commit c02433dd6de3 ("arm64: split thread_info from task stack"), +the thread_info is part of the task, so it should be valid to modify +the flag from arch_dup_task_struct(). + +Cc: stable@vger.kernel.org # 4.15.x- +Fixes: bc0ee4760364 ("arm64/sve: Core task context handling") +Signed-off-by: Masayoshi Mizuma +Reported-by: Hidetoshi Seto +Suggested-by: Dave Martin +Reviewed-by: Dave Martin +Tested-by: Julien Grall +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/kernel/process.c | 32 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +--- a/arch/arm64/kernel/process.c ++++ b/arch/arm64/kernel/process.c +@@ -323,22 +323,27 @@ void arch_release_task_struct(struct tas + fpsimd_release_task(tsk); + } + +-/* +- * src and dst may temporarily have aliased sve_state after task_struct +- * is copied. We cannot fix this properly here, because src may have +- * live SVE state and dst's thread_info may not exist yet, so tweaking +- * either src's or dst's TIF_SVE is not safe. +- * +- * The unaliasing is done in copy_thread() instead. This works because +- * dst is not schedulable or traceable until both of these functions +- * have been called. +- */ + int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) + { + if (current->mm) + fpsimd_preserve_current_state(); + *dst = *src; + ++ /* We rely on the above assignment to initialize dst's thread_flags: */ ++ BUILD_BUG_ON(!IS_ENABLED(CONFIG_THREAD_INFO_IN_TASK)); ++ ++ /* ++ * Detach src's sve_state (if any) from dst so that it does not ++ * get erroneously used or freed prematurely. dst's sve_state ++ * will be allocated on demand later on if dst uses SVE. ++ * For consistency, also clear TIF_SVE here: this could be done ++ * later in copy_process(), but to avoid tripping up future ++ * maintainers it is best not to leave TIF_SVE and sve_state in ++ * an inconsistent state, even temporarily. ++ */ ++ dst->thread.sve_state = NULL; ++ clear_tsk_thread_flag(dst, TIF_SVE); ++ + return 0; + } + +@@ -352,13 +357,6 @@ int copy_thread(unsigned long clone_flag + memset(&p->thread.cpu_context, 0, sizeof(struct cpu_context)); + + /* +- * Unalias p->thread.sve_state (if any) from the parent task +- * and disable discard SVE state for p: +- */ +- clear_tsk_thread_flag(p, TIF_SVE); +- p->thread.sve_state = NULL; +- +- /* + * In case p was allocated the same task_struct pointer as some + * other recently-exited task, make sure p is disassociated from + * any cpu that may have run that now-exited task recently. diff --git a/queue-5.3/drm-i915-bump-skl-max-plane-width-to-5k-for-linear-x-tiled.patch b/queue-5.3/drm-i915-bump-skl-max-plane-width-to-5k-for-linear-x-tiled.patch new file mode 100644 index 00000000000..a86bba6e88b --- /dev/null +++ b/queue-5.3/drm-i915-bump-skl-max-plane-width-to-5k-for-linear-x-tiled.patch @@ -0,0 +1,78 @@ +From dc7890995e04bacb45ab21e0daaeae1e7c803eb3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Thu, 5 Sep 2019 16:50:43 +0300 +Subject: drm/i915: Bump skl+ max plane width to 5k for linear/x-tiled +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit dc7890995e04bacb45ab21e0daaeae1e7c803eb3 upstream. + +The officially validated plane width limit is 4k on skl+, however +we already had people using 5k displays before we started to enforce +the limit. Also it seems Windows allows 5k resolutions as well +(though not sure if they do it with one plane or two). + +According to hw folks 5k should work with the possible +exception of the following features: +- Ytile (already limited to 4k) +- FP16 (already limited to 4k) +- render compression (already limited to 4k) +- KVMR sprite and cursor (don't care) +- horizontal panning (need to verify this) +- pipe and plane scaling (need to verify this) + +So apart from last two items on that list we are already +fine. We should really verify what happens with those last +two items but I don't have a 5k display on hand atm so it'll +have to wait. + +In the meantime let's just bump the limit back up to 5k since +several users have already been using it without apparent issues. +At least we'll be no worse off than we were prior to lowering +the limits. + +Cc: stable@vger.kernel.org +Cc: Sean Paul +Cc: José Roberto de Souza +Tested-by: Leho Kraav +Fixes: 372b9ffb5799 ("drm/i915: Fix skl+ max plane width") +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111501 +Signed-off-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20190905135044.2001-1-ville.syrjala@linux.intel.com +Reviewed-by: Maarten Lankhorst +Reviewed-by: Sean Paul +(cherry picked from commit bed34ef544f9ab37ab349c04cf4142282c4dcf5d) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/display/intel_display.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/display/intel_display.c ++++ b/drivers/gpu/drm/i915/display/intel_display.c +@@ -3291,7 +3291,20 @@ static int skl_max_plane_width(const str + switch (fb->modifier) { + case DRM_FORMAT_MOD_LINEAR: + case I915_FORMAT_MOD_X_TILED: +- return 4096; ++ /* ++ * Validated limit is 4k, but has 5k should ++ * work apart from the following features: ++ * - Ytile (already limited to 4k) ++ * - FP16 (already limited to 4k) ++ * - render compression (already limited to 4k) ++ * - KVMR sprite and cursor (don't care) ++ * - horizontal panning (TODO verify this) ++ * - pipe and plane scaling (TODO verify this) ++ */ ++ if (cpp == 8) ++ return 4096; ++ else ++ return 5120; + case I915_FORMAT_MOD_Y_TILED_CCS: + case I915_FORMAT_MOD_Yf_TILED_CCS: + /* FIXME AUX plane? */ diff --git a/queue-5.3/drm-i915-mark-contents-as-dirty-on-a-write-fault.patch b/queue-5.3/drm-i915-mark-contents-as-dirty-on-a-write-fault.patch new file mode 100644 index 00000000000..44baa8d9386 --- /dev/null +++ b/queue-5.3/drm-i915-mark-contents-as-dirty-on-a-write-fault.patch @@ -0,0 +1,55 @@ +From b925708f28c2b7a3a362d709bd7f77bc75c1daac Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Fri, 20 Sep 2019 13:18:21 +0100 +Subject: drm/i915: Mark contents as dirty on a write fault +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Chris Wilson + +commit b925708f28c2b7a3a362d709bd7f77bc75c1daac upstream. + +Since dropping the set-to-gtt-domain in commit a679f58d0510 ("drm/i915: +Flush pages on acquisition"), we no longer mark the contents as dirty on +a write fault. This has the issue of us then not marking the pages as +dirty on releasing the buffer, which means the contents are not written +out to the swap device (should we ever pick that buffer as a victim). +Notably, this is visible in the dumb buffer interface used for cursors. +Having updated the cursor contents via mmap, and swapped away, if the +shrinker should evict the old cursor, upon next reuse, the cursor would +be invisible. + +E.g. echo 80 > /proc/sys/kernel/sysrq ; echo f > /proc/sysrq-trigger + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111541 +Fixes: a679f58d0510 ("drm/i915: Flush pages on acquisition") +Signed-off-by: Chris Wilson +Cc: Matthew Auld +Cc: Ville Syrjälä +Cc: # v5.2+ +Reviewed-by: Matthew Auld +Link: https://patchwork.freedesktop.org/patch/msgid/20190920121821.7223-1-chris@chris-wilson.co.uk +(cherry picked from commit 5028851cdfdf78dc22eacbc44a0ab0b3f599ee4a) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/gem/i915_gem_mman.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c ++++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c +@@ -317,7 +317,11 @@ vm_fault_t i915_gem_fault(struct vm_faul + msecs_to_jiffies_timeout(CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND)); + GEM_BUG_ON(!obj->userfault_count); + +- i915_vma_set_ggtt_write(vma); ++ if (write) { ++ GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj)); ++ i915_vma_set_ggtt_write(vma); ++ obj->mm.dirty = true; ++ } + + err_fence: + i915_vma_unpin_fence(vma); diff --git a/queue-5.3/drm-i915-whitelist-common_slice_chicken2.patch b/queue-5.3/drm-i915-whitelist-common_slice_chicken2.patch new file mode 100644 index 00000000000..1e5c4be4c99 --- /dev/null +++ b/queue-5.3/drm-i915-whitelist-common_slice_chicken2.patch @@ -0,0 +1,42 @@ +From 282b7fd5f5ab4eba499e1162c1e2802c6d0bb82e Mon Sep 17 00:00:00 2001 +From: Kenneth Graunke +Date: Tue, 10 Sep 2019 18:48:01 -0700 +Subject: drm/i915: Whitelist COMMON_SLICE_CHICKEN2 + +From: Kenneth Graunke + +commit 282b7fd5f5ab4eba499e1162c1e2802c6d0bb82e upstream. + +This allows userspace to use "legacy" mode for push constants, where +they are committed at 3DPRIMITIVE or flush time, rather than being +committed at 3DSTATE_BINDING_TABLE_POINTERS_XS time. Gen6-8 and Gen11 +both use the "legacy" behavior - only Gen9 works in the "new" way. + +Conflating push constants with binding tables is painful for userspace, +we would like to be able to avoid doing so. + +Signed-off-by: Kenneth Graunke +Cc: stable@vger.kernel.org +Reviewed-by: Chris Wilson +Signed-off-by: Chris Wilson +Link: https://patchwork.freedesktop.org/patch/msgid/20190911014801.26821-1-kenneth@whitecape.org +(cherry picked from commit 0606259e3b3a1220a0f04a92a1654a3f674f47ee) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/gt/intel_workarounds.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/i915/gt/intel_workarounds.c ++++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c +@@ -1042,6 +1042,9 @@ static void gen9_whitelist_build(struct + + /* WaAllowUMDToModifyHDCChicken1:skl,bxt,kbl,glk,cfl */ + whitelist_reg(w, GEN8_HDC_CHICKEN1); ++ ++ /* WaSendPushConstantsFromMMIO:skl,bxt */ ++ whitelist_reg(w, COMMON_SLICE_CHICKEN2); + } + + static void skl_whitelist_build(struct intel_engine_cs *engine) diff --git a/queue-5.3/drm-msm-use-the-correct-dma_sync-calls-harder.patch b/queue-5.3/drm-msm-use-the-correct-dma_sync-calls-harder.patch new file mode 100644 index 00000000000..1c0933aa395 --- /dev/null +++ b/queue-5.3/drm-msm-use-the-correct-dma_sync-calls-harder.patch @@ -0,0 +1,60 @@ +From 9f614197c744002f9968e82c649fdf7fe778e1e7 Mon Sep 17 00:00:00 2001 +From: Rob Clark +Date: Wed, 4 Sep 2019 09:56:03 -0700 +Subject: drm/msm: Use the correct dma_sync calls harder + +From: Rob Clark + +commit 9f614197c744002f9968e82c649fdf7fe778e1e7 upstream. + +Looks like the dma_sync calls don't do what we want on armv7 either. +Fixes: + + Unable to handle kernel paging request at virtual address 50001000 + pgd = (ptrval) + [50001000] *pgd=00000000 + Internal error: Oops: 805 [#1] SMP ARM + Modules linked in: + CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-00271-g9f159ae07f07 #4 + Hardware name: Freescale i.MX53 (Device Tree Support) + PC is at v7_dma_clean_range+0x20/0x38 + LR is at __dma_page_cpu_to_dev+0x28/0x90 + pc : [] lr : [] psr: 20000013 + sp : d80b5a88 ip : de96c000 fp : d840ce6c + r10: 00000000 r9 : 00000001 r8 : d843e010 + r7 : 00000000 r6 : 00008000 r5 : ddb6c000 r4 : 00000000 + r3 : 0000003f r2 : 00000040 r1 : 50008000 r0 : 50001000 + Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none + Control: 10c5387d Table: 70004019 DAC: 00000051 + Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) + +Signed-off-by: Rob Clark +Fixes: 3de433c5b38a ("drm/msm: Use the correct dma_sync calls in msm_gem") +Tested-by: Fabio Estevam +Signed-off-by: Fabio Estevam +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/msm/msm_gem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/msm/msm_gem.c ++++ b/drivers/gpu/drm/msm/msm_gem.c +@@ -50,7 +50,7 @@ static void sync_for_device(struct msm_g + { + struct device *dev = msm_obj->base.dev->dev; + +- if (get_dma_ops(dev)) { ++ if (get_dma_ops(dev) && IS_ENABLED(CONFIG_ARM64)) { + dma_sync_sg_for_device(dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + } else { +@@ -63,7 +63,7 @@ static void sync_for_cpu(struct msm_gem_ + { + struct device *dev = msm_obj->base.dev->dev; + +- if (get_dma_ops(dev)) { ++ if (get_dma_ops(dev) && IS_ENABLED(CONFIG_ARM64)) { + dma_sync_sg_for_cpu(dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + } else { diff --git a/queue-5.3/fix-the-locking-in-dcache_readdir-and-friends.patch b/queue-5.3/fix-the-locking-in-dcache_readdir-and-friends.patch new file mode 100644 index 00000000000..54269e3143c --- /dev/null +++ b/queue-5.3/fix-the-locking-in-dcache_readdir-and-friends.patch @@ -0,0 +1,222 @@ +From d4f4de5e5ef8efde85febb6876cd3c8ab1631999 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Sun, 15 Sep 2019 12:12:39 -0400 +Subject: Fix the locking in dcache_readdir() and friends + +From: Al Viro + +commit d4f4de5e5ef8efde85febb6876cd3c8ab1631999 upstream. + +There are two problems in dcache_readdir() - one is that lockless traversal +of the list needs non-trivial cooperation of d_alloc() (at least a switch +to list_add_rcu(), and probably more than just that) and another is that +it assumes that no removal will happen without the directory locked exclusive. +Said assumption had always been there, never had been stated explicitly and +is violated by several places in the kernel (devpts and selinuxfs). + + * replacement of next_positive() with different calling conventions: +it returns struct list_head * instead of struct dentry *; the latter is +passed in and out by reference, grabbing the result and dropping the original +value. + * scan is under ->d_lock. If we run out of timeslice, cursor is moved +after the last position we'd reached and we reschedule; then the scan continues +from that place. To avoid livelocks between multiple lseek() (with cursors +getting moved past each other, never reaching the real entries) we always +skip the cursors, need_resched() or not. + * returned list_head * is either ->d_child of dentry we'd found or +->d_subdirs of parent (if we got to the end of the list). + * dcache_readdir() and dcache_dir_lseek() switched to new helper. +dcache_readdir() always holds a reference to dentry passed to dir_emit() now. +Cursor is moved to just before the entry where dir_emit() has failed or into +the very end of the list, if we'd run out. + * move_cursor() eliminated - it had sucky calling conventions and +after fixing that it became simply list_move() (in lseek and scan_positives) +or list_move_tail() (in readdir). + + All operations with the list are under ->d_lock now, and we do not +depend upon having all file removals done with parent locked exclusive +anymore. + +Cc: stable@vger.kernel.org +Reported-by: "zhengbin (A)" +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman + +--- + fs/libfs.c | 134 +++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 69 insertions(+), 65 deletions(-) + +--- a/fs/libfs.c ++++ b/fs/libfs.c +@@ -89,58 +89,47 @@ int dcache_dir_close(struct inode *inode + EXPORT_SYMBOL(dcache_dir_close); + + /* parent is locked at least shared */ +-static struct dentry *next_positive(struct dentry *parent, +- struct list_head *from, +- int count) ++/* ++ * Returns an element of siblings' list. ++ * We are looking for th positive after

; if ++ * found, dentry is grabbed and passed to caller via *. ++ * If no such element exists, the anchor of list is returned ++ * and * is set to NULL. ++ */ ++static struct list_head *scan_positives(struct dentry *cursor, ++ struct list_head *p, ++ loff_t count, ++ struct dentry **res) + { +- unsigned *seq = &parent->d_inode->i_dir_seq, n; +- struct dentry *res; +- struct list_head *p; +- bool skipped; +- int i; ++ struct dentry *dentry = cursor->d_parent, *found = NULL; + +-retry: +- i = count; +- skipped = false; +- n = smp_load_acquire(seq) & ~1; +- res = NULL; +- rcu_read_lock(); +- for (p = from->next; p != &parent->d_subdirs; p = p->next) { ++ spin_lock(&dentry->d_lock); ++ while ((p = p->next) != &dentry->d_subdirs) { + struct dentry *d = list_entry(p, struct dentry, d_child); +- if (!simple_positive(d)) { +- skipped = true; +- } else if (!--i) { +- res = d; +- break; ++ // we must at least skip cursors, to avoid livelocks ++ if (d->d_flags & DCACHE_DENTRY_CURSOR) ++ continue; ++ if (simple_positive(d) && !--count) { ++ spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); ++ if (simple_positive(d)) ++ found = dget_dlock(d); ++ spin_unlock(&d->d_lock); ++ if (likely(found)) ++ break; ++ count = 1; ++ } ++ if (need_resched()) { ++ list_move(&cursor->d_child, p); ++ p = &cursor->d_child; ++ spin_unlock(&dentry->d_lock); ++ cond_resched(); ++ spin_lock(&dentry->d_lock); + } + } +- rcu_read_unlock(); +- if (skipped) { +- smp_rmb(); +- if (unlikely(*seq != n)) +- goto retry; +- } +- return res; +-} +- +-static void move_cursor(struct dentry *cursor, struct list_head *after) +-{ +- struct dentry *parent = cursor->d_parent; +- unsigned n, *seq = &parent->d_inode->i_dir_seq; +- spin_lock(&parent->d_lock); +- for (;;) { +- n = *seq; +- if (!(n & 1) && cmpxchg(seq, n, n + 1) == n) +- break; +- cpu_relax(); +- } +- __list_del(cursor->d_child.prev, cursor->d_child.next); +- if (after) +- list_add(&cursor->d_child, after); +- else +- list_add_tail(&cursor->d_child, &parent->d_subdirs); +- smp_store_release(seq, n + 2); +- spin_unlock(&parent->d_lock); ++ spin_unlock(&dentry->d_lock); ++ dput(*res); ++ *res = found; ++ return p; + } + + loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) +@@ -158,17 +147,28 @@ loff_t dcache_dir_lseek(struct file *fil + return -EINVAL; + } + if (offset != file->f_pos) { ++ struct dentry *cursor = file->private_data; ++ struct dentry *to = NULL; ++ struct list_head *p; ++ + file->f_pos = offset; +- if (file->f_pos >= 2) { +- struct dentry *cursor = file->private_data; +- struct dentry *to; +- loff_t n = file->f_pos - 2; +- +- inode_lock_shared(dentry->d_inode); +- to = next_positive(dentry, &dentry->d_subdirs, n); +- move_cursor(cursor, to ? &to->d_child : NULL); +- inode_unlock_shared(dentry->d_inode); ++ inode_lock_shared(dentry->d_inode); ++ ++ if (file->f_pos > 2) { ++ p = scan_positives(cursor, &dentry->d_subdirs, ++ file->f_pos - 2, &to); ++ spin_lock(&dentry->d_lock); ++ list_move(&cursor->d_child, p); ++ spin_unlock(&dentry->d_lock); ++ } else { ++ spin_lock(&dentry->d_lock); ++ list_del_init(&cursor->d_child); ++ spin_unlock(&dentry->d_lock); + } ++ ++ dput(to); ++ ++ inode_unlock_shared(dentry->d_inode); + } + return offset; + } +@@ -190,25 +190,29 @@ int dcache_readdir(struct file *file, st + { + struct dentry *dentry = file->f_path.dentry; + struct dentry *cursor = file->private_data; +- struct list_head *p = &cursor->d_child; +- struct dentry *next; +- bool moved = false; ++ struct list_head *anchor = &dentry->d_subdirs; ++ struct dentry *next = NULL; ++ struct list_head *p; + + if (!dir_emit_dots(file, ctx)) + return 0; + + if (ctx->pos == 2) +- p = &dentry->d_subdirs; +- while ((next = next_positive(dentry, p, 1)) != NULL) { ++ p = anchor; ++ else ++ p = &cursor->d_child; ++ ++ while ((p = scan_positives(cursor, p, 1, &next)) != anchor) { + if (!dir_emit(ctx, next->d_name.name, next->d_name.len, + d_inode(next)->i_ino, dt_type(d_inode(next)))) + break; +- moved = true; +- p = &next->d_child; + ctx->pos++; + } +- if (moved) +- move_cursor(cursor, p); ++ spin_lock(&dentry->d_lock); ++ list_move_tail(&cursor->d_child, p); ++ spin_unlock(&dentry->d_lock); ++ dput(next); ++ + return 0; + } + EXPORT_SYMBOL(dcache_readdir); diff --git a/queue-5.3/ftrace-get-a-reference-counter-for-the-trace_array-on-filter-files.patch b/queue-5.3/ftrace-get-a-reference-counter-for-the-trace_array-on-filter-files.patch new file mode 100644 index 00000000000..ef190b50165 --- /dev/null +++ b/queue-5.3/ftrace-get-a-reference-counter-for-the-trace_array-on-filter-files.patch @@ -0,0 +1,103 @@ +From 9ef16693aff8137faa21d16ffe65bb9832d24d71 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Fri, 11 Oct 2019 17:56:57 -0400 +Subject: ftrace: Get a reference counter for the trace_array on filter files + +From: Steven Rostedt (VMware) + +commit 9ef16693aff8137faa21d16ffe65bb9832d24d71 upstream. + +The ftrace set_ftrace_filter and set_ftrace_notrace files are specific for +an instance now. They need to take a reference to the instance otherwise +there could be a race between accessing the files and deleting the instance. + +It wasn't until the :mod: caching where these file operations started +referencing the trace_array directly. + +Cc: stable@vger.kernel.org +Fixes: 673feb9d76ab3 ("ftrace: Add :mod: caching infrastructure to trace_array") +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/ftrace.c | 27 ++++++++++++++++++--------- + 1 file changed, 18 insertions(+), 9 deletions(-) + +--- a/kernel/trace/ftrace.c ++++ b/kernel/trace/ftrace.c +@@ -3540,21 +3540,22 @@ ftrace_regex_open(struct ftrace_ops *ops + struct ftrace_hash *hash; + struct list_head *mod_head; + struct trace_array *tr = ops->private; +- int ret = 0; ++ int ret = -ENOMEM; + + ftrace_ops_init(ops); + + if (unlikely(ftrace_disabled)) + return -ENODEV; + ++ if (tr && trace_array_get(tr) < 0) ++ return -ENODEV; ++ + iter = kzalloc(sizeof(*iter), GFP_KERNEL); + if (!iter) +- return -ENOMEM; ++ goto out; + +- if (trace_parser_get_init(&iter->parser, FTRACE_BUFF_MAX)) { +- kfree(iter); +- return -ENOMEM; +- } ++ if (trace_parser_get_init(&iter->parser, FTRACE_BUFF_MAX)) ++ goto out; + + iter->ops = ops; + iter->flags = flag; +@@ -3584,13 +3585,13 @@ ftrace_regex_open(struct ftrace_ops *ops + + if (!iter->hash) { + trace_parser_put(&iter->parser); +- kfree(iter); +- ret = -ENOMEM; + goto out_unlock; + } + } else + iter->hash = hash; + ++ ret = 0; ++ + if (file->f_mode & FMODE_READ) { + iter->pg = ftrace_pages_start; + +@@ -3602,7 +3603,6 @@ ftrace_regex_open(struct ftrace_ops *ops + /* Failed */ + free_ftrace_hash(iter->hash); + trace_parser_put(&iter->parser); +- kfree(iter); + } + } else + file->private_data = iter; +@@ -3610,6 +3610,13 @@ ftrace_regex_open(struct ftrace_ops *ops + out_unlock: + mutex_unlock(&ops->func_hash->regex_lock); + ++ out: ++ if (ret) { ++ kfree(iter); ++ if (tr) ++ trace_array_put(tr); ++ } ++ + return ret; + } + +@@ -5037,6 +5044,8 @@ int ftrace_regex_release(struct inode *i + + mutex_unlock(&iter->ops->func_hash->regex_lock); + free_ftrace_hash(iter->hash); ++ if (iter->tr) ++ trace_array_put(iter->tr); + kfree(iter); + + return 0; diff --git a/queue-5.3/hwmon-fix-hwmon_p_min_alarm-mask.patch b/queue-5.3/hwmon-fix-hwmon_p_min_alarm-mask.patch new file mode 100644 index 00000000000..89a1aea4561 --- /dev/null +++ b/queue-5.3/hwmon-fix-hwmon_p_min_alarm-mask.patch @@ -0,0 +1,37 @@ +From 30945d31e5761436d9eba6b8cff468a5f7c9c266 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nuno=20S=C3=A1?= +Date: Tue, 24 Sep 2019 14:49:43 +0200 +Subject: hwmon: Fix HWMON_P_MIN_ALARM mask +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nuno Sá + +commit 30945d31e5761436d9eba6b8cff468a5f7c9c266 upstream. + +Both HWMON_P_MIN_ALARM and HWMON_P_MAX_ALARM were using +BIT(hwmon_power_max_alarm). + +Fixes: aa7f29b07c870 ("hwmon: Add support for power min, lcrit, min_alarm and lcrit_alarm") +CC: +Signed-off-by: Nuno Sá +Link: https://lore.kernel.org/r/20190924124945.491326-2-nuno.sa@analog.com +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/hwmon.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/hwmon.h ++++ b/include/linux/hwmon.h +@@ -235,7 +235,7 @@ enum hwmon_power_attributes { + #define HWMON_P_LABEL BIT(hwmon_power_label) + #define HWMON_P_ALARM BIT(hwmon_power_alarm) + #define HWMON_P_CAP_ALARM BIT(hwmon_power_cap_alarm) +-#define HWMON_P_MIN_ALARM BIT(hwmon_power_max_alarm) ++#define HWMON_P_MIN_ALARM BIT(hwmon_power_min_alarm) + #define HWMON_P_MAX_ALARM BIT(hwmon_power_max_alarm) + #define HWMON_P_LCRIT_ALARM BIT(hwmon_power_lcrit_alarm) + #define HWMON_P_CRIT_ALARM BIT(hwmon_power_crit_alarm) diff --git a/queue-5.3/media-stkwebcam-fix-runtime-pm-after-driver-unbind.patch b/queue-5.3/media-stkwebcam-fix-runtime-pm-after-driver-unbind.patch new file mode 100644 index 00000000000..76d08424f21 --- /dev/null +++ b/queue-5.3/media-stkwebcam-fix-runtime-pm-after-driver-unbind.patch @@ -0,0 +1,43 @@ +From 30045f2174aab7fb4db7a9cf902d0aa6c75856a7 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Tue, 1 Oct 2019 10:49:08 +0200 +Subject: media: stkwebcam: fix runtime PM after driver unbind + +From: Johan Hovold + +commit 30045f2174aab7fb4db7a9cf902d0aa6c75856a7 upstream. + +Since commit c2b71462d294 ("USB: core: Fix bug caused by duplicate +interface PM usage counter") USB drivers must always balance their +runtime PM gets and puts, including when the driver has already been +unbound from the interface. + +Leaving the interface with a positive PM usage counter would prevent a +later bound driver from suspending the device. + +Note that runtime PM has never actually been enabled for this driver +since the support_autosuspend flag in its usb_driver struct is not set. + +Fixes: c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") +Cc: stable +Acked-by: Mauro Carvalho Chehab +Signed-off-by: Johan Hovold +Link: https://lore.kernel.org/r/20191001084908.2003-5-johan@kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/usb/stkwebcam/stk-webcam.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/media/usb/stkwebcam/stk-webcam.c ++++ b/drivers/media/usb/stkwebcam/stk-webcam.c +@@ -643,8 +643,7 @@ static int v4l_stk_release(struct file * + dev->owner = NULL; + } + +- if (is_present(dev)) +- usb_autopm_put_interface(dev->interface); ++ usb_autopm_put_interface(dev->interface); + mutex_unlock(&dev->lock); + return v4l2_fh_release(fp); + } diff --git a/queue-5.3/mtd-rawnand-au1550nd-fix-au_read_buf16-prototype.patch b/queue-5.3/mtd-rawnand-au1550nd-fix-au_read_buf16-prototype.patch new file mode 100644 index 00000000000..e33bdd5c98b --- /dev/null +++ b/queue-5.3/mtd-rawnand-au1550nd-fix-au_read_buf16-prototype.patch @@ -0,0 +1,61 @@ +From df8fed831cbcdce7b283b2d9c1aadadcf8940d05 Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Fri, 4 Oct 2019 18:41:30 +0000 +Subject: mtd: rawnand: au1550nd: Fix au_read_buf16() prototype + +From: Paul Burton + +commit df8fed831cbcdce7b283b2d9c1aadadcf8940d05 upstream. + +Commit 7e534323c416 ("mtd: rawnand: Pass a nand_chip object to +chip->read_xxx() hooks") modified the prototype of the struct nand_chip +read_buf function pointer. In the au1550nd driver we have 2 +implementations of read_buf. The previously mentioned commit modified +the au_read_buf() implementation to match the function pointer, but not +au_read_buf16(). This results in a compiler warning for MIPS +db1xxx_defconfig builds: + + drivers/mtd/nand/raw/au1550nd.c:443:57: + warning: pointer type mismatch in conditional expression + +Fix this by updating the prototype of au_read_buf16() to take a struct +nand_chip pointer as its first argument, as is expected after commit +7e534323c416 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() +hooks"). + +Note that this shouldn't have caused any functional issues at runtime, +since the offset of the struct mtd_info within struct nand_chip is 0 +making mtd_to_nand() effectively a type-cast. + +Signed-off-by: Paul Burton +Fixes: 7e534323c416 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks") +Cc: stable@vger.kernel.org # v4.20+ +Reviewed-by: Boris Brezillon +Signed-off-by: Miquel Raynal +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/nand/raw/au1550nd.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/nand/raw/au1550nd.c ++++ b/drivers/mtd/nand/raw/au1550nd.c +@@ -134,16 +134,15 @@ static void au_write_buf16(struct nand_c + + /** + * au_read_buf16 - read chip data into buffer +- * @mtd: MTD device structure ++ * @this: NAND chip object + * @buf: buffer to store date + * @len: number of bytes to read + * + * read function for 16bit buswidth + */ +-static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) ++static void au_read_buf16(struct nand_chip *this, u_char *buf, int len) + { + int i; +- struct nand_chip *this = mtd_to_nand(mtd); + u16 *p = (u16 *) buf; + len >>= 1; + diff --git a/queue-5.3/series b/queue-5.3/series index 793b0e72613..c1af39e2acb 100644 --- a/queue-5.3/series +++ b/queue-5.3/series @@ -94,3 +94,17 @@ rdma-vmw_pvrdma-free-srq-only-once.patch acpi-pptt-add-support-for-acpi-6.3-thread-flag.patch arm64-topology-use-pptt-to-determine-if-pe-is-a-thre.patch iio-light-fix-vcnl4000-devicetree-hooks.patch +fix-the-locking-in-dcache_readdir-and-friends.patch +drm-i915-bump-skl-max-plane-width-to-5k-for-linear-x-tiled.patch +drm-i915-whitelist-common_slice_chicken2.patch +drm-i915-mark-contents-as-dirty-on-a-write-fault.patch +drm-msm-use-the-correct-dma_sync-calls-harder.patch +media-stkwebcam-fix-runtime-pm-after-driver-unbind.patch +arm64-sve-fix-wrong-free-for-task-thread.sve_state.patch +tracing-hwlat-report-total-time-spent-in-all-nmis-during-the-sample.patch +tracing-hwlat-don-t-ignore-outer-loop-duration-when-calculating-max_latency.patch +ftrace-get-a-reference-counter-for-the-trace_array-on-filter-files.patch +tracing-get-trace_array-reference-for-available_tracers-files.patch +hwmon-fix-hwmon_p_min_alarm-mask.patch +mtd-rawnand-au1550nd-fix-au_read_buf16-prototype.patch +x86-asm-fix-mwaitx-c-state-hint-value.patch diff --git a/queue-5.3/tracing-get-trace_array-reference-for-available_tracers-files.patch b/queue-5.3/tracing-get-trace_array-reference-for-available_tracers-files.patch new file mode 100644 index 00000000000..08b6a812e88 --- /dev/null +++ b/queue-5.3/tracing-get-trace_array-reference-for-available_tracers-files.patch @@ -0,0 +1,67 @@ +From 194c2c74f5532e62c218adeb8e2b683119503907 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Fri, 11 Oct 2019 18:19:17 -0400 +Subject: tracing: Get trace_array reference for available_tracers files + +From: Steven Rostedt (VMware) + +commit 194c2c74f5532e62c218adeb8e2b683119503907 upstream. + +As instances may have different tracers available, we need to look at the +trace_array descriptor that shows the list of the available tracers for the +instance. But there's a race between opening the file and an admin +deleting the instance. The trace_array_get() needs to be called before +accessing the trace_array. + +Cc: stable@vger.kernel.org +Fixes: 607e2ea167e56 ("tracing: Set up infrastructure to allow tracers for instances") +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/trace.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -4355,9 +4355,14 @@ static int show_traces_open(struct inode + if (tracing_disabled) + return -ENODEV; + ++ if (trace_array_get(tr) < 0) ++ return -ENODEV; ++ + ret = seq_open(file, &show_traces_seq_ops); +- if (ret) ++ if (ret) { ++ trace_array_put(tr); + return ret; ++ } + + m = file->private_data; + m->private = tr; +@@ -4365,6 +4370,14 @@ static int show_traces_open(struct inode + return 0; + } + ++static int show_traces_release(struct inode *inode, struct file *file) ++{ ++ struct trace_array *tr = inode->i_private; ++ ++ trace_array_put(tr); ++ return seq_release(inode, file); ++} ++ + static ssize_t + tracing_write_stub(struct file *filp, const char __user *ubuf, + size_t count, loff_t *ppos) +@@ -4395,8 +4408,8 @@ static const struct file_operations trac + static const struct file_operations show_traces_fops = { + .open = show_traces_open, + .read = seq_read, +- .release = seq_release, + .llseek = seq_lseek, ++ .release = show_traces_release, + }; + + static ssize_t diff --git a/queue-5.3/tracing-hwlat-don-t-ignore-outer-loop-duration-when-calculating-max_latency.patch b/queue-5.3/tracing-hwlat-don-t-ignore-outer-loop-duration-when-calculating-max_latency.patch new file mode 100644 index 00000000000..ce754723801 --- /dev/null +++ b/queue-5.3/tracing-hwlat-don-t-ignore-outer-loop-duration-when-calculating-max_latency.patch @@ -0,0 +1,37 @@ +From fc64e4ad80d4b72efce116f87b3174f0b7196f8e Mon Sep 17 00:00:00 2001 +From: "Srivatsa S. Bhat (VMware)" +Date: Thu, 10 Oct 2019 11:51:01 -0700 +Subject: tracing/hwlat: Don't ignore outer-loop duration when calculating max_latency + +From: Srivatsa S. Bhat (VMware) + +commit fc64e4ad80d4b72efce116f87b3174f0b7196f8e upstream. + +max_latency is intended to record the maximum ever observed hardware +latency, which may occur in either part of the loop (inner/outer). So +we need to also consider the outer-loop sample when updating +max_latency. + +Link: http://lkml.kernel.org/r/157073345463.17189.18124025522664682811.stgit@srivatsa-ubuntu + +Fixes: e7c15cd8a113 ("tracing: Added hardware latency tracer") +Cc: stable@vger.kernel.org +Signed-off-by: Srivatsa S. Bhat (VMware) +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/trace_hwlat.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/kernel/trace/trace_hwlat.c ++++ b/kernel/trace/trace_hwlat.c +@@ -256,6 +256,8 @@ static int get_sample(void) + /* Keep a running maximum ever recorded hardware latency */ + if (sample > tr->max_latency) + tr->max_latency = sample; ++ if (outer_sample > tr->max_latency) ++ tr->max_latency = outer_sample; + } + + out: diff --git a/queue-5.3/tracing-hwlat-report-total-time-spent-in-all-nmis-during-the-sample.patch b/queue-5.3/tracing-hwlat-report-total-time-spent-in-all-nmis-during-the-sample.patch new file mode 100644 index 00000000000..eec5ceda83c --- /dev/null +++ b/queue-5.3/tracing-hwlat-report-total-time-spent-in-all-nmis-during-the-sample.patch @@ -0,0 +1,38 @@ +From 98dc19c11470ee6048aba723d77079ad2cda8a52 Mon Sep 17 00:00:00 2001 +From: "Srivatsa S. Bhat (VMware)" +Date: Thu, 10 Oct 2019 11:50:46 -0700 +Subject: tracing/hwlat: Report total time spent in all NMIs during the sample + +From: Srivatsa S. Bhat (VMware) + +commit 98dc19c11470ee6048aba723d77079ad2cda8a52 upstream. + +nmi_total_ts is supposed to record the total time spent in *all* NMIs +that occur on the given CPU during the (active portion of the) +sampling window. However, the code seems to be overwriting this +variable for each NMI, thereby only recording the time spent in the +most recent NMI. Fix it by accumulating the duration instead. + +Link: http://lkml.kernel.org/r/157073343544.17189.13911783866738671133.stgit@srivatsa-ubuntu + +Fixes: 7b2c86250122 ("tracing: Add NMI tracing in hwlat detector") +Cc: stable@vger.kernel.org +Signed-off-by: Srivatsa S. Bhat (VMware) +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/trace_hwlat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/trace/trace_hwlat.c ++++ b/kernel/trace/trace_hwlat.c +@@ -150,7 +150,7 @@ void trace_hwlat_callback(bool enter) + if (enter) + nmi_ts_start = time_get(); + else +- nmi_total_ts = time_get() - nmi_ts_start; ++ nmi_total_ts += time_get() - nmi_ts_start; + } + + if (enter) diff --git a/queue-5.3/x86-asm-fix-mwaitx-c-state-hint-value.patch b/queue-5.3/x86-asm-fix-mwaitx-c-state-hint-value.patch new file mode 100644 index 00000000000..cdbb8893a6f --- /dev/null +++ b/queue-5.3/x86-asm-fix-mwaitx-c-state-hint-value.patch @@ -0,0 +1,64 @@ +From 454de1e7d970d6bc567686052329e4814842867c Mon Sep 17 00:00:00 2001 +From: Janakarajan Natarajan +Date: Mon, 7 Oct 2019 19:00:22 +0000 +Subject: x86/asm: Fix MWAITX C-state hint value + +From: Janakarajan Natarajan + +commit 454de1e7d970d6bc567686052329e4814842867c upstream. + +As per "AMD64 Architecture Programmer's Manual Volume 3: General-Purpose +and System Instructions", MWAITX EAX[7:4]+1 specifies the optional hint +of the optimized C-state. For C0 state, EAX[7:4] should be set to 0xf. + +Currently, a value of 0xf is set for EAX[3:0] instead of EAX[7:4]. Fix +this by changing MWAITX_DISABLE_CSTATES from 0xf to 0xf0. + +This hasn't had any implications so far because setting reserved bits in +EAX is simply ignored by the CPU. + + [ bp: Fixup comment in delay_mwaitx() and massage. ] + +Signed-off-by: Janakarajan Natarajan +Signed-off-by: Borislav Petkov +Cc: Frederic Weisbecker +Cc: Greg Kroah-Hartman +Cc: "H. Peter Anvin" +Cc: Ingo Molnar +Cc: Thomas Gleixner +Cc: "x86@kernel.org" +Cc: Zhenzhong Duan +Cc: +Link: https://lkml.kernel.org/r/20191007190011.4859-1-Janakarajan.Natarajan@amd.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/mwait.h | 2 +- + arch/x86/lib/delay.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/x86/include/asm/mwait.h ++++ b/arch/x86/include/asm/mwait.h +@@ -21,7 +21,7 @@ + #define MWAIT_ECX_INTERRUPT_BREAK 0x1 + #define MWAITX_ECX_TIMER_ENABLE BIT(1) + #define MWAITX_MAX_LOOPS ((u32)-1) +-#define MWAITX_DISABLE_CSTATES 0xf ++#define MWAITX_DISABLE_CSTATES 0xf0 + + static inline void __monitor(const void *eax, unsigned long ecx, + unsigned long edx) +--- a/arch/x86/lib/delay.c ++++ b/arch/x86/lib/delay.c +@@ -113,8 +113,8 @@ static void delay_mwaitx(unsigned long _ + __monitorx(raw_cpu_ptr(&cpu_tss_rw), 0, 0); + + /* +- * AMD, like Intel, supports the EAX hint and EAX=0xf +- * means, do not enter any deep C-state and we use it ++ * AMD, like Intel's MWAIT version, supports the EAX hint and ++ * EAX=0xf0 means, do not enter any deep C-state and we use it + * here in delay() to minimize wakeup latency. + */ + __mwaitx(MWAITX_DISABLE_CSTATES, delay, MWAITX_ECX_TIMER_ENABLE);