Commit Graph

873808 Commits

Author SHA1 Message Date
Xiongfeng Wang 1656fd96c3 kprobes/arm64: Blacklist sdei watchdog callback functions
commit bdda54cc39843589ee91a0176ca9a94adf307763 openeuler.

Functions called in sdei_handler are not allowed to be kprobed, so
marked them as NOKPROBE_SYMBOL. There are so many functions in
'watchdog_check_timestamp()'. Luckily, we don't need
'CONFIG_HARDLOCKUP_CHECK_TIMESTAMP' now. So just make
CONFIG_SDEI_WATCHDOG depends on !CONFIG_HARDLOCKUP_CHECK_TIMESTAMP
in case someone add 'CONFIG_HARDLOCKUP_CHECK_TIMESTAMP' in the future.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:53 +08:00
Xiongfeng Wang 4108f89bf6 sdei_watchdog: set secure timer period base on 'watchdog_thresh'
commit 13ddc12768ca98d36ec03bfa21a30b3ebc91673d openeuler.

The period of the secure timer is set to 3s by BIOS. That means the
secure timer interrupt will trigger every 3 seconds. To further decrease
the NMI watchdog's effect on performance, this patch set the period of
the secure timer base on 'watchdog_thresh'. This variable is initiallized
to 10s. We can also set the period at runtime by modifying
'/proc/sys/kernel/watchdog_thresh'

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:53 +08:00
Xiongfeng Wang 3d3ce61def sdei_watchdog: clear EOI of the secure timer before kdump
commit 75ac7be96da43f12bad247de69137500e02fd37f openeuler.

When we panic in hardlockup, the secure timer interrupt remains activate
because firmware clear eoi after dispatch is completed. This will cause
arm_arch_timer interrupt failed to trigger in the second kernel.

This patch add a new SMC helper to clear eoi of a certain interrupt and
clear eoi of the secure timer before booting the second kernel.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:53 +08:00
Xiongfeng Wang fb960c0410 sdei_watchdog: refresh 'last_timestamp' when enabling nmi_watchdog
commit 5bc048a102ef9c3748464cacce443a0f1d9bed5b openeuler.

The trigger period of secure time is set by firmware. We need to check
the time_stamp every time the secure time fires to make sure the
hardlockup detection is not executed too soon. We need to refresh
'last_timestamp' to the current time when we enable the nmi_watchdog.
Otherwise, false hardlockup may be detected when the secure timer fires
the first time.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:53 +08:00
Xiongfeng Wang f0bfc2e73d watchdog: add nmi_watchdog support for arm64 based on SDEI
commit cc19c0b385e3bd423e20465b06eb232678ce5c16 openeuler.

Add nmi_watchdog support for arm64 based on SDEI.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:53 +08:00
Xiongfeng Wang 545b1214b3 lockup_detector: init lockup detector after all the init_calls
commit bef7d8e1432400f3d78339ac269167e09c15dabd openeuler.

We call 'sdei_init' as 'subsys_initcall_sync'. lockup detector need to
be initialised after sdei_init. The influence of this patch is that we
can not detect the hard lockup in init_calls.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:53 +08:00
Xiongfeng Wang 00082d7172 firmware: arm_sdei: make 'sdei_api_event_disable/enable' public
commit cfaccce945988392d70ad42924e76f330c25ab9a openeuler.

NMI Watchdog need to enable the event for each core individually. But the
existing public api 'sdei_event_enable' enable events for all cores when
the event type is private.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:52 +08:00
Xiongfeng Wang aced53f8a1 firmware: arm_sdei: add interrupt binding api
commit 860744b94a10a159562fc491fd7f3ea1388965c1 openeuler.

This patch add a interrupt binding api function which returns the binded
event number.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:57:52 +08:00
Xiongfeng Wang 54661581fb watchdog: make hardlockup detect code public
commit 4ffed7d5435d12be6762e6fdef92fd2c67fc27df openeuler.

In current code, the hardlockup detect code is contained by
CONFIG_HARDLOCKUP_DETECTOR_PERF. This patch makes this code public so
that other arch hardlockup detector can use it.

Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 18:55:17 +08:00
chinaljp030 879316c425
!257 Backport jbd2 speed up for OpenCloudOS-Kernel
Merge pull request !257 from lcy/devel-38
2024-11-05 09:40:52 +00:00
Julien Thierry 0bdcc78fd5 arm_pmu: arm64: Use NMIs for PMU
commit d8f6267f7c upstream.

Add required PMU interrupt operations for NMIs. Request interrupt lines as
NMIs when possible, otherwise fall back to normal interrupts.

NMIs are only supported on the arm64 architecture with a GICv3 irqchip.

[Alexandru E.: Added that NMIs only work on arm64 + GICv3, print message
	when PMU is using NMIs]

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Tested-by: Sumit Garg <sumit.garg@linaro.org> (Developerbox)
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20200924110706.254996-8-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 17:04:08 +08:00
Julien Thierry c6c3369a68 arm_pmu: Introduce pmu_irq_ops
commit f76b130bdb upstream.

Currently the PMU interrupt can either be a normal irq or a percpu irq.
Supporting NMI will introduce two cases for each existing one. It becomes
a mess of 'if's when managing the interrupt.

Define sets of callbacks for operations commonly done on the interrupt. The
appropriate set of callbacks is selected at interrupt request time and
simplifies interrupt enabling/disabling and freeing.

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Tested-by: Sumit Garg <sumit.garg@linaro.org> (Developerbox)
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20200924110706.254996-7-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 17:04:08 +08:00
Julien Thierry e2cabc0720 KVM: arm64: pmu: Make overflow handler NMI safe
commit 95e92e45a4 upstream.

kvm_vcpu_kick() is not NMI safe. When the overflow handler is called from
NMI context, defer waking the vcpu to an irq_work queue.

A vcpu can be freed while it's not running by kvm_destroy_vm(). Prevent
running the irq_work for a non-existent vcpu by calling irq_work_sync() on
the PMU destroy path.

[Alexandru E.: Added irq_work_sync()]

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Tested-by: Sumit Garg <sumit.garg@linaro.org> (Developerbox)
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Suzuki K Pouloze <suzuki.poulose@arm.com>
Cc: kvm@vger.kernel.org
Cc: kvmarm@lists.cs.columbia.edu
Link: https://lore.kernel.org/r/20200924110706.254996-6-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 17:04:08 +08:00
Julien Thierry db279eaccd arm64: perf: Defer irq_work to IPI_IRQ_WORK
commit 05ab728133 upstream.

When handling events, armv8pmu_handle_irq() calls perf_event_overflow(),
and subsequently calls irq_work_run() to handle any work queued by
perf_event_overflow(). As perf_event_overflow() raises IPI_IRQ_WORK when
queuing the work, this isn't strictly necessary and the work could be
handled as part of the IPI_IRQ_WORK handler.

In the common case the IPI handler will run immediately after the PMU IRQ
handler, and where the PE is heavily loaded with interrupts other handlers
may run first, widening the window where some counters are disabled.

In practice this window is unlikely to be a significant issue, and removing
the call to irq_work_run() would make the PMU IRQ handler NMI safe in
addition to making it simpler, so let's do that.

[Alexandru E.: Reworded commit message]

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20200924110706.254996-5-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 17:04:07 +08:00
Julien Thierry 00baa292fc arm64: perf: Remove PMU locking
commit 2a0e2a02e4 upstream.

The PMU is disabled and enabled, and the counters are programmed from
contexts where interrupts or preemption is disabled.

The functions to toggle the PMU and to program the PMU counters access the
registers directly and don't access data modified by the interrupt handler.
That, and the fact that they're always called from non-preemptible
contexts, means that we don't need to disable interrupts or use a spinlock.

[Alexandru E.: Explained why locking is not needed, removed WARN_ONs]

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Tested-by: Sumit Garg <sumit.garg@linaro.org> (Developerbox)
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20200924110706.254996-4-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 17:04:07 +08:00
Mark Rutland 2e813f7d0a arm64: perf: Avoid PMXEV* indirection
commit 0fdf1bb759 upstream.

Currently we access the counter registers and their respective type
registers indirectly. This requires us to write to PMSELR, issue an ISB,
then access the relevant PMXEV* registers.

This is unfortunate, because:

* Under virtualization, accessing one register requires two traps to
  the hypervisor, even though we could access the register directly with
  a single trap.

* We have to issue an ISB which we could otherwise avoid the cost of.

* When we use NMIs, the NMI handler will have to save/restore the select
  register in case the code it preempted was attempting to access a
  counter or its type register.

We can avoid these issues by directly accessing the relevant registers.
This patch adds helpers to do so.

In armv8pmu_enable_event() we still need the ISB to prevent the PE from
reordering the write to PMINTENSET_EL1 register. If the interrupt is
enabled before we disable the counter and the new event is configured,
we might get an interrupt triggered by the previously programmed event
overflowing, but which we wrongly attribute to the event that we are
enabling. Execute an ISB after we disable the counter.

In the process, remove the comment that refers to the ARMv7 PMU.

[Julien T.: Don't inline read/write functions to avoid big code-size
	increase, remove unused read_pmevtypern function,
	fix counter index issue.]
[Alexandru E.: Removed comment, removed trailing semicolons in macros,
	added ISB]

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Tested-by: Sumit Garg <sumit.garg@linaro.org> (Developerbox)
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20200924110706.254996-3-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 17:04:07 +08:00
Alexandru Elisei 42e446dbad arm64: perf: Add missing ISB in armv8pmu_enable_counter()
commit 490d7b7c08 upstream.

Writes to the PMXEVTYPER_EL0 register are not self-synchronising. In
armv8pmu_enable_event(), the PE can reorder configuring the event type
after we have enabled the counter and the interrupt. This can lead to an
interrupt being asserted because of the previous event type that we were
counting using the same counter, not the one that we've just configured.

The same rationale applies to writes to the PMINTENSET_EL1 register. The PE
can reorder enabling the interrupt at any point in the future after we have
enabled the event.

Prevent both situations from happening by adding an ISB just before we
enable the event counter.

Fixes: 030896885a ("arm64: Performance counters support")
Reported-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Tested-by: Sumit Garg <sumit.garg@linaro.org> (Developerbox)
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20200924110706.254996-2-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 17:00:35 +08:00
Zhang Yi 475e1be393 jbd2: speed up jbd2_transaction_committed()
commit 7c73ddb7589fb8ddb1136b6306dfb72089c81511 upstream.

jbd2_transaction_committed() is used to check whether a transaction with
the given tid has already committed, it holds j_state_lock in read mode
and check the tid of current running transaction and committing
transaction, but holding the j_state_lock is expensive.

We have already stored the sequence number of the most recently
committed transaction in journal t->j_commit_sequence, we could do this
check by comparing it with the given tid instead. If the given tid isn't
smaller than j_commit_sequence, we can ensure that the given transaction
has been committed. That way we could drop the expensive lock and
achieve about 10% ~ 20% performance gains in concurrent DIOs on may
virtual machine with 100G ramdisk.

fio -filename=/mnt/foo -direct=1 -iodepth=10 -rw=$rw -ioengine=libaio \
    -bs=4k -size=10G -numjobs=10 -runtime=60 -overwrite=1 -name=test \
    -group_reporting

Before:
  overwrite       IOPS=88.2k, BW=344MiB/s
  read            IOPS=95.7k, BW=374MiB/s
  rand overwrite  IOPS=98.7k, BW=386MiB/s
  randread        IOPS=102k, BW=397MiB/s

After:
  overwrite       IOPS=105k, BW=410MiB/s
  read            IOPS=112k, BW=436MiB/s
  rand overwrite  IOPS=104k, BW=404MiB/s
  randread        IOPS=111k, BW=432MiB/s

CC: Dave Chinner <david@fromorbit.com>
Suggested-by: Dave Chinner <david@fromorbit.com>
Link: https://lore.kernel.org/linux-ext4/ZjILCPNZRHeazSqV@dread.disaster.area/
Signed-off-by: huwentao <huwentao19@h-partners.com>
2024-11-05 15:37:21 +08:00
LeoLiu-oc b7d24be2e7 x86/mce: Add NMIs setup in machine_check func
\#MC is a NMI-like exception. But do not do any setup that NMIs need.
This will lead to console_owner_lock issue and HPET dead loop issue.

For example, The HPET dead loop issue:
CPU x                               CPU x
----                                ----
read_hpet()
  arch_spin_trylock(&hpet.lock)
  [CPU x got the hpet.lock]         #MCE happened
                                    do_machine_check()
                                      mce_panic()
                                        panic()
                                          kmsg_dump()
                                            pstore_dump()
                                              pstore_record_init()
                                                ktime_get_real_fast_ns()
                                                  read_hpet()
                                                  [dead loops]
This may lead to read_hpet dead loops.

The console_owner_lock issue is similar.

To avoid these issues, add NMIs setup When Handling #MC Exceptions.

Signed-off-by: LeoLiu-oc <leoliu-oc@zhaoxin.com>
2024-11-04 16:42:55 +08:00
谢晓东 1b2905d358 KVM: arm64: Add support for FEAT_TLBIRANGE 2024-10-29 22:16:01 +08:00
chinaljp030 7fbd37f2dd
!236 [linux-5.4/next] Add support of Zhaoxin HDAC and codec
Merge pull request !236 from LeoLiu-oc/linux-5.4-next-13-hdac
2024-10-23 09:29:43 +00:00
Weitao Wang 5ab633d0b5 USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value
OverCurrent condition is not standardized in the UHCI spec.
Zhaoxin UHCI controllers report OverCurrent bit active off.
In order to handle OverCurrent condition correctly, the uhci-hcd
driver needs to be told to expect the active-off behavior.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20230423105952.4526-1-WeitaoWang-oc@zhaoxin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: LeoLiu-oc <leoliu-oc@zhaoxin.com>
2024-10-21 14:27:55 +08:00
LeoLiu-oc 2c24189e6f ALSA: hda: Add support of Zhaoxin NB HDAC codec
zhaoxin inclusion
category: feature

-------------------

Add Zhaoxin NB HDAC codec support.

Signed-off-by: LeoLiu-oc <leoliu-oc@zhaoxin.com>
2024-10-21 14:04:43 +08:00
LeoLiu-oc 2fa2a551f9 ALSA: hda: Add support of Zhaoxin NB HDAC
zhaoxin inclusion
category: feature

-------------------

Add the new PCI ID 0x1d17 0x9141/0x9142/0x9144 Zhaoxin NB HDAC
support. And add some special initialization for Zhaoxin NB HDAC.

Signed-off-by: LeoLiu-oc <leoliu-oc@zhaoxin.com>
2024-10-21 14:02:07 +08:00
leoliu-oc 67bfb6833c ALSA: hda: Add support of Zhaoxin SB HDAC
zhaoxin inclusion
category: feature

-------------------

Add some special initialization for Zhaoxin SB HDAC.

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-10-21 13:50:13 +08:00
chinaljp030 74935aa083
!235 Phytium: Support for Multiple Code Copies
Merge pull request !235 from 5.4-duptext-phytium
2024-10-16 08:08:54 +00:00
wangzhimin e007f5685f duptext: export fault data structure, add mmu notifier when memory unmap and add an offset to heap segment
Signed-off-by: wangzhimin1179@phytium.com.cn
2024-10-08 10:20:31 +08:00
Jianping Liu 23fc10f227 dist,sepc: supprot kernel-debug in core and modules and devel rpm
When CONFIG="generic-release", %{rpm_name} is kernel, when
CONFIG="generic-debug", %{rpm_name} is kernel-debug.

Provides: kernel-debug-core in kernel-debug-core rpm
Provides: kernel-debug-modules in kernel-debug-modules rpm
Provides: kernel-debug-devel in kernel-debug-devel rpm

Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
Reviewed-by: Yongliang Gao <leonylgao@tencent.com>
2024-09-27 11:12:29 +08:00
Jianping Liu 57c24f79d0 dist,Makefile: generic-debug config only build kernel rpm
We intend to archive kernle-debug rpm in yum. Release kernel will
build perf/tools/bpf-tools rpm, to avoid kernle-debug build the same
rpm, disable them.

Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-09-25 19:07:13 +08:00
刘诗 007360a952
!227 [linux-5.4/next] Fix some xHCI issues for Zhaoxin CPUs
Merge pull request !227 from LeoLiu-oc/linux-5.4-next-09-10-11-12-xhci
2024-09-20 08:16:22 +00:00
刘诗 b650f3d75f
!225 [linux-5.4/next] x86: Kconfig: make X86_UMIP to cover Zhaoxin CPUs
Merge pull request !225 from LeoLiu-oc/linux-5.4-next-06-umip-kconfig
2024-09-20 08:13:58 +00:00
刘诗 acbd9812fc
!224 [linux-5.4/next] x86/speculation/swapgs: Exclude Zhaoxin CPUs from SWAPGS vulnerability
Merge pull request !224 from LeoLiu-oc/linux-5.4-next-05-x86-bugs
2024-09-20 08:03:18 +00:00
刘诗 6b0e4a25e5
!223 [linux-5.4-next] Add MCA support for Zhaoxin CPUs
Merge pull request !223 from LeoLiu-oc/linux-5.4-next-04-mce
2024-09-20 08:02:54 +00:00
刘诗 16c28e88fd
!222 [linux-5.4/next] ACPI, x86: Improve Zhaoxin processors support for NONSTOP TSC
Merge pull request !222 from LeoLiu-oc/linux-5.4-next-02-nonstop-tsc
2024-09-20 08:00:49 +00:00
刘诗 2b42d3f326
!221 [linux-5.4/next] Add support for Zhaoxin CPUs
Merge pull request !221 from LeoLiu-oc/linux-5.4-next-01-zhaoxin-support
2024-09-20 08:00:23 +00:00
leoliu-oc 4513f0a9b1 x86/cpu: Add detect extended topology for Zhaoxin CPUs
zhaoxin inclusion
category: feature
version: v3.0.6

-------------------

Detect the extended topology information of Zhaoxin CPUs if available.

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-09-20 14:28:32 +08:00
leoliu-oc a51cde26d6 x86/cpufeatures: Add Zhaoxin feature bits
zhaoxin inclusion
category: feature

-------------------

Add Zhaoxin feature bits on Zhaoxin CPUs.

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-09-20 14:27:09 +08:00
Jianping Liu b2be5c757d README.md: add images about README.md 2024-09-09 19:24:09 +08:00
Jianping Liu 6a8f6c32d9 README.md: update README.md
Update README.md with OC Kernel features introduce.
2024-09-09 19:00:59 +08:00
Jianping Liu e9367f76c5 dist: set with_ofed to 0 in OC8 kernel
OC need not compile mlnx commercial drivers.
2024-08-30 16:28:40 +08:00
leoliu-oc b35f54c488 xhci: Add ZHAOXIN xHCI host U1/U2 feature support
mainline inclusion
from mainline-v6.4-rc5
commit <d5e234ff08a45a7a08a52173ed793b3c125ab88d>

-------------------

Add U1/U2 feature support of xHCI for ZHAOXIN.
Since both INTEL and ZHAOXIN need to check the tier where the device is
located to determine whether to enabled U1/U2, remove the previous INTEL
U1/U2 tier policy and add common policy in xhci_check_tier_policy.
If vendor has specific U1/U2 enable policy,quirks can be add to declare.

Suggested-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-12-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-28 17:46:01 +08:00
leoliu-oc e62d48d0a1 xhci: Show ZHAOXIN xHCI root hub speed correctly
mainline inclusion
from mainline-v6.4-rc5
commit <d9b0328d0b8b8298dfdc97cd8e0e2371d4bcc97b>

-------------------

Some ZHAOXIN xHCI controllers follow usb3.1 spec, but only support
gen1 speed 5Gbps. While in Linux kernel, if xHCI suspport usb3.1,
root hub speed will show on 10Gbps.
To fix this issue of ZHAOXIN xHCI platforms, read usb speed ID
supported by xHCI to determine root hub speed. And add a quirk
XHCI_ZHAOXIN_HOST for this issue.

[fix warning about uninitialized symbol -Mathias]

Suggested-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-11-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-28 17:41:56 +08:00
leoliu-oc ac01ca6191 xhci: Fix TRB prefetch issue of ZHAOXIN hosts
mainline inclusion
from mainline-v6.4-rc5
commit <2a865a652299f5666f3b785cbe758c5f57453036>

-------------------

On some ZHAOXIN hosts, xHCI will prefetch TRB for performance
improvement. However this TRB prefetch mechanism may cross page boundary,
which may access memory not allocated by xHCI driver. In order to fix
this issue, two pages was allocated for a segment and only the first
page will be used. And add a quirk XHCI_ZHAOXIN_TRB_FETCH for this issue.

Cc: stable@vger.kernel.org
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-10-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-28 17:39:45 +08:00
leoliu-oc 13c6608619 xhci: Fix resume issue of some ZHAOXIN hosts
mainline inclusion
from mainline-v6.4-rc5
commit <f927728186f0de1167262d6a632f9f7e96433d1a>

-------------------

On ZHAOXIN ZX-100 project, xHCI can't work normally after resume
from system Sx state. To fix this issue, when resume from system
Sx state, reinitialize xHCI instead of restore.
So, Add XHCI_RESET_ON_RESUME quirk for ZX-100 to fix issue of
resuming from system Sx state.

Cc: stable@vger.kernel.org
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-9-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-28 17:34:23 +08:00
leoliu-oc c7164d37b8 x86/Kconfig: Drop vendor dependency for X86_UMIP
mainline inclusion
from mainline-v5.6-rc2
commit <bdb04a1abbf92c998f1afb5f00a037f2edaec1f7>

-------------------

Some Centaur family 7 CPUs and Zhaoxin family 7 CPUs support the UMIP
feature too. The text size growth which UMIP adds is ~1K and distro
kernels enable it anyway so remove the vendor dependency.

 [ bp: Rewrite commit message. ]

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/1583733990-2587-1-git-send-email-TonyWWang-oc@zhaoxin.com

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-28 17:02:13 +08:00
leoliu-oc a2d613deb6 x86/Kconfig: Rename UMIP config parameter
mainline inclusion
from mainline-v5.4-rc1
commit <b971880fe79f4042aaaf426744a5b19521bf77b3>

-------------------

AMD 2nd generation EPYC processors support the UMIP (User-Mode
Instruction Prevention) feature. So, rename X86_INTEL_UMIP to
generic X86_UMIP and modify the text to cover both Intel and AMD.

 [ bp: take of the disabled-features.h copy in tools/ too. ]

Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "x86@kernel.org" <x86@kernel.org>
Link: https://lkml.kernel.org/r/157298912544.17462.2018334793891409521.stgit@naples-babu.amd.com

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-28 16:46:35 +08:00
Huang Cun e5646556fd
!218 [next-5.4]scsi: hisi_sas: Modify the deadline for ata_wait_after_reset()
Merge pull request !218 from chenyi/linux-5.4/cy
2024-08-28 02:25:38 +00:00
leoliu-oc 236e1d8d58 x86/speculation/swapgs: Exclude Zhaoxin CPUs from SWAPGS vulnerability
mainline inclusion
from mainline-v5.5-rc6
commit <a84de2fa962c1b0551653fe245d6cb5f6129179c>

-------------------

New Zhaoxin family 7 CPUs are not affected by the SWAPGS vulnerability. So
mark these CPUs in the cpu vulnerability whitelist accordingly.

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/1579227872-26972-3-git-send-email-TonyWWang-oc@zhaoxin.com

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-26 18:00:33 +08:00
leoliu-oc 92eeccad98 x86/mce: Add Centaur MCA support
zhaoxin inclusion
category: feature

-------------------

Add MCA support for some Zhaoxin CPUs which use X86_VENDOR_CENTAUR
as vendor ID.

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-26 17:51:29 +08:00
leoliu-oc 606c99c0a8 x86/mce: Add Zhaoxin LMCE support
mainline inclusion
from mainline-v5.4-rc1
commit <70f0c230031dfef3c9b3e37b2a8c18d3f7186fb2>
category: feature

-------------------

Newer Zhaoxin CPUs support LMCE compatible with Intel. Add support for
that.

 [ bp: Export functions and massage. ]

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: CooperYan@zhaoxin.com
Cc: DavidWang@zhaoxin.com
Cc: HerryYang@zhaoxin.com
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Cc: QiyuanWang@zhaoxin.com
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/1568787573-1297-5-git-send-email-TonyWWang-oc@zhaoxin.com

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
2024-08-26 17:44:59 +08:00