- 25 11月, 2022 13 次提交
-
-
由 Leo Yan 提交于
mainline inclusion from mainline-v5.13-rc1 commit 2f01c200 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2f01c200d4405c4562e45e8bb4de44a5ce37b217 -------------------------------------------------------------------------- The callback cs_etm_find_snapshot() is invoked for snapshot mode, its main purpose is to find the correct AUX trace data and returns "head" and "old" (we can call "old" as "old head") to the caller, the caller __auxtrace_mmap__read() uses these two pointers to decide the AUX trace data size. This patch removes cs_etm_find_snapshot() with below reasons: - The first thing in cs_etm_find_snapshot() is to check if the head has wrapped around, if it is not, directly bails out. The checking is pointless, this is because the "head" and "old" pointers both are monotonical increasing so they never wrap around. - cs_etm_find_snapshot() adjusts the "head" and "old" pointers and assumes the AUX ring buffer is fully filled with the hardware trace data, so it always subtracts the difference "mm->len" from "head" to get "old". Let's imagine the snapshot is taken in very short interval, the tracers only fill a small chunk of the trace data into the AUX ring buffer, in this case, it's wrongly to copy the whole the AUX ring buffer to perf file. - As the "head" and "old" pointers are monotonically increased, the function __auxtrace_mmap__read() handles these two pointers properly. It calculates the reminders for these two pointers, and the size is clamped to be never more than "snapshot_size". We can simply reply on the function __auxtrace_mmap__read() to calculate the correct result for data copying, it's not necessary to add Arm CoreSight specific callback. Signed-off-by: NLeo Yan <leo.yan@linaro.org> Reviewed-by: NJames Clark <james.clark@arm.com> Tested-by: NJames Clark <james.clark@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Daniel Kiss <daniel.kiss@arm.com> Cc: Denis Nikitin <denik@google.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: http://lore.kernel.org/lkml/20210701093537.90759-3-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 James Clark 提交于
mainline inclusion from mainline-v5.13-rc1 commit c1a6165a category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c1a6165a639c2d85f06be7dd9c29ce1cfd994775 -------------------------------------------------------------------------- When a zero timestamp is encountered, warn once. This is to make hardware or configuration issues visible. Also suggest that the issue can be worked around with the --itrace=Z option. When an underflow with a non-zero timestamp occurs, warn every time. This is an unexpected scenario, and with increasing timestamps, it's unlikely that it would occur more than once, therefore it should be ok to warn every time. Only try to calculate the timestamp by subtracting the instruction count if neither of the above cases are true. This makes attempting to decode files with zero timestamps in non-timeless mode more consistent. Currently it can half work if the timestamp wraps around and becomes non-zero, although the behavior is undefined and unpredictable. Signed-off-by: NJames Clark <james.clark@arm.com> Reviewed-by: NLeo Yan <leo.yan@linaro.org> Cc: Al Grant <al.grant@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Branislav Rankov <branislav.rankov@arm.com> Cc: Denis Nikitin <denik@chromium.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Will Deacon <will@kernel.org> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210517131741.3027-4-james.clark@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 James Clark 提交于
mainline inclusion from mainline-v5.13-rc1 commit c36c1ef6 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c36c1ef6f6912114c7fb0aa8f7c0af2634704de7 -------------------------------------------------------------------------- Recently the 'Z' --itrace option was added to override detection of timeless decoding. This is also useful in Coresight to work around issues with invalid timestamps on some hardware. When the 'Z' option is provided, the existing timeless decoding mode will be used, even if timestamps were recorded. Signed-off-by: NJames Clark <james.clark@arm.com> Reviewed-by: NLeo Yan <leo.yan@linaro.org> Cc: Al Grant <al.grant@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Branislav Rankov <branislav.rankov@arm.com> Cc: Denis Nikitin <denik@chromium.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Will Deacon <will@kernel.org> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210517131741.3027-3-james.clark@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 James Clark 提交于
mainline inclusion from mainline-v5.13-rc1 commit cac31418 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cac314186718f16f494b892de4dc67215ee05ef7 -------------------------------------------------------------------------- Move initialisation of synth_opts earlier in the function so that synth_opts can be used at an earlier stage in a later commit. Signed-off-by: NJames Clark <james.clark@arm.com> Reviewed-by: NLeo Yan <leo.yan@linaro.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Al Grant <al.grant@arm.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Branislav Rankov <branislav.rankov@arm.com> Cc: Denis Nikitin <denik@chromium.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Will Deacon <will@kernel.org> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20210517131741.3027-2-james.clark@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 Adrian Hunter 提交于
mainline inclusion from mainline-v5.13-rc1 commit 18f49494 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=18f4949427dc80bd9027001d28118cd8d555d890 -------------------------------------------------------------------------- Issues correlating timestamps can be avoided with timeless decoding. Add an option for that, so that timeless decoding can be used even when timestamps are present. Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com> Reviewed-by: NAndi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: https://lore.kernel.org/r/20210430070309.17624-2-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 James Clark 提交于
mainline inclusion from mainline-v5.13-rc1 commit 1ac9e0b5 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1ac9e0b5731ad732ddc045cfcfd6739e4e12f3b5 -------------------------------------------------------------------------- The following attribute is set when synthesising samples in timed decoding mode: attr.sample_type |= PERF_SAMPLE_TIME; This results in new samples that appear to have timestamps but because we don't assign any timestamps to the samples, when the resulting inject file is opened again, the synthesised samples will be on the wrong side of the MMAP or COMM events. For example, this results in the samples being associated with the perf binary, rather than the target of the record: perf record -e cs_etm/@tmc_etr0/u top perf inject -i perf.data -o perf.inject --itrace=i100il perf report -i perf.inject Where 'Command' == perf should show as 'top': # Overhead Command Source Shared Object Source Symbol Target Symbol Basic Block Cycles # ........ ....... .................... ...................... ...................... .................. # 31.08% perf [unknown] [.] 0x000000000040c3f8 [.] 0x000000000040c3e8 - If the perf.data file is opened directly with perf, without the inject step, then this already works correctly because the events are synthesised after the COMM and MMAP events and no second sorting happens. Re-sorting only happens when opening the perf.inject file for the second time so timestamps are needed. Using the timestamp from the AUX record mirrors the current behaviour when opening directly with perf, because the events are generated on the call to cs_etm__process_queues(). The ETM trace could optionally contain time stamps, but there is no way to correlate this with the kernel time. So, the best available time value is that of the AUX_RECORD header. This patch uses the timestamp from the header for all the samples. The ordering of the samples are implicit in the trace and thus is fine with respect to relative ordering. Reviewed-by: NLeo Yan <leo.yan@linaro.org> Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org> Co-developed-by: NAl Grant <al.grant@arm.com> Signed-off-by: NAl Grant <al.grant@arm.com> Signed-off-by: NJames Clark <james.clark@arm.com> Acked-by: NSuzuki K Poulos <suzuki.poulose@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Branislav Rankov <branislav.rankov@arm.com> Cc: Denis Nikitin <denik@chromium.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20210510143248.27423-3-james.clark@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 James Clark 提交于
mainline inclusion from mainline-v5.13-rc1 commit aadd6ba4 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=aadd6ba409344776fc155451684c728822bf4a24 -------------------------------------------------------------------------- Remove ambiguity in variable names relating to timestamps. A later commit will save the sample kernel timestamp in one of the etm structs, so name all elements appropriately to avoid confusion. This is also removes some ambiguity arising from the fact that the --timestamp argument to perf record refers to sample kernel timestamps, and the /timestamp/ event modifier refers to CS timestamps, so the term is overloaded. Signed-off-by: NJames Clark <james.clark@arm.com> Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Al Grant <al.grant@arm.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Branislav Rankov <branislav.rankov@arm.com> Cc: Denis Nikitin <denik@chromium.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20210510143248.27423-2-james.clark@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 Suzuki K Poulose 提交于
mainline inclusion from mainline-v5.11 commit 8e1488a4 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8e1488a46dcf73b1f1916d95421e303dbf773fb4 -------------------------------------------------------------------------- The PID of the task could be traced as VMID when the kernel is running at EL2. Teach the decoder to look for VMID when the CONTEXTIDR (Arm32) or CONTEXTIDR_EL1 (Arm64) is invalid but we have a valid VMID. Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com> Co-developed-by: NLeo Yan <leo.yan@linaro.org> Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org> Cc: Al Grant <al.grant@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Link: https://lore.kernel.org/r/20210213113220.292229-6-leo.yan@linaro.org Link: https://lore.kernel.org/r/20210224164835.3497311-7-mathieu.poirier@linaro.orgSigned-off-by: NLeo Yan <leo.yan@linaro.org> Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 Leo Yan 提交于
mainline inclusion from mainline-v5.11 commit 47f0d94c category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=47f0d94c203751ddcfdb296fcf15df20fffcef0c -------------------------------------------------------------------------- This patch adds helper function cs_etm__get_pid_fmt(), by passing parameter "traceID", it returns the PID format. Signed-off-by: NLeo Yan <leo.yan@linaro.org> Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: NSuzuki K Poulose <suzuki.poulose@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Link: https://lore.kernel.org/r/20210213113220.292229-5-leo.yan@linaro.org Link: https://lore.kernel.org/r/20210224164835.3497311-6-mathieu.poirier@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 Suzuki K Poulose 提交于
mainline inclusion from mainline-v5.11 commit 30cb76aa category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=30cb76aabfb4deab4ffef54882f86df319b4d862 -------------------------------------------------------------------------- If the kernel is running at EL2, the pid of a task is exposed via VMID instead of the CONTEXTID. Add support for this in the perf tool. This patch respects user setting if user has specified any configs from "contextid", "contextid1" or "contextid2"; otherwise, it dynamically sets config based on PMU format "contextid". Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com> Co-developed-by: NLeo Yan <leo.yan@linaro.org> Signed-off-by: NLeo Yan <leo.yan@linaro.org> Reviewed-by: NMike Leach <mike.leach@linaro.org> Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org> Cc: Al Grant <al.grant@arm.com> Link: https://lore.kernel.org/r/20210213113220.292229-4-leo.yan@linaro.org Link: https://lore.kernel.org/r/20210224164835.3497311-5-mathieu.poirier@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 Suzuki K Poulose 提交于
mainline inclusion from mainline-v5.12 commit 8c559e8d category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8c559e8d68630d64d932bada633705f6551427df -------------------------------------------------------------------------- When set option with macros ETM_OPT_CTXTID and ETM_OPT_TS, it wrongly takes these two values (14 and 28 prespectively) as bit masks, but actually both are the offset for bits. But this doesn't lead to further failure due to the AND logic operation will be always true for ETM_OPT_CTXTID / ETM_OPT_TS. This patch uses the BIT() macro for option bits, thus it can request the correct bitmaps for "contextid" and "timestamp" when calling cs_etm_set_option(). Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com> Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: NMike Leach <mike.leach@linaro.org> Link: https://lore.kernel.org/r/20210213113220.292229-3-leo.yan@linaro.org Link: https://lore.kernel.org/r/20210224164835.3497311-4-mathieu.poirier@linaro.org [Extract the change as a separate patch for easier review] Signed-off-by: NLeo Yan <leo.yan@linaro.org> Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 Mike Leach 提交于
mainline inclusion from mainline-v5.11 commit 42b2b570 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I636PS CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=42b2b570b34afb5fb9dc16ac77cb332194136a85 -------------------------------------------------------------------------- The current fixed metadata version format (version 0), means that adding metadata parameter items renders files from a previous version of perf unreadable. Per CPU parameters appear in a fixed order, but there is no field to indicate the number of ETM parameters per CPU. This patch updates the per CPU parameter blocks to include a NR_PARAMs value which indicates the number of parameters in the block. The header version is incremented to 1. Fixed ordering is retained, new ETM parameters are added to the end of the list. The reader code is updated to be able to read current version 0 files, For version 1, the reader will read the number of parameters in the per CPU block. This allows the reader to process older or newer files that may have different numbers of parameters than in use at the time perf was built. Signed-off-by: NMike Leach <mike.leach@linaro.org> Reviewed-by: NLeo Yan <leo.yan@linaro.org> Tested-by: NLeo Yan <leo.yan@linaro.org> Link: https://lore.kernel.org/r/20210202214040.32349-1-mike.leach@linaro.org Link: https://lore.kernel.org/r/20210224164835.3497311-2-mathieu.poirier@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: NJunhao He <hejunhao3@huawei.com>
-
由 openeuler-ci-bot 提交于
!223 SPR: IDXD driver (on top of OLK-5.10) - DSA/IAA incremental backporting patches until upstream 6.1 Merge Pull Request from: @xiaochenshen **IDXD kernel driver:** IDXD driver is the common driver framework of Intel Data Stream Accelerator (DSA) and Intel In-memory Analytics Accelerator (IAA). This patchset covers the incremental backporting kernel patches until upstream 6.1. It fixes issues: 1. https://gitee.com/openeuler/intel-kernel/issues/I596WO 2. https://gitee.com/openeuler/intel-kernel/issues/I590PB **DSA – Intel Data Streaming Accelerator:** Intel DSA is a high-performance data copy and transformation accelerator that is integrated in Intel Sapphire Rapids (SPR) processors, targeted for optimizing streaming data movement and transformation operations common with applications for high-performance storage, networking, persistent memory, and various data processing applications. See more details in DSA spec: https://software.intel.com/content/www/us/en/develop/articles/intel-data-streaming-accelerator-architecture-specification.html **IAA - Intel In-memory Analytics Accelerator:** Intel In-memory Analytics Accelerator is the integrated accelerator that accelerates analytics primitives (scan, filter, etc.), CRC calculations, compression, decompression, and more on Intel Sapphire Rapids (SPR) processors. See more details in IAA spec: https://cdrdv2.intel.com/v1/dl/getContent/721858 **There are 173 patches in total in this patch set. It covers:** 1. IDXD driver incremental patches between 5.10 LTS and upstream 6.1 (Shared WQ, SVM, IAA, driver refactoring and bug fixes). 2. ENQCMD and PASID re-enabling patches (as dependencies of IDXD driver) 3. Other dependencies in IOMMU driver. 4. kABI fixes for OpenEuler. 5. Enable necessary kernel configs in openeuler_defconfig. **Passed tests:** 1. Unit tests: passed - accel-config test - accel-config/test dsa_user_test_runner.sh - accel-config/test iaa_user_test_runner.sh - Kernel dmatest test (SVA disabled: "modprobe idxd sva=0") - Intel internal DSA config test suite (dsa_config_bat_tests, dsa_config_func_tests) - Intel internal IAX config test suite (iax_config_bat_tests, iax_config_func_tests) 3. Build successfully. 4. Boot test: passed. **Kernel config changes against default:** ``` @@ -6381,7 +6381,11 @@ CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DMA_ACPI=y # CONFIG_ALTERA_MSGDMA is not set CONFIG_INTEL_IDMA64=m +CONFIG_INTEL_IDXD_BUS=m CONFIG_INTEL_IDXD=m +# CONFIG_INTEL_IDXD_COMPAT is not set +CONFIG_INTEL_IDXD_SVM=y +CONFIG_INTEL_IDXD_PERFMON=y CONFIG_INTEL_IOATDMA=m # CONFIG_PLX_DMA is not set # CONFIG_QCOM_HIDMA_MGMT is not set @@ -6632,11 +6636,12 @@ CONFIG_IOMMU_SUPPORT=y # CONFIG_IOMMU_DEBUGFS is not set CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y CONFIG_IOMMU_DMA=y +CONFIG_IOMMU_SVA=y CONFIG_AMD_IOMMU=y CONFIG_AMD_IOMMU_V2=m CONFIG_DMAR_TABLE=y CONFIG_INTEL_IOMMU=y -# CONFIG_INTEL_IOMMU_SVM is not set +CONFIG_INTEL_IOMMU_SVM=y # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set CONFIG_INTEL_IOMMU_FLOPPY_WA=y # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set ``` **Kernel command line to enable intel iommu scalable mode (in grub.cfg):** ``` intel_iommu=on,sm_on ``` Link:https://gitee.com/openeuler/kernel/pulls/223 Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: Chen Wei <chenwei@xfusion.com> Reviewed-by: Liu Chao <liuchao173@huawei.com> Reviewed-by: Jun Tian <jun.j.tian@intel.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
-
- 24 11月, 2022 27 次提交
-
-
由 Xiaochen Shen 提交于
category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: openeuler_defconfig: Enable configs for Intel IDXD driver. -------------------------------------------- Enable necessary kernel configs for Intel IDXD driver in openeuler_defconfig for Intel DSA/IAA features. Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Xiaochen Shen 提交于
category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: sched: Fix kABI for task->pasid_activated. ------------------------------------------------- In commit ("sched: Define and initialize a flag to identify valid PASID in the task"), a new single bit field 'pasid_activated' is added to the middle of 'struct task_struct' that causes kABI breakage. Fix it by using KABI_FILL_HOLE() API for task->pasid_activated. Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Xiaochen Shen 提交于
category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: dmaengine: idxd: Fix kABI for IDXD perfmon cpu hot plug state. ------------------------------------------------- In commit ("dmaengine: idxd: Add IDXD performance monitor support"), the introduction of Intel IDXD performance monitor feature adds new CPU hot plug state 'CPUHP_AP_PERF_X86_IDXD_ONLINE' in the middle of data structure 'enum cpuhp_state' that causes kABI breakage. Fix it by reusing other arch's entry for CPUHP_AP_PERF_X86_IDXD_ONLINE to avoid kABI breakage. Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Thomas Gleixner 提交于
mainline inclusion from mainline-v6.2 commit 444eef7d category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 444eef7d dmaengine: idxd: Remove linux/msi.h include. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Nothing in this file needs anything from linux/msi.h Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Vinod Koul <vkoul@kernel.org> Cc: dmaengine@vger.kernel.org Link: https://lore.kernel.org/r/20221113202428.573536003@linutronix.deSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Fenghua Yu 提交于
mainline inclusion from mainline-v6.2 commit dc901d98 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit dc901d98 dmaengine: idxd: Fix crc_val field for completion record. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The crc_val in the completion record should be 64 bits and not 32 bits. Fixes: 4ac823e9 ("dmaengine: idxd: fix delta_rec and crc size field for completion record") Reported-by: NNirav N Shah <nirav.n.shah@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20221111012715.2031481-1-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Xiaochen Shen 提交于
mainline inclusion from mainline-v6.2 commit 9a8ddb35 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 9a8ddb35 dmaengine: idxd: Make read buffer sysfs attributes invisible for Intel IAA. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- In current code, the following sysfs attributes are exposed to user to show or update the values: max_read_buffers (max_tokens) read_buffer_limit (token_limit) group/read_buffers_allowed (group/tokens_allowed) group/read_buffers_reserved (group/tokens_reserved) group/use_read_buffer_limit (group/use_token_limit) >From Intel IAA spec [1], Intel IAA does not support Read Buffer allocation control. So these sysfs attributes should not be supported on IAA device. Fix this issue by making these sysfs attributes invisible through is_visible() filter when the device is IAA. Add description in the ABI documentation to mention that these attributes are not visible when the device does not support Read Buffer allocation control. [1]: https://cdrdv2.intel.com/v1/dl/getContent/721858 Fixes: fde212e4 ("dmaengine: idxd: deprecate token sysfs attributes for read buffers") Fixes: c52ca478 ("dmaengine: idxd: add configuration component of driver") Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20221022074949.11719-1-xiaochen.shen@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Xiaochen Shen 提交于
mainline inclusion from mainline-v6.2 commit 91123b37 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 91123b37 dmaengine: idxd: Make max batch size attributes in sysfs invisible for Intel IAA. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- In current code, dev.max_batch_size and wq.max_batch_size attributes in sysfs are exposed to user to show or update the values. >From Intel IAA spec [1], Intel IAA does not support batch processing. So these sysfs attributes should not be supported on IAA device. Fix this issue by making the attributes of max_batch_size invisible in sysfs through is_visible() filter when the device is IAA. Add description in the ABI documentation to mention that the attributes are not visible when the device does not support batch. [1]: https://cdrdv2.intel.com/v1/dl/getContent/721858 Fixes: e7184b15 ("dmaengine: idxd: add support for configurable max wq batch size") Fixes: c52ca478 ("dmaengine: idxd: add configuration component of driver") Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220930201528.18621-3-xiaochen.shen@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Fengqian Gao 提交于
mainline inclusion from mainline-v6.1 commit 0b8c97a1 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 0b8c97a1 dmaengine: idxd: fix RO device state error after been disabled/reset. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- When IDXD is not configurable, that means its WQ, engine, and group configurations cannot be changed. But it can be disabled and its state should be set as disabled regardless it's configurable or not. Fix this by setting device state IDXD_DEV_DISABLED for read-only device as well in idxd_device_clear_state(). Fixes: cf4ac3fe ("dmaengine: idxd: fix lockdep warning on device driver removal") Signed-off-by: NFengqian Gao <fengqian.gao@intel.com> Reviewed-by: NXiaochen Shen <xiaochen.shen@intel.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220930032835.2290-1-fengqian.gao@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Xiaochen Shen 提交于
mainline inclusion from mainline-v6.1 commit e8dbd644 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit e8dbd644 dmaengine: idxd: Fix max batch size for Intel IAA. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- >From Intel IAA spec [1], Intel IAA does not support batch processing. Two batch related default values for IAA are incorrect in current code: (1) The max batch size of device is set during device initialization, that indicates batch is supported. It should be always 0 on IAA. (2) The max batch size of work queue is set to WQ_DEFAULT_MAX_BATCH (32) as the default value regardless of Intel DSA or IAA device during work queue setup and cleanup. It should be always 0 on IAA. Fix the issues by setting the max batch size of device and max batch size of work queue to 0 on IAA device, that means batch is not supported. [1]: https://cdrdv2.intel.com/v1/dl/getContent/721858 Fixes: 23084545 ("dmaengine: idxd: set max_xfer and max_batch for RO device") Fixes: 92452a72 ("dmaengine: idxd: set defaults for wq configs") Fixes: bfe1d560 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220930201528.18621-2-xiaochen.shen@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Fenghua Yu 提交于
mainline inclusion from mainline-v6.1 commit 0ec8ce07 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 0ec8ce07 dmaengine: idxd: Do not enable user type Work Queue without Shared Virtual Addressing. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- When the idxd_user_drv driver is bound to a Work Queue (WQ) device without IOMMU or with IOMMU Passthrough without Shared Virtual Addressing (SVA), the application gains direct access to physical memory via the device by programming physical address to a submitted descriptor. This allows direct userspace read and write access to arbitrary physical memory. This is inconsistent with the security goals of a good kernel API. Unlike vfio_pci driver, the IDXD char device driver does not provide any ways to pin user pages and translate the address from user VA to IOVA or PA without IOMMU SVA. Therefore the application has no way to instruct the device to perform DMA function. This makes the char device not usable for normal application usage. Since user type WQ without SVA cannot be used for normal application usage and presents the security issue, bind idxd_user_drv driver and enable user type WQ only when SVA is enabled (i.e. user PASID is enabled). Fixes: 448c3de8 ("dmaengine: idxd: create user driver for wq 'device'") Cc: stable@vger.kernel.org Suggested-by: NArjan Van De Ven <arjan.van.de.ven@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NJerry Snitselaar <jsnitsel@redhat.com> Link: https://lore.kernel.org/r/20221014222541.3912195-1-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v6.1 commit 7ca68fa3 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 7ca68fa3 dmaengine: idxd: add configuration for concurrent batch descriptor processing. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add sysfs knob to allow control of the number of batch descriptors that can be concurrently processed by an engine in the group as a fraction of the Maximum Work Descriptors in Progress value specfied in ENGCAP register. This control knob is part of toggle for QoS control. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Co-developed-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220917161222.2835172-6-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v6.1 commit 1f273752 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 1f273752 dmaengine: idxd: add configuration for concurrent work descriptor processing. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add sysfs knob to allow control of the number of work descriptors that can be concurrently processed by an engine in the group as a fraction of the Maximum Work Descriptors in Progress value specified in ENGCAP register. This control knob is part of toggle for QoS control. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Co-developed-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220917161222.2835172-5-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v6.1 commit b0325aef category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit b0325aef dmaengine: idxd: add WQ operation cap restriction support. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- DSA 2.0 add the capability of configuring DMA ops on a per workqueue basis. This means that certain ops can be disabled by the system administrator for certain wq. By default, all ops are available. A bitmap is used to store the ops due to total op size of 256 bits and it is more convenient to use a range list to specify which bits are enabled. One of the usage to support this is for VM migration between different iteration of devices. The newer ops are disabled in order to allow guest to migrate to a host that only support older ops. Another usage is to restrict the WQ to certain operations for QoS of performance. A sysfs of ops_config attribute is added per wq. It is only usable when the ops_config bit is set under WQ_CAP register. This means that this attribute will return -EOPNOTSUPP on DSA 1.x devices. The expected input is a range list for the bits per operation the WQ supports. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Co-developed-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220917161222.2835172-4-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v6.1 commit a8563a33 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit a8563a33 dmanegine: idxd: reformat opcap output to match bitmap_parse() input. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- To make input and output consistent and prepping for the per WQ operation configuration support, change the output of opcap display to match the input that is expected by bitmap_parse() helper function. The output will be a bitmap with field width as the number of bits using the %*pb format specifier for printk() family. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Co-developed-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220917161222.2835172-3-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v6.1 commit 22bd0df8 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 22bd0df8 dmaengine: idxd: convert ats_dis to a wq flag. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Make wq attributes access consistent. Convert ats_dis to wq flag WQ_FLAG_ATS_DISABLE. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Co-developed-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220917161222.2835172-2-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Yuan Can 提交于
mainline inclusion from mainline-v6.1 commit d1083fd0 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d1083fd0 dmaengine: idxd: Remove unused struct idxd_fault. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Since fault processing code has been removed, struct idxd_fault is not used any more and can be removed as well. Signed-off-by: NYuan Can <yuancan@huawei.com> Link: https://lore.kernel.org/r/20220928014747.106808-1-yuancan@huawei.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Jerry Snitselaar 提交于
mainline inclusion from mainline-v6.1 commit de5819b9 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit de5819b9 dmaengine: idxd: track enabled workqueues in bitmap. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Now that idxd_wq_disable_cleanup() sets the workqueue state to IDXD_WQ_DISABLED, use a bitmap to track which workqueues have been enabled. This will then be used to determine which workqueues should be re-enabled when attempting a software reset to recover from a device halt state. Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Vinod Koul <vkoul@kernel.org> Signed-off-by: NJerry Snitselaar <jsnitsel@redhat.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20220928154856.623545-3-jsnitsel@redhat.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Tariq Toukan 提交于
mainline inclusion from mainline-v5.16 commit 7529cc7f category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 7529cc7f lib: bitmap: Introduce node-aware alloc API. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Expose new node-aware API for bitmap allocation: bitmap_alloc_node() / bitmap_zalloc_node(). Signed-off-by: NTariq Toukan <tariqt@nvidia.com> Reviewed-by: NMoshe Shemesh <moshe@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Jerry Snitselaar 提交于
minline inclusion from mainline-v6.1 commit 8e527aac category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 8e527aac dmaengine: idxd: Set wq state to disabled in idxd_wq_disable_cleanup(). Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- If we are calling idxd_wq_disable_cleanup(), the workqueue should be in a disabled state. So set the workqueue state to IDXD_WQ_DISABLED so that the state reflects that. Currently if there is a device failure, and a software reset is attempted the workqueues will not be re-enabled due to idxd_wq_enable() seeing that state as already being IDXD_WQ_ENABLED. Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Vinod Koul <vkoul@kernel.org> Signed-off-by: NJerry Snitselaar <jsnitsel@redhat.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20220928154856.623545-2-jsnitsel@redhat.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Jerry Snitselaar 提交于
mainline inclusion from mainline-v6.1 commit 40717171 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: 40717171 dmaengine: idxd: avoid deadlock in process_misc_interrupts(). Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- idxd_device_clear_state() now grabs the idxd->dev_lock itself, so don't grab the lock prior to calling it. This was seen in testing after dmar fault occurred on system, resulting in lockup stack traces. Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Vinod Koul <vkoul@kernel.org> Cc: dmaengine@vger.kernel.org Fixes: cf4ac3fe ("dmaengine: idxd: fix lockdep warning on device driver removal") Signed-off-by: NJerry Snitselaar <jsnitsel@redhat.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20220823163709.2102468-1-jsnitsel@redhat.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Fenghua Yu 提交于
mainline inclusion from mainline-v6.0 commit d0b55afa category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d0b55afa dmaengine: idxd: Correct IAX operation code names. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Some IAX operation code nomenclatures are misleading or don't match with others: 1. Operation code 0x4c is Zero Compress 32. IAX_OPCODE_DECOMP_32 is a misleading name. Change it to IAX_OPCODE_ZERO_COMP_32. 2. Operation code 0x4d is Zero Compress 16. IAX_OPCODE_DECOMP_16 is a misleading name. Change it to IAX_OPCODE_ZERO_COMP_16. 3. IAX_OPCDE_FIND_UNIQUE is corrected to match with other nomenclatures. Co-developed-by: NLi Zhang <li4.zhang@intel.com> Signed-off-by: NLi Zhang <li4.zhang@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20220707002052.1546361-1-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v6.0 commit 5dc86388 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 5dc86388 MAINTAINERS: idxd driver maintainer update. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add Fenghua as maintainer of the idxd driver. Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20220615232651.177098-1-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Jerry Snitselaar 提交于
mainline inclusion from mainline-v5.19 commit 8ffccd11 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 8ffccd11 dmaengine: idxd: Only call idxd_enable_system_pasid() if succeeded in enabling SVA feature. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- On a Sapphire Rapids system if boot without intel_iommu=on, the IDXD driver will crash during probe in iommu_sva_bind_device(). [ 21.423729] BUG: kernel NULL pointer dereference, address: 0000000000000038 [ 21.445108] #PF: supervisor read access in kernel mode [ 21.450912] #PF: error_code(0x0000) - not-present page [ 21.456706] PGD 0 [ 21.459047] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 21.464004] CPU: 0 PID: 1420 Comm: kworker/0:3 Not tainted 5.19.0-0.rc3.27.eln120.x86_64 #1 [ 21.464011] Hardware name: Intel Corporation EAGLESTREAM/EAGLESTREAM, BIOS EGSDCRB1.SYS.0067.D12.2110190954 10/19/2021 [ 21.464015] Workqueue: events work_for_cpu_fn [ 21.464030] RIP: 0010:iommu_sva_bind_device+0x1d/0xe0 [ 21.464046] Code: c3 cc 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 57 41 56 49 89 d6 41 55 41 54 55 53 48 83 ec 08 48 8b 87 d8 02 00 00 <48> 8b 40 38 48 8b 50 10 48 83 7a 70 00 48 89 14 24 0f 84 91 00 00 [ 21.464050] RSP: 0018:ff7245d9096b7db8 EFLAGS: 00010296 [ 21.464054] RAX: 0000000000000000 RBX: ff1eadeec8a51000 RCX: 0000000000000000 [ 21.464058] RDX: ff7245d9096b7e24 RSI: 0000000000000000 RDI: ff1eadeec8a510d0 [ 21.464060] RBP: ff1eadeec8a51000 R08: ffffffffb1a12300 R09: ff1eadffbfce25b4 [ 21.464062] R10: ffffffffffffffff R11: 0000000000000038 R12: ffffffffc09f8000 [ 21.464065] R13: ff1eadeec8a510d0 R14: ff7245d9096b7e24 R15: ff1eaddf54429000 [ 21.464067] FS: 0000000000000000(0000) GS:ff1eadee7f600000(0000) knlGS:0000000000000000 [ 21.464070] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 21.464072] CR2: 0000000000000038 CR3: 00000008c0e10006 CR4: 0000000000771ef0 [ 21.464074] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 21.464076] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 21.464078] PKRU: 55555554 [ 21.464079] Call Trace: [ 21.464083] <TASK> [ 21.464092] idxd_pci_probe+0x259/0x1070 [idxd] [ 21.464121] local_pci_probe+0x3e/0x80 [ 21.464132] work_for_cpu_fn+0x13/0x20 [ 21.464136] process_one_work+0x1c4/0x380 [ 21.464143] worker_thread+0x1ab/0x380 [ 21.464147] ? _raw_spin_lock_irqsave+0x23/0x50 [ 21.464158] ? process_one_work+0x380/0x380 [ 21.464161] kthread+0xe6/0x110 [ 21.464168] ? kthread_complete_and_exit+0x20/0x20 [ 21.464172] ret_from_fork+0x1f/0x30 iommu_sva_bind_device() requires SVA has been enabled successfully on the IDXD device before it's called. Otherwise, iommu_sva_bind_device() will access a NULL pointer. If Intel IOMMU is disabled, SVA cannot be enabled and thus idxd_enable_system_pasid() and iommu_sva_bind_device() should not be called. Fixes: 42a1b738 ("dmaengine: idxd: Separate user and kernel pasid enabling") Cc: Vinod Koul <vkoul@kernel.org> Cc: linux-kernel@vger.kernel.org Cc: Dave Jiang <dave.jiang@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/dmaengine/20220623170232.6whonfjuh3m5vcoy@cantor/Signed-off-by: NJerry Snitselaar <jsnitsel@redhat.com> Acked-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220626051648.14249-1-jsnitsel@redhat.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.19 commit 44c4237c category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 44c4237c dmaengine: idxd: force wq context cleanup on device disable path. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Testing shown that when a wq mode is setup to be dedicated and then torn down and reconfigured to shared, the wq configured end up being dedicated anyays. The root cause is when idxd_device_wqs_clear_state() gets called during idxd_driver removal, idxd_wq_disable_cleanup() does not get called vs when the wq driver is removed first. The check of wq state being "enabled" causes the cleanup to be bypassed. However, idxd_driver->remove() releases all wq drivers. So the wqs goes to "disabled" state and will never be "enabled". By that point, the driver has no idea if the wq was previously configured or clean. So force call idxd_wq_disable_cleanup() on all wqs always to make sure everything gets cleaned up. Reported-by: NTony Zhu <tony.zhu@intel.com> Tested-by: NTony Zhu <tony.zhu@intel.com> Fixes: 0dcfe41e ("dmanegine: idxd: cleanup all device related bits after disabling device") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Co-developed-by: NFenghua Yu <fenghua.yu@intel.com> Signed-off-by: NFenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20220628230056.2527816-1-fenghua.yu@intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.19 commit d1a28597 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d1a28597 dmaengine: idxd: make idxd_wq_enable() return 0 if wq is already enabled. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- When calling idxd_wq_enable() and wq is already enabled, code should return 0 and indicate function is successful instead of return error code and fail. This should also put idxd_wq_enable() in sync with idxd_wq_disable() where it returns 0 if wq is already disabled. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/165090980906.1378449.1939401700832432886.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Minghao Chi 提交于
mainline inclusion from mainline-v5.19 commit 411dccf9 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 411dccf9 dmaengine: idxd: Remove unnecessary synchronize_irq() before free_irq(). Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Signed-off-by: NMinghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220516115412.1651772-1-chi.minghao@zte.com.cnAcked-by: NDave Jiang <dave.jiang@intel.com> Signed-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.19 commit d0ad4238 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d0ad4238 dmaengine: idxd: skip irq free when wq type is not kernel. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Skip wq irq resources freeing when wq type is not kernel since the driver skips the irq alloction during wq enable. Add check in wq type check in idxd_wq_free_irq() to mirror idxd_wq_request_irq(). Fixes: 63c14ae6 ("dmaengine: idxd: refactor wq driver enable/disable operations") Reported-by: NTony Zu <tony.zhu@intel.com> Tested-by: NTony Zu <tony.zhu@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/165176310726.2112428.7474366910758522079.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-