···215215 reduce the compile time enormously, especially if you are running an216216 universal kernel from a commodity Linux distribution.217217218218- There is a catch: the make target 'localmodconfig' will disable kernel219219- features you have not directly or indirectly through some program utilized220220- since you booted the system. You can reduce or nearly eliminate that risk by221221- using tricks outlined in the reference section; for quick testing purposes222222- that risk is often negligible, but it is an aspect you want to keep in mind223223- in case your kernel behaves oddly.218218+ There is a catch: 'localmodconfig' is likely to disable kernel features you219219+ did not use since you booted your Linux -- like drivers for currently220220+ disconnected peripherals or a virtualization software not haven't used yet.221221+ You can reduce or nearly eliminate that risk with tricks the reference222222+ section outlines; but when building a kernel just for quick testing purposes223223+ it is often negligible if such features are missing. But you should keep that224224+ aspect in mind when using a kernel built with this make target, as it might225225+ be the reason why something you only use occasionally stopped working.224226225227 [:ref:`details<configuration>`]226228···273271 does nothing at all; in that case you have to manually install your kernel,274272 as outlined in the reference section.275273274274+ If you are running a immutable Linux distribution, check its documentation275275+ and the web to find out how to install your own kernel there.276276+276277 [:ref:`details<install>`]277278278279.. _another_sbs:···296291 version you care about, as git otherwise might retrieve the entire commit297292 history::298293299299- git fetch --shallow-exclude=v6.1 origin294294+ git fetch --shallow-exclude=v6.0 origin300295301301- If you modified the sources (for example by applying a patch), you now need302302- to discard those modifications; that's because git otherwise will not be able303303- to switch to the sources of another version due to potential conflicting304304- changes::296296+ Now switch to the version you are interested in -- but be aware the command297297+ used here will discard any modifications you performed, as they would298298+ conflict with the sources you want to checkout::305299306306- git reset --hard307307-308308- Now checkout the version you are interested in, as explained above::309309-310310- git checkout --detach origin/master300300+ git checkout --force --detach origin/master311301312302 At this point you might want to patch the sources again or set/modify a build313313- tag, as explained earlier; afterwards adjust the build configuration to the314314- new codebase and build your next kernel::303303+ tag, as explained earlier. Afterwards adjust the build configuration to the304304+ new codebase using olddefconfig, which will now adjust the configuration file305305+ you prepared earlier using localmodconfig (~/linux/.config) for your next306306+ kernel::315307316308 # reminder: if you want to apply patches, do it at this point317309 # reminder: you might want to update your build tag at this point318310 make olddefconfig311311+312312+ Now build your kernel::313313+319314 make -j $(nproc --all)320315321321- Install the kernel as outlined above::316316+ Afterwards install the kernel as outlined above::322317323318 command -v installkernel && sudo make modules_install install324319···589584 curl -L \590585 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/clone.bundle \591586 -o linux-stable.git.bundle592592- git clone clone.bundle ~/linux/587587+ git clone linux-stable.git.bundle ~/linux/593588 rm linux-stable.git.bundle594589 cd ~/linux/595595- git remote set-url origin596596- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git590590+ git remote set-url origin \591591+ https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git597592 git fetch origin598593 git checkout --detach origin/master599594
···8282 Indicates if the DSI controller is driving a panel which needs8383 2 DSI links.84848585+ qcom,master-dsi:8686+ type: boolean8787+ description: |8888+ Indicates if the DSI controller is the master DSI controller when8989+ qcom,dual-dsi-mode enabled.9090+9191+ qcom,sync-dual-dsi:9292+ type: boolean9393+ description: |9494+ Indicates if the DSI controller needs to sync the other DSI controller9595+ with MIPI DCS commands when qcom,dual-dsi-mode enabled.9696+8597 assigned-clocks:8698 minItems: 28799 maxItems: 4
···21212222 st,can-primary:2323 description:2424- Primary and secondary mode of the bxCAN peripheral is only relevant2525- if the chip has two CAN peripherals. In that case they share some2626- of the required logic.2424+ Primary mode of the bxCAN peripheral is only relevant if the chip has2525+ two CAN peripherals in dual CAN configuration. In that case they share2626+ some of the required logic.2727+ Not to be used if the peripheral is in single CAN configuration.2728 To avoid misunderstandings, it should be noted that ST documentation2828- uses the terms master/slave instead of primary/secondary.2929+ uses the terms master instead of primary.3030+ type: boolean3131+3232+ st,can-secondary:3333+ description:3434+ Secondary mode of the bxCAN peripheral is only relevant if the chip3535+ has two CAN peripherals in dual CAN configuration. In that case they3636+ share some of the required logic.3737+ Not to be used if the peripheral is in single CAN configuration.3838+ To avoid misunderstandings, it should be noted that ST documentation3939+ uses the terms slave instead of secondary.2940 type: boolean30413142 reg:
···6677October 17, 20058899-Rob Landley <rob@landley.net>1010-=============================99+:Author: Rob Landley <rob@landley.net>11101211What is ramfs?1312--------------
···11=================================22-brief tutorial on CRC computation22+Brief tutorial on CRC computation33=================================4455A CRC is a long-division remainder. You add the CRC to the message,
···6666 return;67676868 /* if PG_mte_tagged is set, tags have already been initialised */6969- for (i = 0; i < nr_pages; i++, page++) {7070- if (!page_mte_tagged(page)) {6969+ for (i = 0; i < nr_pages; i++, page++)7070+ if (!page_mte_tagged(page))7171 mte_sync_page_tags(page, old_pte, check_swap,7272 pte_is_tagged);7373- set_page_mte_tagged(page);7474- }7575- }76737774 /* ensure the tags are visible before the PTE is set */7875 smp_wmb();
···81818282 fpsimd_kvm_prepare();83838484+ /*8585+ * We will check TIF_FOREIGN_FPSTATE just before entering the8686+ * guest in kvm_arch_vcpu_ctxflush_fp() and override this to8787+ * FP_STATE_FREE if the flag set.8888+ */8489 vcpu->arch.fp_state = FP_STATE_HOST_OWNED;85908691 vcpu_clear_flag(vcpu, HOST_SVE_ENABLED);8792 if (read_sysreg(cpacr_el1) & CPACR_EL1_ZEN_EL0EN)8893 vcpu_set_flag(vcpu, HOST_SVE_ENABLED);89949090- /*9191- * We don't currently support SME guests but if we leave9292- * things in streaming mode then when the guest starts running9393- * FPSIMD or SVE code it may generate SME traps so as a9494- * special case if we are in streaming mode we force the host9595- * state to be saved now and exit streaming mode so that we9696- * don't have to handle any SME traps for valid guest9797- * operations. Do this for ZA as well for now for simplicity.9898- */9995 if (system_supports_sme()) {10096 vcpu_clear_flag(vcpu, HOST_SME_ENABLED);10197 if (read_sysreg(cpacr_el1) & CPACR_EL1_SMEN_EL0EN)10298 vcpu_set_flag(vcpu, HOST_SME_ENABLED);10399100100+ /*101101+ * If PSTATE.SM is enabled then save any pending FP102102+ * state and disable PSTATE.SM. If we leave PSTATE.SM103103+ * enabled and the guest does not enable SME via104104+ * CPACR_EL1.SMEN then operations that should be valid105105+ * may generate SME traps from EL1 to EL1 which we106106+ * can't intercept and which would confuse the guest.107107+ *108108+ * Do the same for PSTATE.ZA in the case where there109109+ * is state in the registers which has not already110110+ * been saved, this is very unlikely to happen.111111+ */104112 if (read_sysreg_s(SYS_SVCR) & (SVCR_SM_MASK | SVCR_ZA_MASK)) {105113 vcpu->arch.fp_state = FP_STATE_FREE;106114 fpsimd_save_and_flush_cpu_state();
+10-2
arch/arm64/kvm/hyp/include/hyp/switch.h
···177177 sve_guest = vcpu_has_sve(vcpu);178178 esr_ec = kvm_vcpu_trap_get_class(vcpu);179179180180- /* Don't handle SVE traps for non-SVE vcpus here: */181181- if (!sve_guest && esr_ec != ESR_ELx_EC_FP_ASIMD)180180+ /* Only handle traps the vCPU can support here: */181181+ switch (esr_ec) {182182+ case ESR_ELx_EC_FP_ASIMD:183183+ break;184184+ case ESR_ELx_EC_SVE:185185+ if (!sve_guest)186186+ return false;187187+ break;188188+ default:182189 return false;190190+ }183191184192 /* Valid trap. Switch the context: */185193
+32-9
arch/arm64/kvm/hyp/pgtable.c
···5858struct kvm_pgtable_walk_data {5959 struct kvm_pgtable_walker *walker;60606161+ const u64 start;6162 u64 addr;6262- u64 end;6363+ const u64 end;6364};64656566static bool kvm_phys_is_valid(u64 phys)···202201 .old = READ_ONCE(*ptep),203202 .arg = data->walker->arg,204203 .mm_ops = mm_ops,204204+ .start = data->start,205205 .addr = data->addr,206206 .end = data->end,207207 .level = level,···295293 struct kvm_pgtable_walker *walker)296294{297295 struct kvm_pgtable_walk_data walk_data = {296296+ .start = ALIGN_DOWN(addr, PAGE_SIZE),298297 .addr = ALIGN_DOWN(addr, PAGE_SIZE),299298 .end = PAGE_ALIGN(walk_data.addr + size),300299 .walker = walker,···352349}353350354351struct hyp_map_data {355355- u64 phys;352352+ const u64 phys;356353 kvm_pte_t attr;357354};358355···410407static bool hyp_map_walker_try_leaf(const struct kvm_pgtable_visit_ctx *ctx,411408 struct hyp_map_data *data)412409{410410+ u64 phys = data->phys + (ctx->addr - ctx->start);413411 kvm_pte_t new;414414- u64 granule = kvm_granule_size(ctx->level), phys = data->phys;415412416413 if (!kvm_block_mapping_supported(ctx, phys))417414 return false;418415419419- data->phys += granule;420416 new = kvm_init_valid_leaf_pte(phys, data->attr, ctx->level);421417 if (ctx->old == new)422418 return true;···578576}579577580578struct stage2_map_data {581581- u64 phys;579579+ const u64 phys;582580 kvm_pte_t attr;583581 u8 owner_id;584582···796794 return !(pte & KVM_PTE_LEAF_ATTR_HI_S2_XN);797795}798796797797+static u64 stage2_map_walker_phys_addr(const struct kvm_pgtable_visit_ctx *ctx,798798+ const struct stage2_map_data *data)799799+{800800+ u64 phys = data->phys;801801+802802+ /*803803+ * Stage-2 walks to update ownership data are communicated to the map804804+ * walker using an invalid PA. Avoid offsetting an already invalid PA,805805+ * which could overflow and make the address valid again.806806+ */807807+ if (!kvm_phys_is_valid(phys))808808+ return phys;809809+810810+ /*811811+ * Otherwise, work out the correct PA based on how far the walk has812812+ * gotten.813813+ */814814+ return phys + (ctx->addr - ctx->start);815815+}816816+799817static bool stage2_leaf_mapping_allowed(const struct kvm_pgtable_visit_ctx *ctx,800818 struct stage2_map_data *data)801819{820820+ u64 phys = stage2_map_walker_phys_addr(ctx, data);821821+802822 if (data->force_pte && (ctx->level < (KVM_PGTABLE_MAX_LEVELS - 1)))803823 return false;804824805805- return kvm_block_mapping_supported(ctx, data->phys);825825+ return kvm_block_mapping_supported(ctx, phys);806826}807827808828static int stage2_map_walker_try_leaf(const struct kvm_pgtable_visit_ctx *ctx,809829 struct stage2_map_data *data)810830{811831 kvm_pte_t new;812812- u64 granule = kvm_granule_size(ctx->level), phys = data->phys;832832+ u64 phys = stage2_map_walker_phys_addr(ctx, data);833833+ u64 granule = kvm_granule_size(ctx->level);813834 struct kvm_pgtable *pgt = data->mmu->pgt;814835 struct kvm_pgtable_mm_ops *mm_ops = ctx->mm_ops;815836···866841867842 stage2_make_pte(ctx, new);868843869869- if (kvm_phys_is_valid(phys))870870- data->phys += granule;871844 return 0;872845}873846
+1-1
arch/arm64/kvm/inject_fault.c
···204204 * Size Fault at level 0, as if exceeding PARange.205205 *206206 * Non-LPAE guests will only get the external abort, as there207207- * is no way to to describe the ASF.207207+ * is no way to describe the ASF.208208 */209209 if (vcpu_el1_is_32bit(vcpu) &&210210 !(vcpu_read_sys_reg(vcpu, TCR_EL1) & TTBCR_EAE))
···21212222 copy_page(kto, kfrom);23232424+ if (kasan_hw_tags_enabled())2525+ page_kasan_tag_reset(to);2626+2427 if (system_supports_mte() && page_mte_tagged(from)) {2525- if (kasan_hw_tags_enabled())2626- page_kasan_tag_reset(to);2728 /* It's a new page, shouldn't have been tagged yet */2829 WARN_ON_ONCE(!try_page_mte_tagging(to));2930 mte_copy_page_tags(kto, kfrom);
+2-2
arch/arm64/mm/fault.c
···480480 }481481}482482483483-#define VM_FAULT_BADMAP 0x010000484484-#define VM_FAULT_BADACCESS 0x020000483483+#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000)484484+#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000)485485486486static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,487487 unsigned int mm_flags, unsigned long vm_flags,
···96969797config CRYPTO_AES_GCM_P109898 tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)"9999- depends on PPC64 && CPU_LITTLE_ENDIAN9999+ depends on PPC64 && CPU_LITTLE_ENDIAN && VSX100100 select CRYPTO_LIB_AES101101 select CRYPTO_ALGAPI102102 select CRYPTO_AEAD
-5
arch/powerpc/include/asm/iommu.h
···205205 int pci_domain_number, unsigned long pe_num);206206extern int iommu_add_device(struct iommu_table_group *table_group,207207 struct device *dev);208208-extern void iommu_del_device(struct device *dev);209208extern long iommu_tce_xchg(struct mm_struct *mm, struct iommu_table *tbl,210209 unsigned long entry, unsigned long *hpa,211210 enum dma_data_direction *direction);···227228 struct device *dev)228229{229230 return 0;230230-}231231-232232-static inline void iommu_del_device(struct device *dev)233233-{234231}235232#endif /* !CONFIG_IOMMU_API */236233
+3-1
arch/powerpc/kernel/dma-iommu.c
···144144/* We support DMA to/from any memory page via the iommu */145145int dma_iommu_dma_supported(struct device *dev, u64 mask)146146{147147- struct iommu_table *tbl = get_iommu_table_base(dev);147147+ struct iommu_table *tbl;148148149149 if (dev_is_pci(dev) && dma_iommu_bypass_supported(dev, mask)) {150150 /*···161161 dev_dbg(dev, "iommu: 64-bit OK, using fixed ops\n");162162 return 1;163163 }164164+165165+ tbl = get_iommu_table_base(dev);164166165167 if (!tbl) {166168 dev_err(dev, "Warning: IOMMU dma not supported: mask 0x%08llx, table unavailable\n", mask);
+7-21
arch/powerpc/kernel/iommu.c
···518518 /* Convert entry to a dma_addr_t */519519 entry += tbl->it_offset;520520 dma_addr = entry << tbl->it_page_shift;521521- dma_addr |= (s->offset & ~IOMMU_PAGE_MASK(tbl));521521+ dma_addr |= (vaddr & ~IOMMU_PAGE_MASK(tbl));522522523523 DBG(" - %lu pages, entry: %lx, dma_addr: %lx\n",524524 npages, entry, dma_addr);···905905 unsigned int order;906906 unsigned int nio_pages, io_order;907907 struct page *page;908908+ int tcesize = (1 << tbl->it_page_shift);908909909910 size = PAGE_ALIGN(size);910911 order = get_order(size);···932931 memset(ret, 0, size);933932934933 /* Set up tces to cover the allocated range */935935- nio_pages = size >> tbl->it_page_shift;934934+ nio_pages = IOMMU_PAGE_ALIGN(size, tbl) >> tbl->it_page_shift;935935+936936 io_order = get_iommu_order(size, tbl);937937 mapping = iommu_alloc(dev, tbl, ret, nio_pages, DMA_BIDIRECTIONAL,938938 mask >> tbl->it_page_shift, io_order, 0);···941939 free_pages((unsigned long)ret, order);942940 return NULL;943941 }944944- *dma_handle = mapping;942942+943943+ *dma_handle = mapping | ((u64)ret & (tcesize - 1));945944 return ret;946945}947946···953950 unsigned int nio_pages;954951955952 size = PAGE_ALIGN(size);956956- nio_pages = size >> tbl->it_page_shift;953953+ nio_pages = IOMMU_PAGE_ALIGN(size, tbl) >> tbl->it_page_shift;957954 iommu_free(tbl, dma_handle, nio_pages);958955 size = PAGE_ALIGN(size);959956 free_pages((unsigned long)vaddr, get_order(size));···11701167 return iommu_probe_device(dev);11711168}11721169EXPORT_SYMBOL_GPL(iommu_add_device);11731173-11741174-void iommu_del_device(struct device *dev)11751175-{11761176- /*11771177- * Some devices might not have IOMMU table and group11781178- * and we needn't detach them from the associated11791179- * IOMMU groups11801180- */11811181- if (!device_iommu_mapped(dev)) {11821182- pr_debug("iommu_tce: skipping device %s with no tbl\n",11831183- dev_name(dev));11841184- return;11851185- }11861186-11871187- iommu_group_remove_device(dev);11881188-}11891189-EXPORT_SYMBOL_GPL(iommu_del_device);1190117011911171/*11921172 * A simple iommu_table_group_ops which only allows reusing the existing
+3-2
arch/powerpc/kernel/isa-bridge.c
···9393 }94949595inval_range:9696- if (!phb_io_base_phys) {9696+ if (phb_io_base_phys) {9797 pr_err("no ISA IO ranges or unexpected isa range, mapping 64k\n");9898 remap_isa_base(phb_io_base_phys, 0x10000);9999+ return 0;99100 }100100- return 0;101101+ return -EINVAL;101102}102103103104
+2-2
arch/powerpc/mm/book3s64/radix_pgtable.c
···10401040 pte_t entry, unsigned long address, int psize)10411041{10421042 struct mm_struct *mm = vma->vm_mm;10431043- unsigned long set = pte_val(entry) & (_PAGE_DIRTY | _PAGE_ACCESSED |10441044- _PAGE_RW | _PAGE_EXEC);10431043+ unsigned long set = pte_val(entry) & (_PAGE_DIRTY | _PAGE_SOFT_DIRTY |10441044+ _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);1045104510461046 unsigned long change = pte_val(entry) ^ pte_val(*ptep);10471047 /*
+2
arch/powerpc/net/bpf_jit_comp.c
···101101 bpf_hdr = jit_data->header;102102 proglen = jit_data->proglen;103103 extra_pass = true;104104+ /* During extra pass, ensure index is reset before repopulating extable entries */105105+ cgctx.exentry_idx = 0;104106 goto skip_init_ctx;105107 }106108
+1
arch/powerpc/platforms/Kconfig
···265265config FSL_ULI1575266266 bool "ULI1575 PCIe south bridge support"267267 depends on FSL_SOC_BOOKE || PPC_86xx268268+ depends on PCI268269 select FSL_PCI269270 select GENERIC_ISA_DMA270271 help
···469469config SCHED_MC470470 def_bool n471471472472-config SCHED_BOOK473473- def_bool n474474-475475-config SCHED_DRAWER476476- def_bool n477477-478472config SCHED_TOPOLOGY479473 def_bool y480474 prompt "Topology scheduler support"481475 select SCHED_SMT482476 select SCHED_MC483483- select SCHED_BOOK484484- select SCHED_DRAWER485477 help486478 Topology scheduler support improves the CPU scheduler's decision487479 making when dealing with machines that have multi-threading,···708716config VFIO_CCW709717 def_tristate n710718 prompt "Support for VFIO-CCW subchannels"711711- depends on S390_CCW_IOMMU712719 depends on VFIO713720 select VFIO_MDEV714721 help···719728config VFIO_AP720729 def_tristate n721730 prompt "VFIO support for AP devices"722722- depends on S390_AP_IOMMU && KVM731731+ depends on KVM723732 depends on VFIO724733 depends on ZCRYPT725734 select VFIO_MDEV
+1-2
arch/s390/configs/debug_defconfig
···591591CONFIG_VIRTIO_INPUT=y592592CONFIG_VHOST_NET=m593593CONFIG_VHOST_VSOCK=m594594-CONFIG_S390_CCW_IOMMU=y595595-CONFIG_S390_AP_IOMMU=y596594CONFIG_EXT4_FS=y597595CONFIG_EXT4_FS_POSIX_ACL=y598596CONFIG_EXT4_FS_SECURITY=y···701703CONFIG_IMA_WRITE_POLICY=y702704CONFIG_IMA_APPRAISE=y703705CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor"706706+CONFIG_INIT_STACK_NONE=y704707CONFIG_CRYPTO_USER=m705708# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set706709CONFIG_CRYPTO_PCRYPT=m
+1-2
arch/s390/configs/defconfig
···580580CONFIG_VIRTIO_INPUT=y581581CONFIG_VHOST_NET=m582582CONFIG_VHOST_VSOCK=m583583-CONFIG_S390_CCW_IOMMU=y584584-CONFIG_S390_AP_IOMMU=y585583CONFIG_EXT4_FS=y586584CONFIG_EXT4_FS_POSIX_ACL=y587585CONFIG_EXT4_FS_SECURITY=y···684686CONFIG_IMA_WRITE_POLICY=y685687CONFIG_IMA_APPRAISE=y686688CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor"689689+CONFIG_INIT_STACK_NONE=y687690CONFIG_CRYPTO_FIPS=y688691CONFIG_CRYPTO_USER=m689692# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
+1
arch/s390/configs/zfcpdump_defconfig
···6767# CONFIG_MISC_FILESYSTEMS is not set6868# CONFIG_NETWORK_FILESYSTEMS is not set6969CONFIG_LSM="yama,loadpin,safesetid,integrity"7070+CONFIG_INIT_STACK_NONE=y7071# CONFIG_ZLIB_DFLTCC is not set7172CONFIG_XZ_DEC_MICROLZMA=y7273CONFIG_PRINTK_TIME=y
+1-1
arch/s390/crypto/chacha-glue.c
···8282 * it cannot handle a block of data or less, but otherwise8383 * it can handle data of arbitrary size8484 */8585- if (bytes <= CHACHA_BLOCK_SIZE || nrounds != 20)8585+ if (bytes <= CHACHA_BLOCK_SIZE || nrounds != 20 || !MACHINE_HAS_VX)8686 chacha_crypt_generic(state, dst, src, bytes, nrounds);8787 else8888 chacha20_crypt_s390(state, dst, src, bytes,
···3030 unsigned int f_namelen;3131 unsigned int f_frsize;3232 unsigned int f_flags;3333- unsigned int f_spare[4];3333+ unsigned int f_spare[5];3434};35353636struct statfs64 {···4545 unsigned int f_namelen;4646 unsigned int f_frsize;4747 unsigned int f_flags;4848- unsigned int f_spare[4];4848+ unsigned int f_spare[5];4949};50505151#endif
+1
arch/s390/kernel/Makefile
···10101111# Do not trace early setup code1212CFLAGS_REMOVE_early.o = $(CC_FLAGS_FTRACE)1313+CFLAGS_REMOVE_rethook.o = $(CC_FLAGS_FTRACE)13141415endif1516
···253253 int nent)254254{255255 struct kvm_cpuid_entry2 *best;256256- u64 guest_supported_xcr0 = cpuid_get_supported_xcr0(entries, nent);257256258257 best = cpuid_entry2_find(entries, nent, 1, KVM_CPUID_INDEX_NOT_SIGNIFICANT);259258 if (best) {···290291 cpuid_entry_change(best, X86_FEATURE_MWAIT,291292 vcpu->arch.ia32_misc_enable_msr &292293 MSR_IA32_MISC_ENABLE_MWAIT);293293- }294294-295295- /*296296- * Bits 127:0 of the allowed SECS.ATTRIBUTES (CPUID.0x12.0x1) enumerate297297- * the supported XSAVE Feature Request Mask (XFRM), i.e. the enclave's298298- * requested XCR0 value. The enclave's XFRM must be a subset of XCRO299299- * at the time of EENTER, thus adjust the allowed XFRM by the guest's300300- * supported XCR0. Similar to XCR0 handling, FP and SSE are forced to301301- * '1' even on CPUs that don't support XSAVE.302302- */303303- best = cpuid_entry2_find(entries, nent, 0x12, 0x1);304304- if (best) {305305- best->ecx &= guest_supported_xcr0 & 0xffffffff;306306- best->edx &= guest_supported_xcr0 >> 32;307307- best->ecx |= XFEATURE_MASK_FPSSE;308294 }309295}310296
+9-2
arch/x86/kvm/vmx/sgx.c
···170170 return 1;171171 }172172173173- /* Enforce CPUID restrictions on MISCSELECT, ATTRIBUTES and XFRM. */173173+ /*174174+ * Enforce CPUID restrictions on MISCSELECT, ATTRIBUTES and XFRM. Note175175+ * that the allowed XFRM (XFeature Request Mask) isn't strictly bound176176+ * by the supported XCR0. FP+SSE *must* be set in XFRM, even if XSAVE177177+ * is unsupported, i.e. even if XCR0 itself is completely unsupported.178178+ */174179 if ((u32)miscselect & ~sgx_12_0->ebx ||175180 (u32)attributes & ~sgx_12_1->eax ||176181 (u32)(attributes >> 32) & ~sgx_12_1->ebx ||177182 (u32)xfrm & ~sgx_12_1->ecx ||178178- (u32)(xfrm >> 32) & ~sgx_12_1->edx) {183183+ (u32)(xfrm >> 32) & ~sgx_12_1->edx ||184184+ xfrm & ~(vcpu->arch.guest_supported_xcr0 | XFEATURE_MASK_FPSSE) ||185185+ (xfrm & XFEATURE_MASK_FPSSE) != XFEATURE_MASK_FPSSE) {179186 kvm_inject_gp(vcpu, 0);180187 return 1;181188 }
+5-1
arch/x86/kvm/x86.c
···14461446#endif14471447 MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA,14481448 MSR_IA32_FEAT_CTL, MSR_IA32_BNDCFGS, MSR_TSC_AUX,14491449- MSR_IA32_SPEC_CTRL,14491449+ MSR_IA32_SPEC_CTRL, MSR_IA32_TSX_CTRL,14501450 MSR_IA32_RTIT_CTL, MSR_IA32_RTIT_STATUS, MSR_IA32_RTIT_CR3_MATCH,14511451 MSR_IA32_RTIT_OUTPUT_BASE, MSR_IA32_RTIT_OUTPUT_MASK,14521452 MSR_IA32_RTIT_ADDR0_A, MSR_IA32_RTIT_ADDR0_B,···71537153 case MSR_IA32_XFD:71547154 case MSR_IA32_XFD_ERR:71557155 if (!kvm_cpu_cap_has(X86_FEATURE_XFD))71567156+ return;71577157+ break;71587158+ case MSR_IA32_TSX_CTRL:71597159+ if (!(kvm_get_arch_capabilities() & ARCH_CAP_TSX_CTRL_MSR))71567160 return;71577161 break;71587162 default:
···571571{572572 struct tpm_chip *chip = container_of(rng, struct tpm_chip, hwrng);573573574574+ /* Give back zero bytes, as TPM chip has not yet fully resumed: */575575+ if (chip->flags & TPM_CHIP_FLAG_SUSPENDED)576576+ return 0;577577+574578 return tpm_get_random(chip, data, max);575579}576580
+10
drivers/char/tpm/tpm-interface.c
···412412 }413413414414suspended:415415+ chip->flags |= TPM_CHIP_FLAG_SUSPENDED;416416+415417 if (rc)416418 dev_err(dev, "Ignoring error %d while suspending\n", rc);417419 return 0;···430428431429 if (chip == NULL)432430 return -ENODEV;431431+432432+ chip->flags &= ~TPM_CHIP_FLAG_SUSPENDED;433433+434434+ /*435435+ * Guarantee that SUSPENDED is written last, so that hwrng does not436436+ * activate before the chip has been fully resumed.437437+ */438438+ wmb();433439434440 return 0;435441}
···12091209 u32 intmask;12101210 int rc;1211121112121212- if (chip->ops->clk_enable != NULL)12131213- chip->ops->clk_enable(chip, true);12141214-12151215- /* reenable interrupts that device may have lost or12161216- * BIOS/firmware may have disabled12121212+ /*12131213+ * Re-enable interrupts that device may have lost or BIOS/firmware may12141214+ * have disabled.12171215 */12181216 rc = tpm_tis_write8(priv, TPM_INT_VECTOR(priv->locality), priv->irq);12191219- if (rc < 0)12201220- goto out;12171217+ if (rc < 0) {12181218+ dev_err(&chip->dev, "Setting IRQ failed.\n");12191219+ return;12201220+ }1221122112221222 intmask = priv->int_mask | TPM_GLOBAL_INT_ENABLE;12231223-12241224- tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask);12251225-12261226-out:12271227- if (chip->ops->clk_enable != NULL)12281228- chip->ops->clk_enable(chip, false);12291229-12301230- return;12231223+ rc = tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask);12241224+ if (rc < 0)12251225+ dev_err(&chip->dev, "Enabling interrupts failed.\n");12311226}1232122712331228int tpm_tis_resume(struct device *dev)···12301235 struct tpm_chip *chip = dev_get_drvdata(dev);12311236 int ret;1232123712331233- ret = tpm_tis_request_locality(chip, 0);12341234- if (ret < 0)12381238+ ret = tpm_chip_start(chip);12391239+ if (ret)12351240 return ret;1236124112371242 if (chip->flags & TPM_CHIP_FLAG_IRQ)12381243 tpm_tis_reenable_interrupts(chip);12391239-12401240- ret = tpm_pm_resume(dev);12411241- if (ret)12421242- goto out;1243124412441245 /*12451246 * TPM 1.2 requires self-test on resume. This function actually returns···12431252 */12441253 if (!(chip->flags & TPM_CHIP_FLAG_TPM2))12451254 tpm1_do_selftest(chip);12461246-out:12471247- tpm_tis_relinquish_locality(chip, 0);1248125512491249- return ret;12561256+ tpm_chip_stop(chip);12571257+12581258+ ret = tpm_pm_resume(dev);12591259+ if (ret)12601260+ return ret;12611261+12621262+ return 0;12501263}12511264EXPORT_SYMBOL_GPL(tpm_tis_resume);12521265#endif
+1-1
drivers/cpufreq/acpi-cpufreq.c
···975975976976 /* don't keep reloading if cpufreq_driver exists */977977 if (cpufreq_get_current_driver())978978- return -EEXIST;978978+ return -ENODEV;979979980980 pr_debug("%s\n", __func__);981981
+1-1
drivers/cpufreq/pcc-cpufreq.c
···583583584584 /* Skip initialization if another cpufreq driver is there. */585585 if (cpufreq_get_current_driver())586586- return -EEXIST;586586+ return -ENODEV;587587588588 if (acpi_disabled)589589 return -ENODEV;
+2-1
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
···582582 if (r)583583 amdgpu_fence_driver_force_completion(ring);584584585585- if (ring->fence_drv.irq_src)585585+ if (!drm_dev_is_unplugged(adev_to_drm(adev)) &&586586+ ring->fence_drv.irq_src)586587 amdgpu_irq_put(adev, ring->fence_drv.irq_src,587588 ring->fence_drv.irq_type);588589
+7-1
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
···81528152 case IP_VERSION(10, 3, 3):81538153 case IP_VERSION(10, 3, 6):81548154 case IP_VERSION(10, 3, 7):81558155+ if (!enable)81568156+ amdgpu_gfx_off_ctrl(adev, false);81578157+81558158 gfx_v10_cntl_pg(adev, enable);81568156- amdgpu_gfx_off_ctrl(adev, enable);81598159+81608160+ if (enable)81618161+ amdgpu_gfx_off_ctrl(adev, true);81628162+81578163 break;81588164 default:81598165 break;
···733733 return ret;734734 }735735736736+ /*737737+ * Explicitly notify PMFW the power mode the system in. Since738738+ * the PMFW may boot the ASIC with a different mode.739739+ * For those supporting ACDC switch via gpio, PMFW will740740+ * handle the switch automatically. Driver involvement741741+ * is unnecessary.742742+ */743743+ if (!smu->dc_controlled_by_gpio) {744744+ ret = smu_set_power_source(smu,745745+ adev->pm.ac_power ? SMU_POWER_SOURCE_AC :746746+ SMU_POWER_SOURCE_DC);747747+ if (ret) {748748+ dev_err(adev->dev, "Failed to switch to %s mode!\n",749749+ adev->pm.ac_power ? "AC" : "DC");750750+ return ret;751751+ }752752+ }753753+736754 if ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 1)) ||737755 (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 3)))738756 return 0;
+1-19
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
···34133413 return 0;3414341434153415 ret = navi10_run_umc_cdr_workaround(smu);34163416- if (ret) {34163416+ if (ret)34173417 dev_err(adev->dev, "Failed to apply umc cdr workaround!\n");34183418- return ret;34193419- }34203420-34213421- if (!smu->dc_controlled_by_gpio) {34223422- /*34233423- * For Navi1X, manually switch it to AC mode as PMFW34243424- * may boot it with DC mode.34253425- */34263426- ret = smu_v11_0_set_power_source(smu,34273427- adev->pm.ac_power ?34283428- SMU_POWER_SOURCE_AC :34293429- SMU_POWER_SOURCE_DC);34303430- if (ret) {34313431- dev_err(adev->dev, "Failed to switch to %s mode!\n",34323432- adev->pm.ac_power ? "AC" : "DC");34333433- return ret;34343434- }34353435- }3436341834373419 return ret;34383420}
···722722 struct msm_drm_private *priv = dev->dev_private;723723 struct drm_msm_gem_submit *args = data;724724 struct msm_file_private *ctx = file->driver_priv;725725- struct msm_gem_submit *submit;725725+ struct msm_gem_submit *submit = NULL;726726 struct msm_gpu *gpu = priv->gpu;727727 struct msm_gpu_submitqueue *queue;728728 struct msm_ringbuffer *ring;···769769 out_fence_fd = get_unused_fd_flags(O_CLOEXEC);770770 if (out_fence_fd < 0) {771771 ret = out_fence_fd;772772- return ret;772772+ goto out_post_unlock;773773 }774774 }775775776776 submit = submit_create(dev, gpu, queue, args->nr_bos, args->nr_cmds);777777- if (IS_ERR(submit))778778- return PTR_ERR(submit);777777+ if (IS_ERR(submit)) {778778+ ret = PTR_ERR(submit);779779+ goto out_post_unlock;780780+ }779781780782 trace_msm_gpu_submit(pid_nr(submit->pid), ring->id, submit->ident,781783 args->nr_bos, args->nr_cmds);···964962 if (has_ww_ticket)965963 ww_acquire_fini(&submit->ticket);966964out_unlock:967967- if (ret && (out_fence_fd >= 0))968968- put_unused_fd(out_fence_fd);969965 mutex_unlock(&queue->lock);970966out_post_unlock:971971- msm_gem_submit_put(submit);967967+ if (ret && (out_fence_fd >= 0))968968+ put_unused_fd(out_fence_fd);969969+970970+ if (!IS_ERR_OR_NULL(submit)) {971971+ msm_gem_submit_put(submit);972972+ } else {973973+ /*974974+ * If the submit hasn't yet taken ownership of the queue975975+ * then we need to drop the reference ourself:976976+ */977977+ msm_submitqueue_put(queue);978978+ }972979 if (!IS_ERR_OR_NULL(post_deps)) {973980 for (i = 0; i < args->nr_out_syncobjs; ++i) {974981 kfree(post_deps[i].chain);
+7-2
drivers/gpu/drm/msm/msm_iommu.c
···234234 /* Get the pagetable configuration from the domain */235235 if (adreno_smmu->cookie)236236 ttbr1_cfg = adreno_smmu->get_ttbr1_cfg(adreno_smmu->cookie);237237- if (!ttbr1_cfg)237237+238238+ /*239239+ * If you hit this WARN_ONCE() you are probably missing an entry in240240+ * qcom_smmu_impl_of_match[] in arm-smmu-qcom.c241241+ */242242+ if (WARN_ONCE(!ttbr1_cfg, "No per-process page tables"))238243 return ERR_PTR(-ENODEV);239244240245 pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL);···415410 struct msm_mmu *mmu;416411417412 mmu = msm_iommu_new(dev, quirks);418418- if (IS_ERR(mmu))413413+ if (IS_ERR_OR_NULL(mmu))419414 return mmu;420415421416 iommu = to_msm_iommu(mmu);
-16
drivers/iommu/Kconfig
···417417 help418418 Support for the IOMMU API for s390 PCI devices.419419420420-config S390_CCW_IOMMU421421- bool "S390 CCW IOMMU Support"422422- depends on S390 && CCW || COMPILE_TEST423423- select IOMMU_API424424- help425425- Enables bits of IOMMU API required by VFIO. The iommu_ops426426- is not implemented as it is not necessary for VFIO.427427-428428-config S390_AP_IOMMU429429- bool "S390 AP IOMMU Support"430430- depends on S390 && ZCRYPT || COMPILE_TEST431431- select IOMMU_API432432- help433433- Enables bits of IOMMU API required by VFIO. The iommu_ops434434- is not implemented as it is not necessary for VFIO.435435-436420config MTK_IOMMU437421 tristate "MediaTek IOMMU Support"438422 depends on ARCH_MEDIATEK || COMPILE_TEST
+10
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
···517517 { .compatible = "qcom,qcm2290-smmu-500", .data = &qcom_smmu_500_impl0_data },518518 { .compatible = "qcom,qdu1000-smmu-500", .data = &qcom_smmu_500_impl0_data },519519 { .compatible = "qcom,sc7180-smmu-500", .data = &qcom_smmu_500_impl0_data },520520+ { .compatible = "qcom,sc7180-smmu-v2", .data = &qcom_smmu_v2_data },520521 { .compatible = "qcom,sc7280-smmu-500", .data = &qcom_smmu_500_impl0_data },521522 { .compatible = "qcom,sc8180x-smmu-500", .data = &qcom_smmu_500_impl0_data },522523 { .compatible = "qcom,sc8280xp-smmu-500", .data = &qcom_smmu_500_impl0_data },···561560 match = of_match_node(qcom_smmu_impl_of_match, np);562561 if (match)563562 return qcom_smmu_create(smmu, match->data);563563+564564+ /*565565+ * If you hit this WARN_ON() you are missing an entry in the566566+ * qcom_smmu_impl_of_match[] table, and GPU per-process page-567567+ * tables will be broken.568568+ */569569+ WARN(of_device_is_compatible(np, "qcom,adreno-smmu"),570570+ "Missing qcom_smmu_impl_of_match entry for: %s",571571+ dev_name(smmu->dev));564572565573 return smmu;566574}
+43-6
drivers/media/dvb-core/dvb_ca_en50221.c
···151151152152 /* mutex serializing ioctls */153153 struct mutex ioctl_mutex;154154+155155+ /* A mutex used when a device is disconnected */156156+ struct mutex remove_mutex;157157+158158+ /* Whether the device is disconnected */159159+ int exit;154160};155161156162static void dvb_ca_private_free(struct dvb_ca_private *ca)···193187static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot,194188 u8 *ebuf, int ecount);195189static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,196196- u8 *ebuf, int ecount);190190+ u8 *ebuf, int ecount, int size_write_flag);197191198192/**199193 * findstr - Safely find needle in haystack.···376370 ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_FR, HZ / 10);377371 if (ret)378372 return ret;379379- ret = dvb_ca_en50221_write_data(ca, slot, buf, 2);373373+ ret = dvb_ca_en50221_write_data(ca, slot, buf, 2, CMDREG_SW);380374 if (ret != 2)381375 return -EIO;382376 ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN);···784778 * @buf: The data in this buffer is treated as a complete link-level packet to785779 * be written.786780 * @bytes_write: Size of ebuf.781781+ * @size_write_flag: A flag on Command Register which says whether the link size782782+ * information will be writen or not.787783 *788784 * return: Number of bytes written, or < 0 on error.789785 */790786static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,791791- u8 *buf, int bytes_write)787787+ u8 *buf, int bytes_write, int size_write_flag)792788{793789 struct dvb_ca_slot *sl = &ca->slot_info[slot];794790 int status;···825817826818 /* OK, set HC bit */827819 status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND,828828- IRQEN | CMDREG_HC);820820+ IRQEN | CMDREG_HC | size_write_flag);829821 if (status)830822 goto exit;831823···1516150815171509 mutex_lock(&sl->slot_lock);15181510 status = dvb_ca_en50221_write_data(ca, slot, fragbuf,15191519- fraglen + 2);15111511+ fraglen + 2, 0);15201512 mutex_unlock(&sl->slot_lock);15211513 if (status == (fraglen + 2)) {15221514 written = 1;···1717170917181710 dprintk("%s\n", __func__);1719171117201720- if (!try_module_get(ca->pub->owner))17121712+ mutex_lock(&ca->remove_mutex);17131713+17141714+ if (ca->exit) {17151715+ mutex_unlock(&ca->remove_mutex);17161716+ return -ENODEV;17171717+ }17181718+17191719+ if (!try_module_get(ca->pub->owner)) {17201720+ mutex_unlock(&ca->remove_mutex);17211721 return -EIO;17221722+ }1722172317231724 err = dvb_generic_open(inode, file);17241725 if (err < 0) {17251726 module_put(ca->pub->owner);17271727+ mutex_unlock(&ca->remove_mutex);17261728 return err;17271729 }17281730···1757173917581740 dvb_ca_private_get(ca);1759174117421742+ mutex_unlock(&ca->remove_mutex);17601743 return 0;17611744}17621745···1777175817781759 dprintk("%s\n", __func__);1779176017611761+ mutex_lock(&ca->remove_mutex);17621762+17801763 /* mark the CA device as closed */17811764 ca->open = 0;17821765 dvb_ca_en50221_thread_update_delay(ca);···17881767 module_put(ca->pub->owner);1789176817901769 dvb_ca_private_put(ca);17701770+17711771+ if (dvbdev->users == 1 && ca->exit == 1) {17721772+ mutex_unlock(&ca->remove_mutex);17731773+ wake_up(&dvbdev->wait_queue);17741774+ } else {17751775+ mutex_unlock(&ca->remove_mutex);17761776+ }1791177717921778 return err;17931779}···19191891 }1920189219211893 mutex_init(&ca->ioctl_mutex);18941894+ mutex_init(&ca->remove_mutex);1922189519231896 if (signal_pending(current)) {19241897 ret = -EINTR;···19611932 int i;1962193319631934 dprintk("%s\n", __func__);19351935+19361936+ mutex_lock(&ca->remove_mutex);19371937+ ca->exit = 1;19381938+ mutex_unlock(&ca->remove_mutex);19391939+19401940+ if (ca->dvbdev->users < 1)19411941+ wait_event(ca->dvbdev->wait_queue,19421942+ ca->dvbdev->users == 1);1964194319651944 /* shutdown the thread if there was one */19661945 kthread_stop(ca->thread);
+2-2
drivers/media/dvb-core/dvb_demux.c
···115115116116 cc = buf[3] & 0x0f;117117 ccok = ((feed->cc + 1) & 0x0f) == cc;118118- feed->cc = cc;119118 if (!ccok) {120119 set_buf_flags(feed, DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);121120 dprintk_sect_loss("missed packet: %d instead of %d!\n",122121 cc, (feed->cc + 1) & 0x0f);123122 }123123+ feed->cc = cc;124124125125 if (buf[1] & 0x40) // PUSI ?126126 feed->peslen = 0xfffa;···300300301301 cc = buf[3] & 0x0f;302302 ccok = ((feed->cc + 1) & 0x0f) == cc;303303- feed->cc = cc;304303305304 if (buf[3] & 0x20) {306305 /* adaption field present, check for discontinuity_indicator */···335336 feed->pusi_seen = false;336337 dvb_dmx_swfilter_section_new(feed);337338 }339339+ feed->cc = cc;338340339341 if (buf[1] & 0x40) {340342 /* PUSI=1 (is set), section boundary is here */
+56-13
drivers/media/dvb-core/dvb_frontend.c
···293293 }294294295295 if (events->eventw == events->eventr) {296296- int ret;296296+ struct wait_queue_entry wait;297297+ int ret = 0;297298298299 if (flags & O_NONBLOCK)299300 return -EWOULDBLOCK;300301301301- ret = wait_event_interruptible(events->wait_queue,302302- dvb_frontend_test_event(fepriv, events));303303-302302+ init_waitqueue_entry(&wait, current);303303+ add_wait_queue(&events->wait_queue, &wait);304304+ while (!dvb_frontend_test_event(fepriv, events)) {305305+ wait_woken(&wait, TASK_INTERRUPTIBLE, 0);306306+ if (signal_pending(current)) {307307+ ret = -ERESTARTSYS;308308+ break;309309+ }310310+ }311311+ remove_wait_queue(&events->wait_queue, &wait);304312 if (ret < 0)305313 return ret;306314 }···817809818810 dev_dbg(fe->dvb->device, "%s:\n", __func__);819811812812+ mutex_lock(&fe->remove_mutex);813813+820814 if (fe->exit != DVB_FE_DEVICE_REMOVED)821815 fe->exit = DVB_FE_NORMAL_EXIT;822816 mb();823817824824- if (!fepriv->thread)818818+ if (!fepriv->thread) {819819+ mutex_unlock(&fe->remove_mutex);825820 return;821821+ }826822827823 kthread_stop(fepriv->thread);824824+825825+ mutex_unlock(&fe->remove_mutex);826826+827827+ if (fepriv->dvbdev->users < -1) {828828+ wait_event(fepriv->dvbdev->wait_queue,829829+ fepriv->dvbdev->users == -1);830830+ }828831829832 sema_init(&fepriv->sem, 1);830833 fepriv->state = FESTATE_IDLE;···27802761 struct dvb_adapter *adapter = fe->dvb;27812762 int ret;2782276327642764+ mutex_lock(&fe->remove_mutex);27652765+27832766 dev_dbg(fe->dvb->device, "%s:\n", __func__);27842784- if (fe->exit == DVB_FE_DEVICE_REMOVED)27852785- return -ENODEV;27672767+ if (fe->exit == DVB_FE_DEVICE_REMOVED) {27682768+ ret = -ENODEV;27692769+ goto err_remove_mutex;27702770+ }2786277127872772 if (adapter->mfe_shared == 2) {27882773 mutex_lock(&adapter->mfe_lock);···27942771 if (adapter->mfe_dvbdev &&27952772 !adapter->mfe_dvbdev->writers) {27962773 mutex_unlock(&adapter->mfe_lock);27972797- return -EBUSY;27742774+ ret = -EBUSY;27752775+ goto err_remove_mutex;27982776 }27992777 adapter->mfe_dvbdev = dvbdev;28002778 }···28182794 while (mferetry-- && (mfedev->users != -1 ||28192795 mfepriv->thread)) {28202796 if (msleep_interruptible(500)) {28212821- if (signal_pending(current))28222822- return -EINTR;27972797+ if (signal_pending(current)) {27982798+ ret = -EINTR;27992799+ goto err_remove_mutex;28002800+ }28232801 }28242802 }28252803···28332807 if (mfedev->users != -1 ||28342808 mfepriv->thread) {28352809 mutex_unlock(&adapter->mfe_lock);28362836- return -EBUSY;28102810+ ret = -EBUSY;28112811+ goto err_remove_mutex;28372812 }28382813 adapter->mfe_dvbdev = dvbdev;28392814 }···2893286628942867 if (adapter->mfe_shared)28952868 mutex_unlock(&adapter->mfe_lock);28692869+28702870+ mutex_unlock(&fe->remove_mutex);28962871 return ret;2897287228982873err3:···29162887err0:29172888 if (adapter->mfe_shared)29182889 mutex_unlock(&adapter->mfe_lock);28902890+28912891+err_remove_mutex:28922892+ mutex_unlock(&fe->remove_mutex);29192893 return ret;29202894}29212895···29282896 struct dvb_frontend *fe = dvbdev->priv;29292897 struct dvb_frontend_private *fepriv = fe->frontend_priv;29302898 int ret;28992899+29002900+ mutex_lock(&fe->remove_mutex);2931290129322902 dev_dbg(fe->dvb->device, "%s:\n", __func__);29332903···29522918 }29532919 mutex_unlock(&fe->dvb->mdev_lock);29542920#endif29552955- if (fe->exit != DVB_FE_NO_EXIT)29562956- wake_up(&dvbdev->wait_queue);29572921 if (fe->ops.ts_bus_ctrl)29582922 fe->ops.ts_bus_ctrl(fe, 0);29232923+29242924+ if (fe->exit != DVB_FE_NO_EXIT) {29252925+ mutex_unlock(&fe->remove_mutex);29262926+ wake_up(&dvbdev->wait_queue);29272927+ } else {29282928+ mutex_unlock(&fe->remove_mutex);29292929+ }29302930+29312931+ } else {29322932+ mutex_unlock(&fe->remove_mutex);29592933 }2960293429612935 dvb_frontend_put(fe);···30643022 fepriv = fe->frontend_priv;3065302330663024 kref_init(&fe->refcount);30253025+ mutex_init(&fe->remove_mutex);3067302630683027 /*30693028 * After initialization, there need to be two references: one
···101101 if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {102102 if (msg[i].addr ==103103 ce6230_zl10353_config.demod_address) {104104+ if (msg[i].len < 1) {105105+ i = -EOPNOTSUPP;106106+ break;107107+ }104108 req.cmd = DEMOD_READ;105109 req.value = msg[i].addr >> 1;106110 req.index = msg[i].buf[0];···121117 } else {122118 if (msg[i].addr ==123119 ce6230_zl10353_config.demod_address) {120120+ if (msg[i].len < 1) {121121+ i = -EOPNOTSUPP;122122+ break;123123+ }124124 req.cmd = DEMOD_WRITE;125125 req.value = msg[i].addr >> 1;126126 req.index = msg[i].buf[0];
+12
drivers/media/usb/dvb-usb-v2/ec168.c
···115115 while (i < num) {116116 if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {117117 if (msg[i].addr == ec168_ec100_config.demod_address) {118118+ if (msg[i].len < 1) {119119+ i = -EOPNOTSUPP;120120+ break;121121+ }118122 req.cmd = READ_DEMOD;119123 req.value = 0;120124 req.index = 0xff00 + msg[i].buf[0]; /* reg */···135131 }136132 } else {137133 if (msg[i].addr == ec168_ec100_config.demod_address) {134134+ if (msg[i].len < 1) {135135+ i = -EOPNOTSUPP;136136+ break;137137+ }138138 req.cmd = WRITE_DEMOD;139139 req.value = msg[i].buf[1]; /* val */140140 req.index = 0xff00 + msg[i].buf[0]; /* reg */···147139 ret = ec168_ctrl_msg(d, &req);148140 i += 1;149141 } else {142142+ if (msg[i].len < 1) {143143+ i = -EOPNOTSUPP;144144+ break;145145+ }150146 req.cmd = WRITE_I2C;151147 req.value = msg[i].buf[0]; /* val */152148 req.index = 0x0100 + msg[i].addr; /* I2C addr */
+20
drivers/media/usb/dvb-usb-v2/rtl28xxu.c
···176176 ret = -EOPNOTSUPP;177177 goto err_mutex_unlock;178178 } else if (msg[0].addr == 0x10) {179179+ if (msg[0].len < 1 || msg[1].len < 1) {180180+ ret = -EOPNOTSUPP;181181+ goto err_mutex_unlock;182182+ }179183 /* method 1 - integrated demod */180184 if (msg[0].buf[0] == 0x00) {181185 /* return demod page from driver cache */···193189 ret = rtl28xxu_ctrl_msg(d, &req);194190 }195191 } else if (msg[0].len < 2) {192192+ if (msg[0].len < 1) {193193+ ret = -EOPNOTSUPP;194194+ goto err_mutex_unlock;195195+ }196196 /* method 2 - old I2C */197197 req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);198198 req.index = CMD_I2C_RD;···225217 ret = -EOPNOTSUPP;226218 goto err_mutex_unlock;227219 } else if (msg[0].addr == 0x10) {220220+ if (msg[0].len < 1) {221221+ ret = -EOPNOTSUPP;222222+ goto err_mutex_unlock;223223+ }228224 /* method 1 - integrated demod */229225 if (msg[0].buf[0] == 0x00) {226226+ if (msg[0].len < 2) {227227+ ret = -EOPNOTSUPP;228228+ goto err_mutex_unlock;229229+ }230230 /* save demod page for later demod access */231231 dev->page = msg[0].buf[1];232232 ret = 0;···247231 ret = rtl28xxu_ctrl_msg(d, &req);248232 }249233 } else if ((msg[0].len < 23) && (!dev->new_i2c_write)) {234234+ if (msg[0].len < 1) {235235+ ret = -EOPNOTSUPP;236236+ goto err_mutex_unlock;237237+ }250238 /* method 2 - old I2C */251239 req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);252240 req.index = CMD_I2C_WR;
+12
drivers/media/usb/dvb-usb/az6027.c
···988988 /* write/read request */989989 if (i + 1 < num && (msg[i + 1].flags & I2C_M_RD)) {990990 req = 0xB9;991991+ if (msg[i].len < 1) {992992+ i = -EOPNOTSUPP;993993+ break;994994+ }991995 index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff));992996 value = msg[i].addr + (msg[i].len << 8);993997 length = msg[i + 1].len + 6;···1005100110061002 /* demod 16bit addr */10071003 req = 0xBD;10041004+ if (msg[i].len < 1) {10051005+ i = -EOPNOTSUPP;10061006+ break;10071007+ }10081008 index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff));10091009 value = msg[i].addr + (2 << 8);10101010 length = msg[i].len - 2;···10341026 } else {1035102710361028 req = 0xBD;10291029+ if (msg[i].len < 1) {10301030+ i = -EOPNOTSUPP;10311031+ break;10321032+ }10371033 index = msg[i].buf[0] & 0x00FF;10381034 value = msg[i].addr + (1 << 8);10391035 length = msg[i].len - 1;
+4
drivers/media/usb/dvb-usb/digitv.c
···6363 warn("more than 2 i2c messages at a time is not handled yet. TODO.");64646565 for (i = 0; i < num; i++) {6666+ if (msg[i].len < 1) {6767+ i = -EOPNOTSUPP;6868+ break;6969+ }6670 /* write/read request */6771 if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {6872 if (digitv_ctrl_msg(d, USB_READ_COFDM, msg[i].buf[0], NULL, 0,
+1-1
drivers/media/usb/dvb-usb/dw2102.c
···946946 for (i = 0; i < 6; i++) {947947 obuf[1] = 0xf0 + i;948948 if (i2c_transfer(&d->i2c_adap, msg, 2) != 2)949949- break;949949+ return -1;950950 else951951 mac[i] = ibuf[0];952952 }
+1
drivers/media/usb/pvrusb2/Kconfig
···3737 bool "pvrusb2 ATSC/DVB support"3838 default y3939 depends on VIDEO_PVRUSB2 && DVB_CORE4040+ depends on VIDEO_PVRUSB2=m || DVB_CORE=y4041 select DVB_LGDT330X if MEDIA_SUBDRV_AUTOSELECT4142 select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT4243 select DVB_S5H1411 if MEDIA_SUBDRV_AUTOSELECT
+1-2
drivers/media/usb/ttusb-dec/ttusb_dec.c
···15441544 dvb_dmx_release(&dec->demux);15451545 if (dec->fe) {15461546 dvb_unregister_frontend(dec->fe);15471547- if (dec->fe->ops.release)15481548- dec->fe->ops.release(dec->fe);15471547+ dvb_frontend_detach(dec->fe);15491548 }15501549 dvb_unregister_adapter(&dec->adapter);15511550}
+1-1
drivers/net/can/Kconfig
···95959696config CAN_BXCAN9797 tristate "STM32 Basic Extended CAN (bxCAN) devices"9898- depends on OF || ARCH_STM32 || COMPILE_TEST9898+ depends on ARCH_STM32 || COMPILE_TEST9999 depends on HAS_IOMEM100100 select CAN_RX_OFFLOAD101101 help
···276276/* Offset 0x10: Extended Port Control Command */277277#define MV88E6393X_PORT_EPC_CMD 0x10278278#define MV88E6393X_PORT_EPC_CMD_BUSY 0x8000279279-#define MV88E6393X_PORT_EPC_CMD_WRITE 0x0300279279+#define MV88E6393X_PORT_EPC_CMD_WRITE 0x3000280280#define MV88E6393X_PORT_EPC_INDEX_PORT_ETYPE 0x02281281282282/* Offset 0x11: Extended Port Control Data */
+65-18
drivers/net/dsa/rzn1_a5psw.c
···120120 a5psw_port_pattern_set(a5psw, port, A5PSW_PATTERN_MGMTFWD, enable);121121}122122123123+static void a5psw_port_tx_enable(struct a5psw *a5psw, int port, bool enable)124124+{125125+ u32 mask = A5PSW_PORT_ENA_TX(port);126126+ u32 reg = enable ? mask : 0;127127+128128+ /* Even though the port TX is disabled through TXENA bit in the129129+ * PORT_ENA register, it can still send BPDUs. This depends on the tag130130+ * configuration added when sending packets from the CPU port to the131131+ * switch port. Indeed, when using forced forwarding without filtering,132132+ * even disabled ports will be able to send packets that are tagged.133133+ * This allows to implement STP support when ports are in a state where134134+ * forwarding traffic should be stopped but BPDUs should still be sent.135135+ */136136+ a5psw_reg_rmw(a5psw, A5PSW_PORT_ENA, mask, reg);137137+}138138+123139static void a5psw_port_enable_set(struct a5psw *a5psw, int port, bool enable)124140{125141 u32 port_ena = 0;···308292 return 0;309293}310294295295+static void a5psw_port_learning_set(struct a5psw *a5psw, int port, bool learn)296296+{297297+ u32 mask = A5PSW_INPUT_LEARN_DIS(port);298298+ u32 reg = !learn ? mask : 0;299299+300300+ a5psw_reg_rmw(a5psw, A5PSW_INPUT_LEARN, mask, reg);301301+}302302+303303+static void a5psw_port_rx_block_set(struct a5psw *a5psw, int port, bool block)304304+{305305+ u32 mask = A5PSW_INPUT_LEARN_BLOCK(port);306306+ u32 reg = block ? mask : 0;307307+308308+ a5psw_reg_rmw(a5psw, A5PSW_INPUT_LEARN, mask, reg);309309+}310310+311311static void a5psw_flooding_set_resolution(struct a5psw *a5psw, int port,312312 bool set)313313{···338306339307 for (i = 0; i < ARRAY_SIZE(offsets); i++)340308 a5psw_reg_writel(a5psw, offsets[i], a5psw->bridged_ports);309309+}310310+311311+static void a5psw_port_set_standalone(struct a5psw *a5psw, int port,312312+ bool standalone)313313+{314314+ a5psw_port_learning_set(a5psw, port, !standalone);315315+ a5psw_flooding_set_resolution(a5psw, port, !standalone);316316+ a5psw_port_mgmtfwd_set(a5psw, port, standalone);341317}342318343319static int a5psw_port_bridge_join(struct dsa_switch *ds, int port,···363323 }364324365325 a5psw->br_dev = bridge.dev;366366- a5psw_flooding_set_resolution(a5psw, port, true);367367- a5psw_port_mgmtfwd_set(a5psw, port, false);326326+ a5psw_port_set_standalone(a5psw, port, false);368327369328 return 0;370329}···373334{374335 struct a5psw *a5psw = ds->priv;375336376376- a5psw_flooding_set_resolution(a5psw, port, false);377377- a5psw_port_mgmtfwd_set(a5psw, port, true);337337+ a5psw_port_set_standalone(a5psw, port, true);378338379339 /* No more ports bridged */380340 if (a5psw->bridged_ports == BIT(A5PSW_CPU_PORT))···382344383345static void a5psw_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)384346{385385- u32 mask = A5PSW_INPUT_LEARN_DIS(port) | A5PSW_INPUT_LEARN_BLOCK(port);347347+ bool learning_enabled, rx_enabled, tx_enabled;386348 struct a5psw *a5psw = ds->priv;387387- u32 reg = 0;388349389350 switch (state) {390351 case BR_STATE_DISABLED:391352 case BR_STATE_BLOCKING:392392- reg |= A5PSW_INPUT_LEARN_DIS(port);393393- reg |= A5PSW_INPUT_LEARN_BLOCK(port);394394- break;395353 case BR_STATE_LISTENING:396396- reg |= A5PSW_INPUT_LEARN_DIS(port);354354+ rx_enabled = false;355355+ tx_enabled = false;356356+ learning_enabled = false;397357 break;398358 case BR_STATE_LEARNING:399399- reg |= A5PSW_INPUT_LEARN_BLOCK(port);359359+ rx_enabled = false;360360+ tx_enabled = false;361361+ learning_enabled = true;400362 break;401363 case BR_STATE_FORWARDING:402402- default:364364+ rx_enabled = true;365365+ tx_enabled = true;366366+ learning_enabled = true;403367 break;368368+ default:369369+ dev_err(ds->dev, "invalid STP state: %d\n", state);370370+ return;404371 }405372406406- a5psw_reg_rmw(a5psw, A5PSW_INPUT_LEARN, mask, reg);373373+ a5psw_port_learning_set(a5psw, port, learning_enabled);374374+ a5psw_port_rx_block_set(a5psw, port, !rx_enabled);375375+ a5psw_port_tx_enable(a5psw, port, tx_enabled);407376}408377409378static void a5psw_port_fast_age(struct dsa_switch *ds, int port)···718673 }719674720675 /* Configure management port */721721- reg = A5PSW_CPU_PORT | A5PSW_MGMT_CFG_DISCARD;676676+ reg = A5PSW_CPU_PORT | A5PSW_MGMT_CFG_ENABLE;722677 a5psw_reg_writel(a5psw, A5PSW_MGMT_CFG, reg);723678724679 /* Set pattern 0 to forward all frame to mgmt port */···767722 if (dsa_port_is_unused(dp))768723 continue;769724770770- /* Enable egress flooding for CPU port */771771- if (dsa_port_is_cpu(dp))725725+ /* Enable egress flooding and learning for CPU port */726726+ if (dsa_port_is_cpu(dp)) {772727 a5psw_flooding_set_resolution(a5psw, port, true);728728+ a5psw_port_learning_set(a5psw, port, true);729729+ }773730774774- /* Enable management forward only for user ports */731731+ /* Enable standalone mode for user ports */775732 if (dsa_port_is_user(dp))776776- a5psw_port_mgmtfwd_set(a5psw, port, true);733733+ a5psw_port_set_standalone(a5psw, port, true);777734 }778735779736 return 0;
···80538053 /* If it is not PF reset or FLR, the firmware will disable the MAC,80548054 * so it only need to stop phy here.80558055 */80568056- if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) &&80578057- hdev->reset_type != HNAE3_FUNC_RESET &&80588058- hdev->reset_type != HNAE3_FLR_RESET) {80598059- hclge_mac_stop_phy(hdev);80608060- hclge_update_link_status(hdev);80618061- return;80568056+ if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) {80578057+ hclge_pfc_pause_en_cfg(hdev, HCLGE_PFC_TX_RX_DISABLE,80588058+ HCLGE_PFC_DISABLE);80598059+ if (hdev->reset_type != HNAE3_FUNC_RESET &&80608060+ hdev->reset_type != HNAE3_FLR_RESET) {80618061+ hclge_mac_stop_phy(hdev);80628062+ hclge_update_link_status(hdev);80638063+ return;80648064+ }80628065 }8063806680648067 hclge_reset_tqp(handle);
···14361436 * might happen in case reset assertion was made by PF. Yes, this also14371437 * means we might end up waiting bit more even for VF reset.14381438 */14391439- msleep(5000);14391439+ if (hdev->reset_type == HNAE3_VF_FULL_RESET)14401440+ msleep(5000);14411441+ else14421442+ msleep(500);1440144314411444 return 0;14421445}
···932932 if ((first->tx_flags & ICE_TX_FLAGS_HW_VLAN ||933933 first->tx_flags & ICE_TX_FLAGS_HW_OUTER_SINGLE_VLAN) ||934934 skb->priority != TC_PRIO_CONTROL) {935935- first->tx_flags &= ~ICE_TX_FLAGS_VLAN_PR_M;935935+ first->vid &= ~VLAN_PRIO_MASK;936936 /* Mask the lower 3 bits to set the 802.1p priority */937937- first->tx_flags |= (skb->priority & 0x7) <<938938- ICE_TX_FLAGS_VLAN_PR_S;937937+ first->vid |= (skb->priority << VLAN_PRIO_SHIFT) & VLAN_PRIO_MASK;939938 /* if this is not already set it means a VLAN 0 + priority needs940939 * to be offloaded941940 */
+5
drivers/net/ethernet/intel/ice/ice_lib.c
···27452745 goto unroll_vector_base;2746274627472747 ice_vsi_map_rings_to_vectors(vsi);27482748+ vsi->stat_offsets_loaded = false;27492749+27482750 if (ice_is_xdp_ena_vsi(vsi)) {27492751 ret = ice_vsi_determine_xdp_res(vsi);27502752 if (ret)···27952793 ret = ice_vsi_alloc_ring_stats(vsi);27962794 if (ret)27972795 goto unroll_vector_base;27962796+27972797+ vsi->stat_offsets_loaded = false;27982798+27982799 /* Do not exit if configuring RSS had an issue, at least27992800 * receive traffic on first queue. Hence no need to capture28002801 * return value
···186186}187187188188/**189189+ * ice_check_vf_ready_for_reset - check if VF is ready to be reset190190+ * @vf: VF to check if it's ready to be reset191191+ *192192+ * The purpose of this function is to ensure that the VF is not in reset,193193+ * disabled, and is both initialized and active, thus enabling us to safely194194+ * initialize another reset.195195+ */196196+int ice_check_vf_ready_for_reset(struct ice_vf *vf)197197+{198198+ int ret;199199+200200+ ret = ice_check_vf_ready_for_cfg(vf);201201+ if (!ret && !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))202202+ ret = -EAGAIN;203203+204204+ return ret;205205+}206206+207207+/**189208 * ice_trigger_vf_reset - Reset a VF on HW190209 * @vf: pointer to the VF structure191210 * @is_vflr: true if VFLR was issued, false if not
···39553955 ice_vc_notify_vf_link_state(vf);39563956 break;39573957 case VIRTCHNL_OP_RESET_VF:39583958+ clear_bit(ICE_VF_STATE_ACTIVE, vf->vf_states);39583959 ops->reset_vf(vf);39593960 break;39603961 case VIRTCHNL_OP_ADD_ETH_ADDR:
+2-2
drivers/net/ethernet/intel/igb/e1000_mac.c
···426426static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)427427{428428 u32 hash_value, hash_mask;429429- u8 bit_shift = 0;429429+ u8 bit_shift = 1;430430431431 /* Register count multiplied by bits per register */432432 hash_mask = (hw->mac.mta_reg_count * 32) - 1;···434434 /* For a mc_filter_type of 0, bit_shift is the number of left-shifts435435 * where 0xFF would still fall within the hash mask.436436 */437437- while (hash_mask >> bit_shift != 0xFF)437437+ while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)438438 bit_shift++;439439440440 /* The portion of the address that is used for the hash table
···291291 return i2c_transfer_rollball(i2c, msgs, ARRAY_SIZE(msgs));292292}293293294294-static int i2c_mii_read_rollball(struct mii_bus *bus, int phy_id, int reg)294294+static int i2c_mii_read_rollball(struct mii_bus *bus, int phy_id, int devad,295295+ int reg)295296{296297 u8 buf[4], res[6];297298 int bus_addr, ret;···303302 return 0xffff;304303305304 buf[0] = ROLLBALL_DATA_ADDR;306306- buf[1] = (reg >> 16) & 0x1f;305305+ buf[1] = devad;307306 buf[2] = (reg >> 8) & 0xff;308307 buf[3] = reg & 0xff;309308···323322 return val;324323}325324326326-static int i2c_mii_write_rollball(struct mii_bus *bus, int phy_id, int reg,327327- u16 val)325325+static int i2c_mii_write_rollball(struct mii_bus *bus, int phy_id, int devad,326326+ int reg, u16 val)328327{329328 int bus_addr, ret;330329 u8 buf[6];···334333 return 0;335334336335 buf[0] = ROLLBALL_DATA_ADDR;337337- buf[1] = (reg >> 16) & 0x1f;336336+ buf[1] = devad;338337 buf[2] = (reg >> 8) & 0xff;339338 buf[3] = reg & 0xff;340339 buf[4] = val >> 8;···406405 return ERR_PTR(ret);407406 }408407409409- mii->read = i2c_mii_read_rollball;410410- mii->write = i2c_mii_write_rollball;408408+ mii->read_c45 = i2c_mii_read_rollball;409409+ mii->write_c45 = i2c_mii_write_rollball;411410 break;412411 default:413412 mii->read = i2c_mii_read_default_c22;
+1-1
drivers/net/pcs/pcs-xpcs.c
···873873874874 switch (compat->an_mode) {875875 case DW_AN_C73:876876- if (phylink_autoneg_inband(mode)) {876876+ if (test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising)) {877877 ret = xpcs_config_aneg_c73(xpcs, compat);878878 if (ret)879879 return ret;
+21-1
drivers/net/phy/dp83867.c
···4444#define DP83867_STRAP_STS1 0x006E4545#define DP83867_STRAP_STS2 0x006f4646#define DP83867_RGMIIDCTL 0x00864747+#define DP83867_DSP_FFE_CFG 0x012c4748#define DP83867_RXFCFG 0x01344849#define DP83867_RXFPMD1 0x01364950#define DP83867_RXFPMD2 0x0137···942941943942 usleep_range(10, 20);944943945945- return phy_modify(phydev, MII_DP83867_PHYCTRL,944944+ err = phy_modify(phydev, MII_DP83867_PHYCTRL,946945 DP83867_PHYCR_FORCE_LINK_GOOD, 0);946946+ if (err < 0)947947+ return err;948948+949949+ /* Configure the DSP Feedforward Equalizer Configuration register to950950+ * improve short cable (< 1 meter) performance. This will not affect951951+ * long cable performance.952952+ */953953+ err = phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_DSP_FFE_CFG,954954+ 0x0e81);955955+ if (err < 0)956956+ return err;957957+958958+ err = phy_write(phydev, DP83867_CTRL, DP83867_SW_RESTART);959959+ if (err < 0)960960+ return err;961961+962962+ usleep_range(10, 20);963963+964964+ return 0;947965}948966949967static void dp83867_link_change_notify(struct phy_device *phydev)
+4-4
drivers/net/phy/phylink.c
···2225222522262226 ASSERT_RTNL();2227222722282228+ /* Mask out unsupported advertisements */22292229+ linkmode_and(config.advertising, kset->link_modes.advertising,22302230+ pl->supported);22312231+22282232 if (pl->phydev) {22292233 /* We can rely on phylib for this update; we also do not need22302234 * to update the pl->link_config settings:···22522248 }2253224922542250 config = pl->link_config;22552255-22562256- /* Mask out unsupported advertisements */22572257- linkmode_and(config.advertising, kset->link_modes.advertising,22582258- pl->supported);2259225122602252 /* FIXME: should we reject autoneg if phy/mac does not support it? */22612253 switch (kset->base.autoneg) {
+15
drivers/net/tun.c
···19771977 int queue_len;1978197819791979 spin_lock_bh(&queue->lock);19801980+19811981+ if (unlikely(tfile->detached)) {19821982+ spin_unlock_bh(&queue->lock);19831983+ rcu_read_unlock();19841984+ err = -EBUSY;19851985+ goto free_skb;19861986+ }19871987+19801988 __skb_queue_tail(queue, skb);19811989 queue_len = skb_queue_len(queue);19821990 spin_unlock(&queue->lock);···25202512 if (tfile->napi_enabled) {25212513 queue = &tfile->sk.sk_write_queue;25222514 spin_lock(&queue->lock);25152515+25162516+ if (unlikely(tfile->detached)) {25172517+ spin_unlock(&queue->lock);25182518+ kfree_skb(skb);25192519+ return -EBUSY;25202520+ }25212521+25232522 __skb_queue_tail(queue, skb);25242523 spin_unlock(&queue->lock);25252524 ret = 1;
+44-17
drivers/net/virtio_net.c
···18681868 return received;18691869}1870187018711871+static void virtnet_disable_queue_pair(struct virtnet_info *vi, int qp_index)18721872+{18731873+ virtnet_napi_tx_disable(&vi->sq[qp_index].napi);18741874+ napi_disable(&vi->rq[qp_index].napi);18751875+ xdp_rxq_info_unreg(&vi->rq[qp_index].xdp_rxq);18761876+}18771877+18781878+static int virtnet_enable_queue_pair(struct virtnet_info *vi, int qp_index)18791879+{18801880+ struct net_device *dev = vi->dev;18811881+ int err;18821882+18831883+ err = xdp_rxq_info_reg(&vi->rq[qp_index].xdp_rxq, dev, qp_index,18841884+ vi->rq[qp_index].napi.napi_id);18851885+ if (err < 0)18861886+ return err;18871887+18881888+ err = xdp_rxq_info_reg_mem_model(&vi->rq[qp_index].xdp_rxq,18891889+ MEM_TYPE_PAGE_SHARED, NULL);18901890+ if (err < 0)18911891+ goto err_xdp_reg_mem_model;18921892+18931893+ virtnet_napi_enable(vi->rq[qp_index].vq, &vi->rq[qp_index].napi);18941894+ virtnet_napi_tx_enable(vi, vi->sq[qp_index].vq, &vi->sq[qp_index].napi);18951895+18961896+ return 0;18971897+18981898+err_xdp_reg_mem_model:18991899+ xdp_rxq_info_unreg(&vi->rq[qp_index].xdp_rxq);19001900+ return err;19011901+}19021902+18711903static int virtnet_open(struct net_device *dev)18721904{18731905 struct virtnet_info *vi = netdev_priv(dev);···19131881 if (!try_fill_recv(vi, &vi->rq[i], GFP_KERNEL))19141882 schedule_delayed_work(&vi->refill, 0);1915188319161916- err = xdp_rxq_info_reg(&vi->rq[i].xdp_rxq, dev, i, vi->rq[i].napi.napi_id);18841884+ err = virtnet_enable_queue_pair(vi, i);19171885 if (err < 0)19181918- return err;19191919-19201920- err = xdp_rxq_info_reg_mem_model(&vi->rq[i].xdp_rxq,19211921- MEM_TYPE_PAGE_SHARED, NULL);19221922- if (err < 0) {19231923- xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq);19241924- return err;19251925- }19261926-19271927- virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi);19281928- virtnet_napi_tx_enable(vi, vi->sq[i].vq, &vi->sq[i].napi);18861886+ goto err_enable_qp;19291887 }1930188819311889 return 0;18901890+18911891+err_enable_qp:18921892+ disable_delayed_refill(vi);18931893+ cancel_delayed_work_sync(&vi->refill);18941894+18951895+ for (i--; i >= 0; i--)18961896+ virtnet_disable_queue_pair(vi, i);18971897+ return err;19321898}1933189919341900static int virtnet_poll_tx(struct napi_struct *napi, int budget)···23352305 /* Make sure refill_work doesn't re-enable napi! */23362306 cancel_delayed_work_sync(&vi->refill);2337230723382338- for (i = 0; i < vi->max_queue_pairs; i++) {23392339- virtnet_napi_tx_disable(&vi->sq[i].napi);23402340- napi_disable(&vi->rq[i].napi);23412341- xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq);23422342- }23082308+ for (i = 0; i < vi->max_queue_pairs; i++)23092309+ virtnet_disable_queue_pair(vi, i);2343231023442311 return 0;23452312}
···123123 if (mvmvif->link[i]->phy_ctxt)124124 count++;125125126126- /* FIXME: IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM should be127127- * defined per HW128128- */129129- if (count >= IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM)130130- return -EINVAL;126126+ if (vif->type == NL80211_IFTYPE_AP) {127127+ if (count > mvm->fw->ucode_capa.num_beacons)128128+ return -EOPNOTSUPP;129129+ /* this should be per HW or such */130130+ } else if (count >= IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM) {131131+ return -EOPNOTSUPP;132132+ }131133 }132134133135 /* Catch early if driver tries to activate or deactivate a link
+25-30
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
···11// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause22/*33- * Copyright (C) 2012-2014, 2018-2022 Intel Corporation33+ * Copyright (C) 2012-2014, 2018-2023 Intel Corporation44 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH55 * Copyright (C) 2016-2017 Intel Deutschland GmbH66 */···36073607 struct ieee80211_vif *vif,36083608 struct ieee80211_sta *sta)36093609{36103610- unsigned int i;36103610+ struct ieee80211_link_sta *link_sta;36113611+ unsigned int link_id;3611361236123613 /* Beacon interval check - firmware will crash if the beacon36133614 * interval is less than 16. We can't avoid connecting at all,···36173616 * wpa_s will blocklist the AP...36183617 */3619361836203620- for_each_set_bit(i, (unsigned long *)&sta->valid_links,36213621- IEEE80211_MLD_MAX_NUM_LINKS) {36223622- struct ieee80211_link_sta *link_sta =36233623- link_sta_dereference_protected(sta, i);36193619+ for_each_sta_active_link(vif, sta, link_sta, link_id) {36243620 struct ieee80211_bss_conf *link_conf =36253625- link_conf_dereference_protected(vif, i);36213621+ link_conf_dereference_protected(vif, link_id);3626362236273627- if (!link_conf || !link_sta)36233623+ if (!link_conf)36283624 continue;3629362536303626 if (link_conf->beacon_int < IWL_MVM_MIN_BEACON_INTERVAL_TU) {···36433645 bool is_sta)36443646{36453647 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);36463646- unsigned int i;36483648+ struct ieee80211_link_sta *link_sta;36493649+ unsigned int link_id;3647365036483648- for_each_set_bit(i, (unsigned long *)&sta->valid_links,36493649- IEEE80211_MLD_MAX_NUM_LINKS) {36503650- struct ieee80211_link_sta *link_sta =36513651- link_sta_dereference_protected(sta, i);36513651+ for_each_sta_active_link(vif, sta, link_sta, link_id) {36523652 struct ieee80211_bss_conf *link_conf =36533653- link_conf_dereference_protected(vif, i);36533653+ link_conf_dereference_protected(vif, link_id);3654365436553655- if (!link_conf || !link_sta || !mvmvif->link[i])36553655+ if (!link_conf || !mvmvif->link[link_id])36563656 continue;3657365736583658 link_conf->he_support = link_sta->he_cap.has_he;3659365936603660 if (is_sta) {36613661- mvmvif->link[i]->he_ru_2mhz_block = false;36613661+ mvmvif->link[link_id]->he_ru_2mhz_block = false;36623662 if (link_sta->he_cap.has_he)36633663- iwl_mvm_check_he_obss_narrow_bw_ru(hw, vif, i,36633663+ iwl_mvm_check_he_obss_narrow_bw_ru(hw, vif,36643664+ link_id,36643665 link_conf);36653666 }36663667 }···36723675 struct iwl_mvm_sta_state_ops *callbacks)36733676{36743677 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);36783678+ struct ieee80211_link_sta *link_sta;36753679 unsigned int i;36763680 int ret;36773681···36973699 NL80211_TDLS_SETUP);36983700 }3699370137003700- for (i = 0; i < ARRAY_SIZE(sta->link); i++) {37013701- struct ieee80211_link_sta *link_sta;37023702-37033703- link_sta = link_sta_dereference_protected(sta, i);37043704- if (!link_sta)37053705- continue;37063706-37023702+ for_each_sta_active_link(vif, sta, link_sta, i)37073703 link_sta->agg.max_rc_amsdu_len = 1;37083708- }37043704+37093705 ieee80211_sta_recalc_aggregates(sta);3710370637113707 if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)···37173725{37183726 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);37193727 struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);37203720- unsigned int i;37283728+ struct ieee80211_link_sta *link_sta;37293729+ unsigned int link_id;3721373037223731 lockdep_assert_held(&mvm->mutex);37233732···37443751 if (!mvm->mld_api_is_used)37453752 goto out;3746375337473747- for_each_set_bit(i, (unsigned long *)&sta->valid_links,37483748- IEEE80211_MLD_MAX_NUM_LINKS) {37543754+ for_each_sta_active_link(vif, sta, link_sta, link_id) {37493755 struct ieee80211_bss_conf *link_conf =37503750- link_conf_dereference_protected(vif, i);37563756+ link_conf_dereference_protected(vif, link_id);3751375737523758 if (WARN_ON(!link_conf))37533759 return -EINVAL;37543754- if (!mvmvif->link[i])37603760+ if (!mvmvif->link[link_id])37553761 continue;3756376237573763 iwl_mvm_link_changed(mvm, vif, link_conf,···38813889 * from the AP now.38823890 */38833891 iwl_mvm_reset_cca_40mhz_workaround(mvm, vif);38923892+38933893+ /* Also free dup data just in case any assertions below fail */38943894+ kfree(mvm_sta->dup_data);38843895 }3885389638863897 mutex_lock(&mvm->mutex);
···906906 n_active++;907907 }908908909909- if (vif->type == NL80211_IFTYPE_AP &&910910- n_active > mvm->fw->ucode_capa.num_beacons)909909+ if (vif->type == NL80211_IFTYPE_AP) {910910+ if (n_active > mvm->fw->ucode_capa.num_beacons)911911+ return -EOPNOTSUPP;912912+ } else if (n_active > 1) {911913 return -EOPNOTSUPP;912912- else if (n_active > 1)913913- return -EOPNOTSUPP;914914+ }914915 }915916916917 for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
+6-8
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
···667667 ret = iwl_mvm_mld_alloc_sta_links(mvm, vif, sta);668668 if (ret)669669 return ret;670670- }671670672672- spin_lock_init(&mvm_sta->lock);671671+ spin_lock_init(&mvm_sta->lock);673672674674- if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))675675- ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta);676676- else677673 ret = iwl_mvm_sta_init(mvm, vif, sta, IWL_MVM_INVALID_STA,678674 STATION_TYPE_PEER);675675+ } else {676676+ ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta);677677+ }678678+679679 if (ret)680680 goto err;681681···728728 struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);729729 struct ieee80211_link_sta *link_sta;730730 unsigned int link_id;731731- int ret = 0;731731+ int ret = -EINVAL;732732733733 lockdep_assert_held(&mvm->mutex);734734···790790 int ret;791791792792 lockdep_assert_held(&mvm->mutex);793793-794794- kfree(mvm_sta->dup_data);795793796794 /* flush its queues here since we are freeing mvm_sta */797795 for_each_sta_active_link(vif, sta, link_sta, link_id) {
···691691692692 rcu_read_lock();693693 sta = rcu_dereference(buf->mvm->fw_id_to_mac_id[sta_id]);694694+ if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta))) {695695+ rcu_read_unlock();696696+ goto out;697697+ }698698+694699 mvmsta = iwl_mvm_sta_from_mac80211(sta);695700696701 /* SN is set to the last expired frame + 1 */···717712 entries[index].e.reorder_time +718713 1 + RX_REORDER_BUF_TIMEOUT_MQ);719714 }715715+716716+out:720717 spin_unlock(&buf->lock);721718}722719···25192512 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL);25202513 /* Unblock BCAST / MCAST station */25212514 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, false);25222522- cancel_delayed_work_sync(&mvm->cs_tx_unblock_dwork);25152515+ cancel_delayed_work(&mvm->cs_tx_unblock_dwork);25232516 }25242517 }25252518
+9-4
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
···281281 * A-MDPU and hence the timer continues to run. Then, the282282 * timer expires and sta is NULL.283283 */284284- if (!sta)284284+ if (IS_ERR_OR_NULL(sta))285285 goto unlock;286286287287 mvm_sta = iwl_mvm_sta_from_mac80211(sta);···2089208920902090 lockdep_assert_held(&mvm->mutex);2091209120922092- if (iwl_mvm_has_new_rx_api(mvm))20932093- kfree(mvm_sta->dup_data);20942094-20952092 ret = iwl_mvm_drain_sta(mvm, mvm_sta, true);20962093 if (ret)20972094 return ret;···37823785 u8 sta_id = mvmvif->deflink.ap_sta_id;37833786 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id],37843787 lockdep_is_held(&mvm->mutex));37883788+ if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta)))37893789+ return NULL;37903790+37853791 return sta->addr;37863792 }37873793···3822382238233823 if (keyconf->cipher == WLAN_CIPHER_SUITE_TKIP) {38243824 addr = iwl_mvm_get_mac_addr(mvm, vif, sta);38253825+ if (!addr) {38263826+ IWL_ERR(mvm, "Failed to find mac address\n");38273827+ return -EINVAL;38283828+ }38293829+38253830 /* get phase 1 key from mac80211 */38263831 ieee80211_get_key_rx_seq(keyconf, 0, &seq);38273832 ieee80211_get_tkip_rx_p1k(keyconf, addr, seq.tkip.iv32, p1k);
+1-1
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
···18751875 mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id);1876187618771877 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);18781878- if (WARN_ON_ONCE(!sta || !sta->wme)) {18781878+ if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta) || !sta->wme)) {18791879 rcu_read_unlock();18801880 return;18811881 }
···59645964 ret = -ENOMEM;59655965 goto out_free;59665966 }59675967+ param.pmsr_capa = pmsr_capa;59685968+59675969 ret = parse_pmsr_capa(info->attrs[HWSIM_ATTR_PMSR_SUPPORT], pmsr_capa, info);59685970 if (ret)59695971 goto out_free;59705970- param.pmsr_capa = pmsr_capa;59715972 }5972597359735974 ret = mac80211_hwsim_new_radio(info, ¶m);
+21-6
drivers/net/wwan/iosm/iosm_ipc_imem.c
···565565 struct ipc_mux_config mux_cfg;566566 struct iosm_imem *ipc_imem;567567 u8 ctrl_chl_idx = 0;568568+ int ret;568569569570 ipc_imem = container_of(instance, struct iosm_imem, run_state_worker);570571571572 if (ipc_imem->phase != IPC_P_RUN) {572573 dev_err(ipc_imem->dev,573574 "Modem link down. Exit run state worker.");574574- return;575575+ goto err_out;575576 }576577577578 if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))578579 ipc_devlink_deinit(ipc_imem->ipc_devlink);579580580580- if (!ipc_imem_setup_cp_mux_cap_init(ipc_imem, &mux_cfg))581581- ipc_imem->mux = ipc_mux_init(&mux_cfg, ipc_imem);581581+ ret = ipc_imem_setup_cp_mux_cap_init(ipc_imem, &mux_cfg);582582+ if (ret < 0)583583+ goto err_out;582584583583- ipc_imem_wwan_channel_init(ipc_imem, mux_cfg.protocol);584584- if (ipc_imem->mux)585585- ipc_imem->mux->wwan = ipc_imem->wwan;585585+ ipc_imem->mux = ipc_mux_init(&mux_cfg, ipc_imem);586586+ if (!ipc_imem->mux)587587+ goto err_out;588588+589589+ ret = ipc_imem_wwan_channel_init(ipc_imem, mux_cfg.protocol);590590+ if (ret < 0)591591+ goto err_ipc_mux_deinit;592592+593593+ ipc_imem->mux->wwan = ipc_imem->wwan;586594587595 while (ctrl_chl_idx < IPC_MEM_MAX_CHANNELS) {588596 if (!ipc_chnl_cfg_get(&chnl_cfg_port, ctrl_chl_idx)) {···630622631623 /* Complete all memory stores after setting bit */632624 smp_mb__after_atomic();625625+626626+ return;627627+628628+err_ipc_mux_deinit:629629+ ipc_mux_deinit(ipc_imem->mux);630630+err_out:631631+ ipc_uevent_send(ipc_imem->dev, UEVENT_CD_READY_LINK_DOWN);633632}634633635634static void ipc_imem_handle_irq(struct iosm_imem *ipc_imem, int irq)
+8-4
drivers/net/wwan/iosm/iosm_ipc_imem_ops.c
···7777}78787979/* Initialize wwan channel */8080-void ipc_imem_wwan_channel_init(struct iosm_imem *ipc_imem,8181- enum ipc_mux_protocol mux_type)8080+int ipc_imem_wwan_channel_init(struct iosm_imem *ipc_imem,8181+ enum ipc_mux_protocol mux_type)8282{8383 struct ipc_chnl_cfg chnl_cfg = { 0 };8484···8787 /* If modem version is invalid (0xffffffff), do not initialize WWAN. */8888 if (ipc_imem->cp_version == -1) {8989 dev_err(ipc_imem->dev, "invalid CP version");9090- return;9090+ return -EIO;9191 }92929393 ipc_chnl_cfg_get(&chnl_cfg, ipc_imem->nr_of_channels);···104104105105 /* WWAN registration. */106106 ipc_imem->wwan = ipc_wwan_init(ipc_imem, ipc_imem->dev);107107- if (!ipc_imem->wwan)107107+ if (!ipc_imem->wwan) {108108 dev_err(ipc_imem->dev,109109 "failed to register the ipc_wwan interfaces");110110+ return -ENOMEM;111111+ }112112+113113+ return 0;110114}111115112116/* Map SKB to DMA for transfer */
+4-2
drivers/net/wwan/iosm/iosm_ipc_imem_ops.h
···9191 * MUX.9292 * @ipc_imem: Pointer to iosm_imem struct.9393 * @mux_type: Type of mux protocol.9494+ *9595+ * Return: 0 on success and failure value on error9496 */9595-void ipc_imem_wwan_channel_init(struct iosm_imem *ipc_imem,9696- enum ipc_mux_protocol mux_type);9797+int ipc_imem_wwan_channel_init(struct iosm_imem *ipc_imem,9898+ enum ipc_mux_protocol mux_type);979998100/**99101 * ipc_imem_sys_devlink_open - Open a Flash/CD Channel link to CP
···35853585{35863586 struct nvme_ctrl *ctrl = dev_get_drvdata(dev);3587358735883588+ if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags))35893589+ return -EBUSY;35903590+35883591 if (device_remove_file_self(dev, attr))35893592 nvme_delete_ctrl_sync(ctrl);35903593 return count;···50485045 * that were missed. We identify persistent discovery controllers by50495046 * checking that they started once before, hence are reconnecting back.50505047 */50515051- if (test_and_set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags) &&50485048+ if (test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags) &&50525049 nvme_discovery_ctrl(ctrl))50535050 nvme_change_uevent(ctrl, "NVME_EVENT=rediscover");50545051···50595056 }5060505750615058 nvme_change_uevent(ctrl, "NVME_EVENT=connected");50595059+ set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags);50625060}50635061EXPORT_SYMBOL_GPL(nvme_start_ctrl);50645062
+3-1
drivers/nvme/host/hwmon.c
···163163 case hwmon_temp_max:164164 case hwmon_temp_min:165165 if ((!channel && data->ctrl->wctemp) ||166166- (channel && data->log->temp_sensor[channel - 1])) {166166+ (channel && data->log->temp_sensor[channel - 1] &&167167+ !(data->ctrl->quirks &168168+ NVME_QUIRK_NO_SECONDARY_TEMP_THRESH))) {167169 if (data->ctrl->quirks &168170 NVME_QUIRK_NO_TEMP_THRESH_CHANGE)169171 return 0444;
-1
drivers/nvme/host/multipath.c
···884884{885885 if (!head->disk)886886 return;887887- blk_mark_disk_dead(head->disk);888887 /* make sure all pending bios are cleaned up */889888 kblockd_schedule_work(&head->requeue_work);890889 flush_work(&head->requeue_work);
+5
drivers/nvme/host/nvme.h
···149149 * Reports garbage in the namespace identifiers (eui64, nguid, uuid).150150 */151151 NVME_QUIRK_BOGUS_NID = (1 << 18),152152+153153+ /*154154+ * No temperature thresholds for channels other than 0 (Composite).155155+ */156156+ NVME_QUIRK_NO_SECONDARY_TEMP_THRESH = (1 << 19),152157};153158154159/*
···127127 struct dasd_device *, struct dasd_device *,128128 unsigned int, int, unsigned int, unsigned int,129129 unsigned int, unsigned int);130130+static int dasd_eckd_query_pprc_status(struct dasd_device *,131131+ struct dasd_pprc_data_sc4 *);130132131133/* initial attempt at a probe function. this can be simplified once132134 * the other detection code is gone */···37353733 return count;37363734}3737373537363736+static int dasd_in_copy_relation(struct dasd_device *device)37373737+{37383738+ struct dasd_pprc_data_sc4 *temp;37393739+ int rc;37403740+37413741+ if (!dasd_eckd_pprc_enabled(device))37423742+ return 0;37433743+37443744+ temp = kzalloc(sizeof(*temp), GFP_KERNEL);37453745+ if (!temp)37463746+ return -ENOMEM;37473747+37483748+ rc = dasd_eckd_query_pprc_status(device, temp);37493749+ if (!rc)37503750+ rc = temp->dev_info[0].state;37513751+37523752+ kfree(temp);37533753+ return rc;37543754+}37553755+37383756/*37393757 * Release allocated space for a given range or an entire volume.37403758 */···37713749 int cur_to_trk, cur_from_trk;37723750 struct dasd_ccw_req *cqr;37733751 u32 beg_cyl, end_cyl;37523752+ int copy_relation;37743753 struct ccw1 *ccw;37753754 int trks_per_ext;37763755 size_t ras_size;···3782375937833760 if (dasd_eckd_ras_sanity_checks(device, first_trk, last_trk))37843761 return ERR_PTR(-EINVAL);37623762+37633763+ copy_relation = dasd_in_copy_relation(device);37643764+ if (copy_relation < 0)37653765+ return ERR_PTR(copy_relation);3785376637863767 rq = req ? blk_mq_rq_to_pdu(req) : NULL;37873768···38153788 /*38163789 * This bit guarantees initialisation of tracks within an extent that is38173790 * not fully specified, but is only supported with a certain feature38183818- * subset.37913791+ * subset and for devices not in a copy relation.38193792 */38203820- ras_data->op_flags.guarantee_init = !!(features->feature[56] & 0x01);37933793+ if (features->feature[56] & 0x01 && !copy_relation)37943794+ ras_data->op_flags.guarantee_init = 1;37953795+38213796 ras_data->lss = private->conf.ned->ID;38223797 ras_data->dev_addr = private->conf.ned->unit_addr;38233798 ras_data->nr_exts = nr_exts;
···606606 }607607 uart->baud = val;608608609609- port->membase = of_iomap(np, 0);610610- if (!port->membase)609609+ port->membase = devm_platform_ioremap_resource(pdev, 0);610610+ if (IS_ERR(port->membase)) {611611 /* No point of dev_err since UART itself is hosed here */612612- return -ENXIO;612612+ return PTR_ERR(port->membase);613613+ }613614614615 port->irq = irq_of_parse_and_map(np, 0);615616
+4-5
drivers/tty/serial/qcom_geni_serial.c
···16641664 uport->private_data = &port->private_data;16651665 platform_set_drvdata(pdev, port);1666166616671667- ret = uart_add_one_port(drv, uport);16681668- if (ret)16691669- return ret;16701670-16711667 irq_set_status_flags(uport->irq, IRQ_NOAUTOEN);16721668 ret = devm_request_irq(uport->dev, uport->irq, qcom_geni_serial_isr,16731669 IRQF_TRIGGER_HIGH, port->name, uport);16741670 if (ret) {16751671 dev_err(uport->dev, "Failed to get IRQ ret %d\n", ret);16761676- uart_remove_one_port(drv, uport);16771672 return ret;16781673 }16741674+16751675+ ret = uart_add_one_port(drv, uport);16761676+ if (ret)16771677+ return ret;1679167816801679 /*16811680 * Set pm_runtime status as ACTIVE so that wakeup_irq gets
+9-2
drivers/tty/vt/vc_screen.c
···656656 }657657 }658658659659- /* The vcs_size might have changed while we slept to grab660660- * the user buffer, so recheck.659659+ /* The vc might have been freed or vcs_size might have changed660660+ * while we slept to grab the user buffer, so recheck.661661 * Return data written up to now on failure.662662 */663663+ vc = vcs_vc(inode, &viewed);664664+ if (!vc) {665665+ if (written)666666+ break;667667+ ret = -ENXIO;668668+ goto unlock_out;669669+ }663670 size = vcs_size(vc, attr, false);664671 if (size < 0) {665672 if (written)
···11161116 * @dis_metastability_quirk: set to disable metastability quirk.11171117 * @dis_split_quirk: set to disable split boundary.11181118 * @wakeup_configured: set if the device is configured for remote wakeup.11191119+ * @suspended: set to track suspend event due to U3/L2.11191120 * @imod_interval: set the interrupt moderation interval in 250ns11201121 * increments or 0 to disable.11211122 * @max_cfg_eps: current max number of IN eps used across all USB configs.···13331332 unsigned dis_split_quirk:1;13341333 unsigned async_callbacks:1;13351334 unsigned wakeup_configured:1;13351335+ unsigned suspended:1;1336133613371337 u16 imod_interval;13381338
+109
drivers/usb/dwc3/debugfs.c
···332332 unsigned int current_mode;333333 unsigned long flags;334334 u32 reg;335335+ int ret;336336+337337+ ret = pm_runtime_resume_and_get(dwc->dev);338338+ if (ret < 0)339339+ return ret;335340336341 spin_lock_irqsave(&dwc->lock, flags);337342 reg = dwc3_readl(dwc->regs, DWC3_GSTS);···354349 break;355350 }356351 spin_unlock_irqrestore(&dwc->lock, flags);352352+353353+ pm_runtime_put_sync(dwc->dev);357354358355 return 0;359356}···402395 struct dwc3 *dwc = s->private;403396 unsigned long flags;404397 u32 reg;398398+ int ret;399399+400400+ ret = pm_runtime_resume_and_get(dwc->dev);401401+ if (ret < 0)402402+ return ret;405403406404 spin_lock_irqsave(&dwc->lock, flags);407405 reg = dwc3_readl(dwc->regs, DWC3_GCTL);···425413 default:426414 seq_printf(s, "UNKNOWN %08x\n", DWC3_GCTL_PRTCAP(reg));427415 }416416+417417+ pm_runtime_put_sync(dwc->dev);428418429419 return 0;430420}···477463 struct dwc3 *dwc = s->private;478464 unsigned long flags;479465 u32 reg;466466+ int ret;467467+468468+ ret = pm_runtime_resume_and_get(dwc->dev);469469+ if (ret < 0)470470+ return ret;480471481472 spin_lock_irqsave(&dwc->lock, flags);482473 reg = dwc3_readl(dwc->regs, DWC3_DCTL);···512493 seq_printf(s, "UNKNOWN %d\n", reg);513494 }514495496496+ pm_runtime_put_sync(dwc->dev);497497+515498 return 0;516499}517500···530509 unsigned long flags;531510 u32 testmode = 0;532511 char buf[32];512512+ int ret;533513534514 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))535515 return -EFAULT;···548526 else549527 testmode = 0;550528529529+ ret = pm_runtime_resume_and_get(dwc->dev);530530+ if (ret < 0)531531+ return ret;532532+551533 spin_lock_irqsave(&dwc->lock, flags);552534 dwc3_gadget_set_test_mode(dwc, testmode);553535 spin_unlock_irqrestore(&dwc->lock, flags);536536+537537+ pm_runtime_put_sync(dwc->dev);554538555539 return count;556540}···576548 enum dwc3_link_state state;577549 u32 reg;578550 u8 speed;551551+ int ret;552552+553553+ ret = pm_runtime_resume_and_get(dwc->dev);554554+ if (ret < 0)555555+ return ret;579556580557 spin_lock_irqsave(&dwc->lock, flags);581558 reg = dwc3_readl(dwc->regs, DWC3_GSTS);582559 if (DWC3_GSTS_CURMOD(reg) != DWC3_GSTS_CURMOD_DEVICE) {583560 seq_puts(s, "Not available\n");584561 spin_unlock_irqrestore(&dwc->lock, flags);562562+ pm_runtime_put_sync(dwc->dev);585563 return 0;586564 }587565···599565 dwc3_gadget_link_string(state) :600566 dwc3_gadget_hs_link_string(state));601567 spin_unlock_irqrestore(&dwc->lock, flags);568568+569569+ pm_runtime_put_sync(dwc->dev);602570603571 return 0;604572}···620584 char buf[32];621585 u32 reg;622586 u8 speed;587587+ int ret;623588624589 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))625590 return -EFAULT;···640603 else641604 return -EINVAL;642605606606+ ret = pm_runtime_resume_and_get(dwc->dev);607607+ if (ret < 0)608608+ return ret;609609+643610 spin_lock_irqsave(&dwc->lock, flags);644611 reg = dwc3_readl(dwc->regs, DWC3_GSTS);645612 if (DWC3_GSTS_CURMOD(reg) != DWC3_GSTS_CURMOD_DEVICE) {646613 spin_unlock_irqrestore(&dwc->lock, flags);614614+ pm_runtime_put_sync(dwc->dev);647615 return -EINVAL;648616 }649617···658616 if (speed < DWC3_DSTS_SUPERSPEED &&659617 state != DWC3_LINK_STATE_RECOV) {660618 spin_unlock_irqrestore(&dwc->lock, flags);619619+ pm_runtime_put_sync(dwc->dev);661620 return -EINVAL;662621 }663622664623 dwc3_gadget_set_link_state(dwc, state);665624 spin_unlock_irqrestore(&dwc->lock, flags);625625+626626+ pm_runtime_put_sync(dwc->dev);666627667628 return count;668629}···690645 unsigned long flags;691646 u32 mdwidth;692647 u32 val;648648+ int ret;649649+650650+ ret = pm_runtime_resume_and_get(dwc->dev);651651+ if (ret < 0)652652+ return ret;693653694654 spin_lock_irqsave(&dwc->lock, flags);695655 val = dwc3_core_fifo_space(dep, DWC3_TXFIFO);···707657 seq_printf(s, "%u\n", val);708658 spin_unlock_irqrestore(&dwc->lock, flags);709659660660+ pm_runtime_put_sync(dwc->dev);661661+710662 return 0;711663}712664···719667 unsigned long flags;720668 u32 mdwidth;721669 u32 val;670670+ int ret;671671+672672+ ret = pm_runtime_resume_and_get(dwc->dev);673673+ if (ret < 0)674674+ return ret;722675723676 spin_lock_irqsave(&dwc->lock, flags);724677 val = dwc3_core_fifo_space(dep, DWC3_RXFIFO);···736679 seq_printf(s, "%u\n", val);737680 spin_unlock_irqrestore(&dwc->lock, flags);738681682682+ pm_runtime_put_sync(dwc->dev);683683+739684 return 0;740685}741686···747688 struct dwc3 *dwc = dep->dwc;748689 unsigned long flags;749690 u32 val;691691+ int ret;692692+693693+ ret = pm_runtime_resume_and_get(dwc->dev);694694+ if (ret < 0)695695+ return ret;750696751697 spin_lock_irqsave(&dwc->lock, flags);752698 val = dwc3_core_fifo_space(dep, DWC3_TXREQQ);753699 seq_printf(s, "%u\n", val);754700 spin_unlock_irqrestore(&dwc->lock, flags);701701+702702+ pm_runtime_put_sync(dwc->dev);755703756704 return 0;757705}···769703 struct dwc3 *dwc = dep->dwc;770704 unsigned long flags;771705 u32 val;706706+ int ret;707707+708708+ ret = pm_runtime_resume_and_get(dwc->dev);709709+ if (ret < 0)710710+ return ret;772711773712 spin_lock_irqsave(&dwc->lock, flags);774713 val = dwc3_core_fifo_space(dep, DWC3_RXREQQ);775714 seq_printf(s, "%u\n", val);776715 spin_unlock_irqrestore(&dwc->lock, flags);716716+717717+ pm_runtime_put_sync(dwc->dev);777718778719 return 0;779720}···791718 struct dwc3 *dwc = dep->dwc;792719 unsigned long flags;793720 u32 val;721721+ int ret;722722+723723+ ret = pm_runtime_resume_and_get(dwc->dev);724724+ if (ret < 0)725725+ return ret;794726795727 spin_lock_irqsave(&dwc->lock, flags);796728 val = dwc3_core_fifo_space(dep, DWC3_RXINFOQ);797729 seq_printf(s, "%u\n", val);798730 spin_unlock_irqrestore(&dwc->lock, flags);731731+732732+ pm_runtime_put_sync(dwc->dev);799733800734 return 0;801735}···813733 struct dwc3 *dwc = dep->dwc;814734 unsigned long flags;815735 u32 val;736736+ int ret;737737+738738+ ret = pm_runtime_resume_and_get(dwc->dev);739739+ if (ret < 0)740740+ return ret;816741817742 spin_lock_irqsave(&dwc->lock, flags);818743 val = dwc3_core_fifo_space(dep, DWC3_DESCFETCHQ);819744 seq_printf(s, "%u\n", val);820745 spin_unlock_irqrestore(&dwc->lock, flags);746746+747747+ pm_runtime_put_sync(dwc->dev);821748822749 return 0;823750}···835748 struct dwc3 *dwc = dep->dwc;836749 unsigned long flags;837750 u32 val;751751+ int ret;752752+753753+ ret = pm_runtime_resume_and_get(dwc->dev);754754+ if (ret < 0)755755+ return ret;838756839757 spin_lock_irqsave(&dwc->lock, flags);840758 val = dwc3_core_fifo_space(dep, DWC3_EVENTQ);841759 seq_printf(s, "%u\n", val);842760 spin_unlock_irqrestore(&dwc->lock, flags);761761+762762+ pm_runtime_put_sync(dwc->dev);843763844764 return 0;845765}···892798 struct dwc3 *dwc = dep->dwc;893799 unsigned long flags;894800 int i;801801+ int ret;802802+803803+ ret = pm_runtime_resume_and_get(dwc->dev);804804+ if (ret < 0)805805+ return ret;895806896807 spin_lock_irqsave(&dwc->lock, flags);897808 if (dep->number <= 1) {···926827out:927828 spin_unlock_irqrestore(&dwc->lock, flags);928829830830+ pm_runtime_put_sync(dwc->dev);831831+929832 return 0;930833}931834···940839 u32 lower_32_bits;941840 u32 upper_32_bits;942841 u32 reg;842842+ int ret;843843+844844+ ret = pm_runtime_resume_and_get(dwc->dev);845845+ if (ret < 0)846846+ return ret;943847944848 spin_lock_irqsave(&dwc->lock, flags);945849 reg = DWC3_GDBGLSPMUX_EPSELECT(dep->number);···956850 ep_info = ((u64)upper_32_bits << 32) | lower_32_bits;957851 seq_printf(s, "0x%016llx\n", ep_info);958852 spin_unlock_irqrestore(&dwc->lock, flags);853853+854854+ pm_runtime_put_sync(dwc->dev);959855960856 return 0;961857}···1018910 dwc->regset->regs = dwc3_regs;1019911 dwc->regset->nregs = ARRAY_SIZE(dwc3_regs);1020912 dwc->regset->base = dwc->regs - DWC3_GLOBALS_REGS_START;913913+ dwc->regset->dev = dwc->dev;10219141022915 root = debugfs_create_dir(dev_name(dwc->dev), usb_debug_root);1023916 dwc->debug_root = root;
+45-34
drivers/usb/dwc3/gadget.c
···24402440 return -EINVAL;24412441 }24422442 dwc3_resume_gadget(dwc);24432443+ dwc->suspended = false;24432444 dwc->link_state = DWC3_LINK_STATE_U0;24442445 }24452446···27002699 return ret;27012700}2702270127022702+static int dwc3_gadget_soft_connect(struct dwc3 *dwc)27032703+{27042704+ /*27052705+ * In the Synopsys DWC_usb31 1.90a programming guide section27062706+ * 4.1.9, it specifies that for a reconnect after a27072707+ * device-initiated disconnect requires a core soft reset27082708+ * (DCTL.CSftRst) before enabling the run/stop bit.27092709+ */27102710+ dwc3_core_soft_reset(dwc);27112711+27122712+ dwc3_event_buffers_setup(dwc);27132713+ __dwc3_gadget_start(dwc);27142714+ return dwc3_gadget_run_stop(dwc, true);27152715+}27162716+27032717static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)27042718{27052719 struct dwc3 *dwc = gadget_to_dwc(g);···2753273727542738 synchronize_irq(dwc->irq_gadget);2755273927562756- if (!is_on) {27402740+ if (!is_on)27572741 ret = dwc3_gadget_soft_disconnect(dwc);27582758- } else {27592759- /*27602760- * In the Synopsys DWC_usb31 1.90a programming guide section27612761- * 4.1.9, it specifies that for a reconnect after a27622762- * device-initiated disconnect requires a core soft reset27632763- * (DCTL.CSftRst) before enabling the run/stop bit.27642764- */27652765- dwc3_core_soft_reset(dwc);27662766-27672767- dwc3_event_buffers_setup(dwc);27682768- __dwc3_gadget_start(dwc);27692769- ret = dwc3_gadget_run_stop(dwc, true);27702770- }27422742+ else27432743+ ret = dwc3_gadget_soft_connect(dwc);2771274427722745 pm_runtime_put(dwc->dev);27732746···39433938{39443939 int reg;3945394039413941+ dwc->suspended = false;39423942+39463943 dwc3_gadget_set_link_state(dwc, DWC3_LINK_STATE_RX_DET);3947394439483945 reg = dwc3_readl(dwc->regs, DWC3_DCTL);···39683961static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)39693962{39703963 u32 reg;39643964+39653965+ dwc->suspended = false;3971396639723967 /*39733968 * Ideally, dwc3_reset_gadget() would trigger the function···4189418041904181static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc, unsigned int evtinfo)41914182{41834183+ dwc->suspended = false;41844184+41924185 /*41934186 * TODO take core out of low power mode when that's41944187 * implemented.···42884277 if (dwc->gadget->wakeup_armed) {42894278 dwc3_gadget_enable_linksts_evts(dwc, false);42904279 dwc3_resume_gadget(dwc);42804280+ dwc->suspended = false;42914281 }42924282 break;42934283 case DWC3_LINK_STATE_U1:···43154303{43164304 enum dwc3_link_state next = evtinfo & DWC3_LINK_STATE_MASK;4317430543184318- if (dwc->link_state != next && next == DWC3_LINK_STATE_U3)43064306+ if (!dwc->suspended && next == DWC3_LINK_STATE_U3) {43074307+ dwc->suspended = true;43194308 dwc3_suspend_gadget(dwc);43094309+ }4320431043214311 dwc->link_state = next;43224312}···46694655int dwc3_gadget_suspend(struct dwc3 *dwc)46704656{46714657 unsigned long flags;46584658+ int ret;4672465946734660 if (!dwc->gadget_driver)46744661 return 0;4675466246764676- dwc3_gadget_run_stop(dwc, false);46634663+ ret = dwc3_gadget_soft_disconnect(dwc);46644664+ if (ret)46654665+ goto err;4677466646784667 spin_lock_irqsave(&dwc->lock, flags);46794668 dwc3_disconnect_gadget(dwc);46804680- __dwc3_gadget_stop(dwc);46814669 spin_unlock_irqrestore(&dwc->lock, flags);4682467046834671 return 0;46724672+46734673+err:46744674+ /*46754675+ * Attempt to reset the controller's state. Likely no46764676+ * communication can be established until the host46774677+ * performs a port reset.46784678+ */46794679+ if (dwc->softconnect)46804680+ dwc3_gadget_soft_connect(dwc);46814681+46824682+ return ret;46844683}4685468446864685int dwc3_gadget_resume(struct dwc3 *dwc)46874686{46884688- int ret;46894689-46904687 if (!dwc->gadget_driver || !dwc->softconnect)46914688 return 0;4692468946934693- ret = __dwc3_gadget_start(dwc);46944694- if (ret < 0)46954695- goto err0;46964696-46974697- ret = dwc3_gadget_run_stop(dwc, true);46984698- if (ret < 0)46994699- goto err1;47004700-47014701- return 0;47024702-47034703-err1:47044704- __dwc3_gadget_stop(dwc);47054705-47064706-err0:47074707- return ret;46904690+ return dwc3_gadget_soft_connect(dwc);47084691}4709469247104693void dwc3_gadget_process_pending_events(struct dwc3 *dwc)
···3737 * @vbus: for udcs who care about vbus status, this value is real vbus status;3838 * for udcs who do not care about vbus status, this value is always true3939 * @started: the UDC's started state. True if the UDC had started.4040- * @connect_lock: protects udc->vbus, udc->started, gadget->connect, gadget->deactivate related4141- * functions. usb_gadget_connect_locked, usb_gadget_disconnect_locked,4242- * usb_udc_connect_control_locked, usb_gadget_udc_start_locked, usb_gadget_udc_stop_locked are4343- * called with this lock held.4440 *4541 * This represents the internal data structure which is used by the UDC-class4642 * to hold information about udc driver and gadget together.···4852 struct list_head list;4953 bool vbus;5054 bool started;5151- struct mutex connect_lock;5255};53565457static struct class *udc_class;···687692}688693EXPORT_SYMBOL_GPL(usb_gadget_vbus_disconnect);689694690690-/* Internal version of usb_gadget_connect needs to be called with connect_lock held. */691691-static int usb_gadget_connect_locked(struct usb_gadget *gadget)692692- __must_hold(&gadget->udc->connect_lock)695695+/**696696+ * usb_gadget_connect - software-controlled connect to USB host697697+ * @gadget:the peripheral being connected698698+ *699699+ * Enables the D+ (or potentially D-) pullup. The host will start700700+ * enumerating this gadget when the pullup is active and a VBUS session701701+ * is active (the link is powered).702702+ *703703+ * Returns zero on success, else negative errno.704704+ */705705+int usb_gadget_connect(struct usb_gadget *gadget)693706{694707 int ret = 0;695708···706703 goto out;707704 }708705709709- if (gadget->connected)710710- goto out;711711-712712- if (gadget->deactivated || !gadget->udc->started) {706706+ if (gadget->deactivated) {713707 /*714708 * If gadget is deactivated we only save new state.715709 * Gadget will be connected automatically after activation.716716- *717717- * udc first needs to be started before gadget can be pulled up.718710 */719711 gadget->connected = true;720712 goto out;···724726725727 return ret;726728}727727-728728-/**729729- * usb_gadget_connect - software-controlled connect to USB host730730- * @gadget:the peripheral being connected731731- *732732- * Enables the D+ (or potentially D-) pullup. The host will start733733- * enumerating this gadget when the pullup is active and a VBUS session734734- * is active (the link is powered).735735- *736736- * Returns zero on success, else negative errno.737737- */738738-int usb_gadget_connect(struct usb_gadget *gadget)739739-{740740- int ret;741741-742742- mutex_lock(&gadget->udc->connect_lock);743743- ret = usb_gadget_connect_locked(gadget);744744- mutex_unlock(&gadget->udc->connect_lock);745745-746746- return ret;747747-}748729EXPORT_SYMBOL_GPL(usb_gadget_connect);749749-750750-/* Internal version of usb_gadget_disconnect needs to be called with connect_lock held. */751751-static int usb_gadget_disconnect_locked(struct usb_gadget *gadget)752752- __must_hold(&gadget->udc->connect_lock)753753-{754754- int ret = 0;755755-756756- if (!gadget->ops->pullup) {757757- ret = -EOPNOTSUPP;758758- goto out;759759- }760760-761761- if (!gadget->connected)762762- goto out;763763-764764- if (gadget->deactivated || !gadget->udc->started) {765765- /*766766- * If gadget is deactivated we only save new state.767767- * Gadget will stay disconnected after activation.768768- *769769- * udc should have been started before gadget being pulled down.770770- */771771- gadget->connected = false;772772- goto out;773773- }774774-775775- ret = gadget->ops->pullup(gadget, 0);776776- if (!ret)777777- gadget->connected = 0;778778-779779- mutex_lock(&udc_lock);780780- if (gadget->udc->driver)781781- gadget->udc->driver->disconnect(gadget);782782- mutex_unlock(&udc_lock);783783-784784-out:785785- trace_usb_gadget_disconnect(gadget, ret);786786-787787- return ret;788788-}789730790731/**791732 * usb_gadget_disconnect - software-controlled disconnect from USB host···741804 */742805int usb_gadget_disconnect(struct usb_gadget *gadget)743806{744744- int ret;807807+ int ret = 0;745808746746- mutex_lock(&gadget->udc->connect_lock);747747- ret = usb_gadget_disconnect_locked(gadget);748748- mutex_unlock(&gadget->udc->connect_lock);809809+ if (!gadget->ops->pullup) {810810+ ret = -EOPNOTSUPP;811811+ goto out;812812+ }813813+814814+ if (!gadget->connected)815815+ goto out;816816+817817+ if (gadget->deactivated) {818818+ /*819819+ * If gadget is deactivated we only save new state.820820+ * Gadget will stay disconnected after activation.821821+ */822822+ gadget->connected = false;823823+ goto out;824824+ }825825+826826+ ret = gadget->ops->pullup(gadget, 0);827827+ if (!ret)828828+ gadget->connected = 0;829829+830830+ mutex_lock(&udc_lock);831831+ if (gadget->udc->driver)832832+ gadget->udc->driver->disconnect(gadget);833833+ mutex_unlock(&udc_lock);834834+835835+out:836836+ trace_usb_gadget_disconnect(gadget, ret);749837750838 return ret;751839}···794832 if (gadget->deactivated)795833 goto out;796834797797- mutex_lock(&gadget->udc->connect_lock);798835 if (gadget->connected) {799799- ret = usb_gadget_disconnect_locked(gadget);836836+ ret = usb_gadget_disconnect(gadget);800837 if (ret)801801- goto unlock;838838+ goto out;802839803840 /*804841 * If gadget was being connected before deactivation, we want···807846 }808847 gadget->deactivated = true;809848810810-unlock:811811- mutex_unlock(&gadget->udc->connect_lock);812849out:813850 trace_usb_gadget_deactivate(gadget, ret);814851···830871 if (!gadget->deactivated)831872 goto out;832873833833- mutex_lock(&gadget->udc->connect_lock);834874 gadget->deactivated = false;835875836876 /*···837879 * while it was being deactivated, we call usb_gadget_connect().838880 */839881 if (gadget->connected)840840- ret = usb_gadget_connect_locked(gadget);841841- mutex_unlock(&gadget->udc->connect_lock);882882+ ret = usb_gadget_connect(gadget);842883843884out:844885 trace_usb_gadget_activate(gadget, ret);···1078112110791122/* ------------------------------------------------------------------------- */1080112310811081-/* Acquire connect_lock before calling this function. */10821082-static void usb_udc_connect_control_locked(struct usb_udc *udc) __must_hold(&udc->connect_lock)11241124+static void usb_udc_connect_control(struct usb_udc *udc)10831125{10841084- if (udc->vbus && udc->started)10851085- usb_gadget_connect_locked(udc->gadget);11261126+ if (udc->vbus)11271127+ usb_gadget_connect(udc->gadget);10861128 else10871087- usb_gadget_disconnect_locked(udc->gadget);11291129+ usb_gadget_disconnect(udc->gadget);10881130}1089113110901132/**···10991143{11001144 struct usb_udc *udc = gadget->udc;1101114511021102- mutex_lock(&udc->connect_lock);11031146 if (udc) {11041147 udc->vbus = status;11051105- usb_udc_connect_control_locked(udc);11481148+ usb_udc_connect_control(udc);11061149 }11071107- mutex_unlock(&udc->connect_lock);11081150}11091151EXPORT_SYMBOL_GPL(usb_udc_vbus_handler);11101152···11241170EXPORT_SYMBOL_GPL(usb_gadget_udc_reset);1125117111261172/**11271127- * usb_gadget_udc_start_locked - tells usb device controller to start up11731173+ * usb_gadget_udc_start - tells usb device controller to start up11281174 * @udc: The UDC to be started11291175 *11301176 * This call is issued by the UDC Class driver when it's about···11351181 * necessary to have it powered on.11361182 *11371183 * Returns zero on success, else negative errno.11381138- *11391139- * Caller should acquire connect_lock before invoking this function.11401184 */11411141-static inline int usb_gadget_udc_start_locked(struct usb_udc *udc)11421142- __must_hold(&udc->connect_lock)11851185+static inline int usb_gadget_udc_start(struct usb_udc *udc)11431186{11441187 int ret;11451188···11531202}1154120311551204/**11561156- * usb_gadget_udc_stop_locked - tells usb device controller we don't need it anymore12051205+ * usb_gadget_udc_stop - tells usb device controller we don't need it anymore11571206 * @udc: The UDC to be stopped11581207 *11591208 * This call is issued by the UDC Class driver after calling···11621211 * The details are implementation specific, but it can go as11631212 * far as powering off UDC completely and disable its data11641213 * line pullups.11651165- *11661166- * Caller should acquire connect lock before invoking this function.11671214 */11681168-static inline void usb_gadget_udc_stop_locked(struct usb_udc *udc)11691169- __must_hold(&udc->connect_lock)12151215+static inline void usb_gadget_udc_stop(struct usb_udc *udc)11701216{11711217 if (!udc->started) {11721218 dev_err(&udc->dev, "UDC had already stopped\n");···1322137413231375 udc->gadget = gadget;13241376 gadget->udc = udc;13251325- mutex_init(&udc->connect_lock);1326137713271378 udc->started = false;13281379···15231576 if (ret)15241577 goto err_bind;1525157815261526- mutex_lock(&udc->connect_lock);15271527- ret = usb_gadget_udc_start_locked(udc);15281528- if (ret) {15291529- mutex_unlock(&udc->connect_lock);15791579+ ret = usb_gadget_udc_start(udc);15801580+ if (ret)15301581 goto err_start;15311531- }15321582 usb_gadget_enable_async_callbacks(udc);15331533- usb_udc_connect_control_locked(udc);15341534- mutex_unlock(&udc->connect_lock);15831583+ usb_udc_connect_control(udc);1535158415361585 kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);15371586 return 0;···1558161515591616 kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);1560161715611561- mutex_lock(&udc->connect_lock);15621562- usb_gadget_disconnect_locked(gadget);16181618+ usb_gadget_disconnect(gadget);15631619 usb_gadget_disable_async_callbacks(udc);15641620 if (gadget->irq)15651621 synchronize_irq(gadget->irq);15661622 udc->driver->unbind(gadget);15671567- usb_gadget_udc_stop_locked(udc);15681568- mutex_unlock(&udc->connect_lock);16231623+ usb_gadget_udc_stop(udc);1569162415701625 mutex_lock(&udc_lock);15711626 driver->is_bound = false;···16491708 }1650170916511710 if (sysfs_streq(buf, "connect")) {16521652- mutex_lock(&udc->connect_lock);16531653- usb_gadget_udc_start_locked(udc);16541654- usb_gadget_connect_locked(udc->gadget);16551655- mutex_unlock(&udc->connect_lock);17111711+ usb_gadget_udc_start(udc);17121712+ usb_gadget_connect(udc->gadget);16561713 } else if (sysfs_streq(buf, "disconnect")) {16571657- mutex_lock(&udc->connect_lock);16581658- usb_gadget_disconnect_locked(udc->gadget);16591659- usb_gadget_udc_stop_locked(udc);16601660- mutex_unlock(&udc->connect_lock);17141714+ usb_gadget_disconnect(udc->gadget);17151715+ usb_gadget_udc_stop(udc);16611716 } else {16621717 dev_err(dev, "unsupported command '%s'\n", buf);16631718 ret = -EINVAL;
+6-4
drivers/usb/host/uhci-pci.c
···119119120120 uhci->rh_numports = uhci_count_ports(hcd);121121122122- /* Intel controllers report the OverCurrent bit active on.123123- * VIA controllers report it active off, so we'll adjust the124124- * bit value. (It's not standardized in the UHCI spec.)122122+ /*123123+ * Intel controllers report the OverCurrent bit active on. VIA124124+ * and ZHAOXIN controllers report it active off, so we'll adjust125125+ * the bit value. (It's not standardized in the UHCI spec.)125126 */126126- if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA)127127+ if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA ||128128+ to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN)127129 uhci->oc_low = 1;128130129131 /* HP's server management chip requires a longer port reset delay. */
+10-2
drivers/usb/host/xhci-pci.c
···1313#include <linux/module.h>1414#include <linux/acpi.h>1515#include <linux/reset.h>1616+#include <linux/suspend.h>16171718#include "xhci.h"1819#include "xhci-trace.h"···388387389388 if (pdev->vendor == PCI_VENDOR_ID_AMD &&390389 pdev->device == PCI_DEVICE_ID_AMD_RENOIR_XHCI)391391- xhci->quirks |= XHCI_BROKEN_D3COLD;390390+ xhci->quirks |= XHCI_BROKEN_D3COLD_S2I;392391393392 if (pdev->vendor == PCI_VENDOR_ID_INTEL) {394393 xhci->quirks |= XHCI_LPM_SUPPORT;···802801 * Systems with the TI redriver that loses port status change events803802 * need to have the registers polled during D3, so avoid D3cold.804803 */805805- if (xhci->quirks & (XHCI_COMP_MODE_QUIRK | XHCI_BROKEN_D3COLD))804804+ if (xhci->quirks & XHCI_COMP_MODE_QUIRK)806805 pci_d3cold_disable(pdev);806806+807807+#ifdef CONFIG_SUSPEND808808+ /* d3cold is broken, but only when s2idle is used */809809+ if (pm_suspend_target_state == PM_SUSPEND_TO_IDLE &&810810+ xhci->quirks & (XHCI_BROKEN_D3COLD_S2I))811811+ pci_d3cold_disable(pdev);812812+#endif807813808814 if (xhci->quirks & XHCI_PME_STUCK_QUIRK)809815 xhci_pme_quirk(hcd);
+28-1
drivers/usb/host/xhci-ring.c
···276276 trace_xhci_inc_enq(ring);277277}278278279279+static int xhci_num_trbs_to(struct xhci_segment *start_seg, union xhci_trb *start,280280+ struct xhci_segment *end_seg, union xhci_trb *end,281281+ unsigned int num_segs)282282+{283283+ union xhci_trb *last_on_seg;284284+ int num = 0;285285+ int i = 0;286286+287287+ do {288288+ if (start_seg == end_seg && end >= start)289289+ return num + (end - start);290290+ last_on_seg = &start_seg->trbs[TRBS_PER_SEGMENT - 1];291291+ num += last_on_seg - start;292292+ start_seg = start_seg->next;293293+ start = start_seg->trbs;294294+ } while (i++ <= num_segs);295295+296296+ return -EINVAL;297297+}298298+279299/*280300 * Check to see if there's room to enqueue num_trbs on the ring and make sure281301 * enqueue pointer will not advance into dequeue segment. See rules above.···21602140 u32 trb_comp_code)21612141{21622142 struct xhci_ep_ctx *ep_ctx;21432143+ int trbs_freed;2163214421642145 ep_ctx = xhci_get_ep_ctx(xhci, ep->vdev->out_ctx, ep->ep_index);21652146···22302209 }2231221022322211 /* Update ring dequeue pointer */22122212+ trbs_freed = xhci_num_trbs_to(ep_ring->deq_seg, ep_ring->dequeue,22132213+ td->last_trb_seg, td->last_trb,22142214+ ep_ring->num_segs);22152215+ if (trbs_freed < 0)22162216+ xhci_dbg(xhci, "Failed to count freed trbs at TD finish\n");22172217+ else22182218+ ep_ring->num_trbs_free += trbs_freed;22332219 ep_ring->dequeue = td->last_trb;22342220 ep_ring->deq_seg = td->last_trb_seg;22352235- ep_ring->num_trbs_free += td->num_trbs - 1;22362221 inc_deq(xhci, ep_ring);2237222222382223 return xhci_td_cleanup(xhci, td, ep_ring, td->status);
···406406 ***********************************************************************/407407408408/* Command timeout and abort */409409-static int command_abort(struct scsi_cmnd *srb)409409+static int command_abort_matching(struct us_data *us, struct scsi_cmnd *srb_match)410410{411411- struct us_data *us = host_to_us(srb->device->host);412412-413413- usb_stor_dbg(us, "%s called\n", __func__);414414-415411 /*416412 * us->srb together with the TIMED_OUT, RESETTING, and ABORTING417413 * bits are protected by the host lock.418414 */419415 scsi_lock(us_to_host(us));420416421421- /* Is this command still active? */422422- if (us->srb != srb) {417417+ /* is there any active pending command to abort ? */418418+ if (!us->srb) {423419 scsi_unlock(us_to_host(us));424420 usb_stor_dbg(us, "-- nothing to abort\n");421421+ return SUCCESS;422422+ }423423+424424+ /* Does the command match the passed srb if any ? */425425+ if (srb_match && us->srb != srb_match) {426426+ scsi_unlock(us_to_host(us));427427+ usb_stor_dbg(us, "-- pending command mismatch\n");425428 return FAILED;426429 }427430···447444 return SUCCESS;448445}449446447447+static int command_abort(struct scsi_cmnd *srb)448448+{449449+ struct us_data *us = host_to_us(srb->device->host);450450+451451+ usb_stor_dbg(us, "%s called\n", __func__);452452+ return command_abort_matching(us, srb);453453+}454454+450455/*451456 * This invokes the transport reset mechanism to reset the state of the452457 * device···465454 int result;466455467456 usb_stor_dbg(us, "%s called\n", __func__);457457+458458+ /* abort any pending command before reset */459459+ command_abort_matching(us, NULL);468460469461 /* lock the device pointers and do the reset */470462 mutex_lock(&(us->dev_mutex));
+4
drivers/usb/typec/altmodes/displayport.c
···516516517517 mutex_unlock(&dp->lock);518518519519+ /* get_current_pin_assignments can return 0 when no matching pin assignments are found */520520+ if (len == 0)521521+ len++;522522+519523 buf[len - 1] = '\n';520524 return len;521525}
···124124 depends on FB125125 help126126 Allow generic frame-buffer to provide get_fb_unmapped_area127127- function.127127+ function to provide shareable character device support on nommu.128128129129menuconfig FB_FOREIGN_ENDIAN130130 bool "Framebuffer foreign endianness support"
-5
drivers/video/fbdev/aty/atyfb_base.c
···34983498 if (ret)34993499 goto atyfb_setup_generic_fail;35003500#endif35013501- if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))35023502- par->clk_wr_offset = (inb(R_GENMO) & 0x0CU) >> 2;35033503- else35043504- par->clk_wr_offset = aty_ld_8(CLOCK_CNTL, par) & 0x03U;35053505-35063501 /* according to ATI, we should use clock 3 for acelerated mode */35073502 par->clk_wr_offset = 3;35083503
+1-1
drivers/video/fbdev/core/fbmem.c
···14681468}1469146914701470#if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU)14711471-unsigned long get_fb_unmapped_area(struct file *filp,14711471+static unsigned long get_fb_unmapped_area(struct file *filp,14721472 unsigned long addr, unsigned long len,14731473 unsigned long pgoff, unsigned long flags)14741474{
···491491492492 ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");493493 if (IS_ERR(ddata->vcc_reg)) {494494- r = dev_err_probe(&spi->dev, r, "failed to get LCD VCC regulator\n");494494+ r = dev_err_probe(&spi->dev, PTR_ERR(ddata->vcc_reg),495495+ "failed to get LCD VCC regulator\n");495496 goto err_regulator;496497 }497498
···11111111 continue;11121112 adjust_snap_realm_parent(mdsc, child, realm->ino);11131113 }11141114+ } else {11151115+ /*11161116+ * In the non-split case both 'num_split_inos' and11171117+ * 'num_split_realms' should be 0, making this a no-op.11181118+ * However the MDS happens to populate 'split_realms' list11191119+ * in one of the UPDATE op cases by mistake.11201120+ *11211121+ * Skip both lists just in case to ensure that 'p' is11221122+ * positioned at the start of realm info, as expected by11231123+ * ceph_update_snap_trace().11241124+ */11251125+ p += sizeof(u64) * num_split_inos;11261126+ p += sizeof(u64) * num_split_realms;11141127 }1115112811161129 /*
···48814881 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);48824882 struct TCP_Server_Info *server = tcon->ses->server;48834883 int rc = 0;48844884- bool purge_cache = false;48854885- struct cifs_deferred_close *dclose;48864886- bool is_deferred = false;48844884+ bool purge_cache = false, oplock_break_cancelled;48854885+ __u64 persistent_fid, volatile_fid;48864886+ __u16 net_fid;4887488748884888 wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS,48894889 TASK_UNINTERRUPTIBLE);···49244924 * file handles but cached, then schedule deferred close immediately.49254925 * So, new open will not use cached handle.49264926 */49274927- spin_lock(&CIFS_I(inode)->deferred_lock);49284928- is_deferred = cifs_is_deferred_close(cfile, &dclose);49294929- spin_unlock(&CIFS_I(inode)->deferred_lock);4930492749314931- if (!CIFS_CACHE_HANDLE(cinode) && is_deferred &&49324932- cfile->deferred_close_scheduled && delayed_work_pending(&cfile->deferred)) {49284928+ if (!CIFS_CACHE_HANDLE(cinode) && !list_empty(&cinode->deferred_closes))49334929 cifs_close_deferred_file(cinode);49344934- }4935493049314931+ persistent_fid = cfile->fid.persistent_fid;49324932+ volatile_fid = cfile->fid.volatile_fid;49334933+ net_fid = cfile->fid.netfid;49344934+ oplock_break_cancelled = cfile->oplock_break_cancelled;49354935+49364936+ _cifsFileInfo_put(cfile, false /* do not wait for ourself */, false);49364937 /*49374938 * releasing stale oplock after recent reconnect of smb session using49384939 * a now incorrect file handle is not a data integrity issue but do49394940 * not bother sending an oplock release if session to server still is49404941 * disconnected since oplock already released by the server49414942 */49424942- if (!cfile->oplock_break_cancelled) {49434943- rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid,49444944- cinode);49434943+ if (!oplock_break_cancelled) {49444944+ rc = tcon->ses->server->ops->oplock_response(tcon, persistent_fid,49454945+ volatile_fid, net_fid, cinode);49454946 cifs_dbg(FYI, "Oplock release rc = %d\n", rc);49464947 }4947494849484948- _cifsFileInfo_put(cfile, false /* do not wait for ourself */, false);49494949 cifs_done_oplock_break(cinode);49504950}49514951
···351351 break;352352353353 /* 4 for rfc1002 length field */354354- size = pdu_size + 4;354354+ /* 1 for implied bcc[0] */355355+ size = pdu_size + 4 + 1;355356 conn->request_buf = kvmalloc(size, GFP_KERNEL);356357 if (!conn->request_buf)357358 break;
+3-2
fs/ksmbd/oplock.c
···14491449 * smb2_find_context_vals() - find a particular context info in open request14501450 * @open_req: buffer containing smb2 file open(create) request14511451 * @tag: context name to search for14521452+ * @tag_len: the length of tag14521453 *14531454 * Return: pointer to requested context, NULL if @str context not found14541455 * or error pointer if name length is invalid.14551456 */14561456-struct create_context *smb2_find_context_vals(void *open_req, const char *tag)14571457+struct create_context *smb2_find_context_vals(void *open_req, const char *tag, int tag_len)14571458{14581459 struct create_context *cc;14591460 unsigned int next = 0;···14931492 return ERR_PTR(-EINVAL);1494149314951494 name = (char *)cc + name_off;14961496- if (memcmp(name, tag, name_len) == 0)14951495+ if (name_len == tag_len && !memcmp(name, tag, name_len))14971496 return cc;1498149714991498 remain_len -= next;
···416416417417 /*418418 * Allow a message that padded to 8byte boundary.419419+ * Linux 4.19.217 with smb 3.0.2 are sometimes420420+ * sending messages where the cls_len is exactly421421+ * 8 bytes less than len.419422 */420420- if (clc_len < len && (len - clc_len) < 8)423423+ if (clc_len < len && (len - clc_len) <= 8)421424 goto validate_credit;422425423426 pr_err_ratelimited(
···917917 struct nilfs_transaction_info ti;918918 struct super_block *sb = inode->i_sb;919919 struct nilfs_inode_info *ii = NILFS_I(inode);920920+ struct the_nilfs *nilfs;920921 int ret;921922922923 if (inode->i_nlink || !ii->i_root || unlikely(is_bad_inode(inode))) {···929928 nilfs_transaction_begin(sb, &ti, 0); /* never fails */930929931930 truncate_inode_pages_final(&inode->i_data);931931+932932+ nilfs = sb->s_fs_info;933933+ if (unlikely(sb_rdonly(sb) || !nilfs->ns_writer)) {934934+ /*935935+ * If this inode is about to be disposed after the file system936936+ * has been degraded to read-only due to file system corruption937937+ * or after the writer has been detached, do not make any938938+ * changes that cause writes, just clear it.939939+ * Do this check after read-locking ns_segctor_sem by940940+ * nilfs_transaction_begin() in order to avoid a race with941941+ * the writer detach operation.942942+ */943943+ clear_inode(inode);944944+ nilfs_clear_inode(inode);945945+ nilfs_transaction_abort(sb);946946+ return;947947+ }932948933949 /* TODO: some of the following operations may fail. */934950 nilfs_truncate_bmap(ii, 0);
···13761376 BLK_UID_NAA = 3,13771377};1378137813791379-#define NFL4_UFLG_MASK 0x0000003F13801380-13811379struct block_device_operations {13821380 void (*submit_bio)(struct bio *bio);13831381 int (*poll_bio)(struct bio *bio, struct io_comp_batch *iob,
+2-3
include/linux/compiler.h
···1212 * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code1313 * to disable branch tracing on a per file basis.1414 */1515-#if defined(CONFIG_TRACE_BRANCH_PROFILING) \1616- && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)1715void ftrace_likely_update(struct ftrace_likely_data *f, int val,1816 int expect, int is_constant);1919-1717+#if defined(CONFIG_TRACE_BRANCH_PROFILING) \1818+ && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)2019#define likely_notrace(x) __builtin_expect(!!(x), 1)2120#define unlikely_notrace(x) __builtin_expect(!!(x), 0)2221
···443443 * @bcd_webusb_version: 0x0100 by default, WebUSB specification version444444 * @b_webusb_vendor_code: 0x0 by default, vendor code for WebUSB445445 * @landing_page: empty by default, landing page to announce in WebUSB446446- * @use_webusb:: false by default, interested gadgets set it446446+ * @use_webusb: false by default, interested gadgets set it447447 * @os_desc_config: the configuration to be used with OS descriptors448448 * @setup_pending: true when setup request is queued but not completed449449 * @os_desc_pending: true when os_desc request is queued but not completed
+5-1
include/media/dvb_frontend.h
···686686 * @id: Frontend ID687687 * @exit: Used to inform the DVB core that the frontend688688 * thread should exit (usually, means that the hardware689689- * got disconnected.689689+ * got disconnected).690690+ * @remove_mutex: mutex that avoids a race condition between a callback691691+ * called when the hardware is disconnected and the692692+ * file_operations of dvb_frontend.690693 */691694692695struct dvb_frontend {···707704 int (*callback)(void *adapter_priv, int component, int cmd, int arg);708705 int id;709706 unsigned int exit;707707+ struct mutex remove_mutex;710708};711709712710/**
+4
include/media/dvb_net.h
···3939 * @exit: flag to indicate when the device is being removed.4040 * @demux: pointer to &struct dmx_demux.4141 * @ioctl_mutex: protect access to this struct.4242+ * @remove_mutex: mutex that avoids a race condition between a callback4343+ * called when the hardware is disconnected and the4444+ * file_operations of dvb_net.4245 *4346 * Currently, the core supports up to %DVB_NET_DEVICES_MAX (10) network4447 * devices.···5451 unsigned int exit:1;5552 struct dmx_demux *demux;5653 struct mutex ioctl_mutex;5454+ struct mutex remove_mutex;5755};58565957/**
+15
include/media/dvbdev.h
···194194};195195196196/**197197+ * struct dvbdevfops_node - fops nodes registered in dvbdevfops_list198198+ *199199+ * @fops: Dynamically allocated fops for ->owner registration200200+ * @type: type of dvb_device201201+ * @template: dvb_device used for registration202202+ * @list_head: list_head for dvbdevfops_list203203+ */204204+struct dvbdevfops_node {205205+ struct file_operations *fops;206206+ enum dvb_device_type type;207207+ const struct dvb_device *template;208208+ struct list_head list_head;209209+};210210+211211+/**197212 * dvb_device_get - Increase dvb_device reference198213 *199214 * @dvbdev: pointer to struct dvb_device
-23
include/net/nexthop.h
···497497 return NULL;498498}499499500500-/* Variant of nexthop_fib6_nh().501501- * Caller should either hold rcu_read_lock(), or RTNL.502502- */503503-static inline struct fib6_nh *nexthop_fib6_nh_bh(struct nexthop *nh)504504-{505505- struct nh_info *nhi;506506-507507- if (nh->is_group) {508508- struct nh_group *nh_grp;509509-510510- nh_grp = rcu_dereference_rtnl(nh->nh_grp);511511- nh = nexthop_mpath_select(nh_grp, 0);512512- if (!nh)513513- return NULL;514514- }515515-516516- nhi = rcu_dereference_rtnl(nh->nh_info);517517- if (nhi->family == AF_INET6)518518- return &nhi->fib6_nh;519519-520520- return NULL;521521-}522522-523500static inline struct net_device *fib6_info_nh_dev(struct fib6_info *f6i)524501{525502 struct fib6_nh *fib6_nh;
+14
include/sound/hda-mlink.h
···44444545int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num);46464747+int hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,4848+ int channel_mask, int stream_id, int dir);4949+4750void hda_bus_ml_put_all(struct hdac_bus *bus);4851void hda_bus_ml_reset_losidv(struct hdac_bus *bus);4952int hda_bus_ml_resume(struct hdac_bus *bus);···54515552struct hdac_ext_link *hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus);5653struct hdac_ext_link *hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus);5454+struct hdac_ext_link *hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus);57555856struct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid);5957···148144static inline int149145hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; }150146147147+static inline int148148+hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,149149+ int channel_mask, int stream_id, int dir)150150+{151151+ return 0;152152+}153153+151154static inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }152155static inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }153156static inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }···165154166155static inline struct hdac_ext_link *167156hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus) { return NULL; }157157+158158+static inline struct hdac_ext_link *159159+hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus) { return NULL; }168160169161static inline struct mutex *170162hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; }
···1717struct fprobe_rethook_node {1818 struct rethook_node node;1919 unsigned long entry_ip;2020+ unsigned long entry_parent_ip;2021 char data[];2122};22232323-static void fprobe_handler(unsigned long ip, unsigned long parent_ip,2424- struct ftrace_ops *ops, struct ftrace_regs *fregs)2424+static inline void __fprobe_handler(unsigned long ip, unsigned long parent_ip,2525+ struct ftrace_ops *ops, struct ftrace_regs *fregs)2526{2627 struct fprobe_rethook_node *fpr;2728 struct rethook_node *rh = NULL;2829 struct fprobe *fp;2930 void *entry_data = NULL;3030- int bit, ret;3131+ int ret = 0;31323233 fp = container_of(ops, struct fprobe, ops);3333- if (fprobe_disabled(fp))3434- return;3535-3636- bit = ftrace_test_recursion_trylock(ip, parent_ip);3737- if (bit < 0) {3838- fp->nmissed++;3939- return;4040- }41344235 if (fp->exit_handler) {4336 rh = rethook_try_get(fp->rethook);4437 if (!rh) {4538 fp->nmissed++;4646- goto out;3939+ return;4740 }4841 fpr = container_of(rh, struct fprobe_rethook_node, node);4942 fpr->entry_ip = ip;4343+ fpr->entry_parent_ip = parent_ip;5044 if (fp->entry_data_size)5145 entry_data = fpr->data;5246 }···5561 else5662 rethook_hook(rh, ftrace_get_regs(fregs), true);5763 }5858-out:6464+}6565+6666+static void fprobe_handler(unsigned long ip, unsigned long parent_ip,6767+ struct ftrace_ops *ops, struct ftrace_regs *fregs)6868+{6969+ struct fprobe *fp;7070+ int bit;7171+7272+ fp = container_of(ops, struct fprobe, ops);7373+ if (fprobe_disabled(fp))7474+ return;7575+7676+ /* recursion detection has to go before any traceable function and7777+ * all functions before this point should be marked as notrace7878+ */7979+ bit = ftrace_test_recursion_trylock(ip, parent_ip);8080+ if (bit < 0) {8181+ fp->nmissed++;8282+ return;8383+ }8484+ __fprobe_handler(ip, parent_ip, ops, fregs);5985 ftrace_test_recursion_unlock(bit);8686+6087}6188NOKPROBE_SYMBOL(fprobe_handler);62896390static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip,6491 struct ftrace_ops *ops, struct ftrace_regs *fregs)6592{6666- struct fprobe *fp = container_of(ops, struct fprobe, ops);9393+ struct fprobe *fp;9494+ int bit;9595+9696+ fp = container_of(ops, struct fprobe, ops);9797+ if (fprobe_disabled(fp))9898+ return;9999+100100+ /* recursion detection has to go before any traceable function and101101+ * all functions called before this point should be marked as notrace102102+ */103103+ bit = ftrace_test_recursion_trylock(ip, parent_ip);104104+ if (bit < 0) {105105+ fp->nmissed++;106106+ return;107107+ }6710868109 if (unlikely(kprobe_running())) {69110 fp->nmissed++;70111 return;71112 }113113+72114 kprobe_busy_begin();7373- fprobe_handler(ip, parent_ip, ops, fregs);115115+ __fprobe_handler(ip, parent_ip, ops, fregs);74116 kprobe_busy_end();117117+ ftrace_test_recursion_unlock(bit);75118}7611977120static void fprobe_exit_handler(struct rethook_node *rh, void *data,···11685{11786 struct fprobe *fp = (struct fprobe *)data;11887 struct fprobe_rethook_node *fpr;8888+ int bit;1198912090 if (!fp || fprobe_disabled(fp))12191 return;1229212393 fpr = container_of(rh, struct fprobe_rethook_node, node);124949595+ /*9696+ * we need to assure no calls to traceable functions in-between the9797+ * end of fprobe_handler and the beginning of fprobe_exit_handler.9898+ */9999+ bit = ftrace_test_recursion_trylock(fpr->entry_ip, fpr->entry_parent_ip);100100+ if (bit < 0) {101101+ fp->nmissed++;102102+ return;103103+ }104104+125105 fp->exit_handler(fp, fpr->entry_ip, regs,126106 fp->entry_data_size ? (void *)fpr->data : NULL);107107+ ftrace_test_recursion_unlock(bit);127108}128109NOKPROBE_SYMBOL(fprobe_exit_handler);129110
+2-2
kernel/trace/rethook.c
···288288 * These loops must be protected from rethook_free_rcu() because those289289 * are accessing 'rhn->rethook'.290290 */291291- preempt_disable();291291+ preempt_disable_notrace();292292293293 /*294294 * Run the handler on the shadow stack. Do not unlink the list here because···321321 first = first->next;322322 rethook_recycle(rhn);323323 }324324- preempt_enable();324324+ preempt_enable_notrace();325325326326 return correct_ret_addr;327327}
···2929 * canary of every 8 bytes is the same. 64-bit memory can be filled and checked3030 * at a time instead of byte by byte to improve performance.3131 */3232-#define KFENCE_CANARY_PATTERN_U64 ((u64)0xaaaaaaaaaaaaaaaa ^ (u64)(0x0706050403020100))3232+#define KFENCE_CANARY_PATTERN_U64 ((u64)0xaaaaaaaaaaaaaaaa ^ (u64)(le64_to_cpu(0x0706050403020100)))33333434/* Maximum stack depth for reports. */3535#define KFENCE_STACK_DEPTH 64
···13311331 obj_to_location(obj, &page, &obj_idx);13321332 zspage = get_zspage(page);1333133313341334-#ifdef CONFIG_ZPOOL13351335- /*13361336- * Move the zspage to front of pool's LRU.13371337- *13381338- * Note that this is swap-specific, so by definition there are no ongoing13391339- * accesses to the memory while the page is swapped out that would make13401340- * it "hot". A new entry is hot, then ages to the tail until it gets either13411341- * written back or swaps back in.13421342- *13431343- * Furthermore, map is also called during writeback. We must not put an13441344- * isolated page on the LRU mid-reclaim.13451345- *13461346- * As a result, only update the LRU when the page is mapped for write13471347- * when it's first instantiated.13481348- *13491349- * This is a deviation from the other backends, which perform this update13501350- * in the allocation function (zbud_alloc, z3fold_alloc).13511351- */13521352- if (mm == ZS_MM_WO) {13531353- if (!list_empty(&zspage->lru))13541354- list_del(&zspage->lru);13551355- list_add(&zspage->lru, &pool->lru);13561356- }13571357-#endif13581358-13591334 /*13601335 * migration cannot move any zpages in this zspage. Here, pool->lock13611336 * is too heavy since callers would take some time until they calls···15001525 fix_fullness_group(class, zspage);15011526 record_obj(handle, obj);15021527 class_stat_inc(class, ZS_OBJS_INUSE, 1);15031503- spin_unlock(&pool->lock);1504152815051505- return handle;15291529+ goto out;15061530 }1507153115081532 spin_unlock(&pool->lock);···1524155015251551 /* We completely set up zspage so mark them as movable */15261552 SetZsPageMovable(pool, zspage);15531553+out:15541554+#ifdef CONFIG_ZPOOL15551555+ /* Add/move zspage to beginning of LRU */15561556+ if (!list_empty(&zspage->lru))15571557+ list_del(&zspage->lru);15581558+ list_add(&zspage->lru, &pool->lru);15591559+#endif15601560+15271561 spin_unlock(&pool->lock);1528156215291563 return handle;
+16
mm/zswap.c
···10201020 goto fail;1021102110221022 case ZSWAP_SWAPCACHE_NEW: /* page is locked */10231023+ /*10241024+ * Having a local reference to the zswap entry doesn't exclude10251025+ * swapping from invalidating and recycling the swap slot. Once10261026+ * the swapcache is secured against concurrent swapping to and10271027+ * from the slot, recheck that the entry is still current before10281028+ * writing.10291029+ */10301030+ spin_lock(&tree->lock);10311031+ if (zswap_rb_search(&tree->rbroot, entry->offset) != entry) {10321032+ spin_unlock(&tree->lock);10331033+ delete_from_swap_cache(page_folio(page));10341034+ ret = -ENOMEM;10351035+ goto fail;10361036+ }10371037+ spin_unlock(&tree->lock);10381038+10231039 /* decompress */10241040 acomp_ctx = raw_cpu_ptr(entry->pool->acomp_ctx);10251041 dlen = PAGE_SIZE;
+2-2
net/8021q/vlan_dev.c
···109109 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING110110 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...111111 */112112- if (veth->h_vlan_proto != vlan->vlan_proto ||113113- vlan->flags & VLAN_FLAG_REORDER_HDR) {112112+ if (vlan->flags & VLAN_FLAG_REORDER_HDR ||113113+ veth->h_vlan_proto != vlan->vlan_proto) {114114 u16 vlan_tci;115115 vlan_tci = vlan->vlan_id;116116 vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb->priority);
···639639640640 ret = write_bytes_to_xdr_buf(buf, offset, data, len);641641642642+#if IS_ENABLED(CONFIG_KUNIT)643643+ /*644644+ * CBC-CTS does not define an output IV but RFC 3962 defines it as the645645+ * penultimate block of ciphertext, so copy that into the IV buffer646646+ * before returning.647647+ */648648+ if (encrypt)649649+ memcpy(iv, data, crypto_sync_skcipher_ivsize(cipher));650650+#endif651651+642652out:643653 kfree(data);644654 return ret;
···121121#endif122122123123/**124124- * svc_tcp_release_rqst - Release transport-related resources125125- * @rqstp: request structure with resources to be released124124+ * svc_tcp_release_ctxt - Release transport-related resources125125+ * @xprt: the transport which owned the context126126+ * @ctxt: the context from rqstp->rq_xprt_ctxt or dr->xprt_ctxt126127 *127128 */128128-static void svc_tcp_release_rqst(struct svc_rqst *rqstp)129129+static void svc_tcp_release_ctxt(struct svc_xprt *xprt, void *ctxt)129130{130131}131132132133/**133133- * svc_udp_release_rqst - Release transport-related resources134134- * @rqstp: request structure with resources to be released134134+ * svc_udp_release_ctxt - Release transport-related resources135135+ * @xprt: the transport which owned the context136136+ * @ctxt: the context from rqstp->rq_xprt_ctxt or dr->xprt_ctxt135137 *136138 */137137-static void svc_udp_release_rqst(struct svc_rqst *rqstp)139139+static void svc_udp_release_ctxt(struct svc_xprt *xprt, void *ctxt)138140{139139- struct sk_buff *skb = rqstp->rq_xprt_ctxt;141141+ struct sk_buff *skb = ctxt;140142141141- if (skb) {142142- rqstp->rq_xprt_ctxt = NULL;143143+ if (skb)143144 consume_skb(skb);144144- }145145}146146147147union svc_pktinfo_u {···696696 unsigned int sent;697697 int err;698698699699- svc_udp_release_rqst(rqstp);699699+ svc_udp_release_ctxt(xprt, rqstp->rq_xprt_ctxt);700700+ rqstp->rq_xprt_ctxt = NULL;700701701702 svc_set_cmsg_data(rqstp, cmh);702703···769768 .xpo_recvfrom = svc_udp_recvfrom,770769 .xpo_sendto = svc_udp_sendto,771770 .xpo_result_payload = svc_sock_result_payload,772772- .xpo_release_rqst = svc_udp_release_rqst,771771+ .xpo_release_ctxt = svc_udp_release_ctxt,773772 .xpo_detach = svc_sock_detach,774773 .xpo_free = svc_sock_free,775774 .xpo_has_wspace = svc_udp_has_wspace,···896895 trace_svcsock_accept_err(xprt, serv->sv_name, err);897896 return NULL;898897 }898898+ if (IS_ERR(sock_alloc_file(newsock, O_NONBLOCK, NULL)))899899+ return NULL;900900+899901 set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags);900902901903 err = kernel_getpeername(newsock, sin);···939935 return &newsvsk->sk_xprt;940936941937failed:942942- sock_release(newsock);938938+ sockfd_put(newsock);943939 return NULL;944940}945941···13021298 unsigned int sent;13031299 int err;1304130013051305- svc_tcp_release_rqst(rqstp);13011301+ svc_tcp_release_ctxt(xprt, rqstp->rq_xprt_ctxt);13021302+ rqstp->rq_xprt_ctxt = NULL;1306130313071304 atomic_inc(&svsk->sk_sendqlen);13081305 mutex_lock(&xprt->xpt_mutex);···13481343 .xpo_recvfrom = svc_tcp_recvfrom,13491344 .xpo_sendto = svc_tcp_sendto,13501345 .xpo_result_payload = svc_sock_result_payload,13511351- .xpo_release_rqst = svc_tcp_release_rqst,13461346+ .xpo_release_ctxt = svc_tcp_release_ctxt,13521347 .xpo_detach = svc_tcp_sock_detach,13531348 .xpo_free = svc_sock_free,13541349 .xpo_has_wspace = svc_tcp_has_wspace,···14351430 struct socket *sock,14361431 int flags)14371432{14381438- struct file *filp = NULL;14391433 struct svc_sock *svsk;14401434 struct sock *inet;14411435 int pmap_register = !(flags & SVC_SOCK_ANONYMOUS);···14421438 svsk = kzalloc(sizeof(*svsk), GFP_KERNEL);14431439 if (!svsk)14441440 return ERR_PTR(-ENOMEM);14451445-14461446- if (!sock->file) {14471447- filp = sock_alloc_file(sock, O_NONBLOCK, NULL);14481448- if (IS_ERR(filp)) {14491449- kfree(svsk);14501450- return ERR_CAST(filp);14511451- }14521452- }1453144114541442 inet = sock->sk;14551443···14521456 inet->sk_protocol,14531457 ntohs(inet_sk(inet)->inet_sport));14541458 if (err < 0) {14551455- if (filp)14561456- fput(filp);14571459 kfree(svsk);14581460 return ERR_PTR(err);14591461 }
+5-6
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
···239239}240240241241/**242242- * svc_rdma_release_rqst - Release transport-specific per-rqst resources243243- * @rqstp: svc_rqst being released242242+ * svc_rdma_release_ctxt - Release transport-specific per-rqst resources243243+ * @xprt: the transport which owned the context244244+ * @vctxt: the context from rqstp->rq_xprt_ctxt or dr->xprt_ctxt244245 *245246 * Ensure that the recv_ctxt is released whether or not a Reply246247 * was sent. For example, the client could close the connection,247248 * or svc_process could drop an RPC, before the Reply is sent.248249 */249249-void svc_rdma_release_rqst(struct svc_rqst *rqstp)250250+void svc_rdma_release_ctxt(struct svc_xprt *xprt, void *vctxt)250251{251251- struct svc_rdma_recv_ctxt *ctxt = rqstp->rq_xprt_ctxt;252252- struct svc_xprt *xprt = rqstp->rq_xprt;252252+ struct svc_rdma_recv_ctxt *ctxt = vctxt;253253 struct svcxprt_rdma *rdma =254254 container_of(xprt, struct svcxprt_rdma, sc_xprt);255255256256- rqstp->rq_xprt_ctxt = NULL;257256 if (ctxt)258257 svc_rdma_recv_ctxt_put(rdma, ctxt);259258}
···541541 return mtu;542542}543543544544+int tipc_bearer_min_mtu(struct net *net, u32 bearer_id)545545+{546546+ int mtu = TIPC_MIN_BEARER_MTU;547547+ struct tipc_bearer *b;548548+549549+ rcu_read_lock();550550+ b = bearer_get(net, bearer_id);551551+ if (b)552552+ mtu += b->encap_hlen;553553+ rcu_read_unlock();554554+ return mtu;555555+}556556+544557/* tipc_bearer_xmit_skb - sends buffer to destination over bearer545558 */546559void tipc_bearer_xmit_skb(struct net *net, u32 bearer_id,···11511138 return -EINVAL;11521139 }11531140#ifdef CONFIG_TIPC_MEDIA_UDP11541154- if (tipc_udp_mtu_bad(nla_get_u3211551155- (props[TIPC_NLA_PROP_MTU]))) {11411141+ if (nla_get_u32(props[TIPC_NLA_PROP_MTU]) <11421142+ b->encap_hlen + TIPC_MIN_BEARER_MTU) {11561143 NL_SET_ERR_MSG(info->extack,11571144 "MTU value is out-of-range");11581145 return -EINVAL;
+3
net/tipc/bearer.h
···146146 * @identity: array index of this bearer within TIPC bearer array147147 * @disc: ptr to link setup request148148 * @net_plane: network plane ('A' through 'H') currently associated with bearer149149+ * @encap_hlen: encap headers length149150 * @up: bearer up flag (bit 0)150151 * @refcnt: tipc_bearer reference counter151152 *···171170 u32 identity;172171 struct tipc_discoverer *disc;173172 char net_plane;173173+ u16 encap_hlen;174174 unsigned long up;175175 refcount_t refcnt;176176};···234232void tipc_bearer_cleanup(void);235233void tipc_bearer_stop(struct net *net);236234int tipc_bearer_mtu(struct net *net, u32 bearer_id);235235+int tipc_bearer_min_mtu(struct net *net, u32 bearer_id);237236bool tipc_bearer_bcast_support(struct net *net, u32 bearer_id);238237void tipc_bearer_xmit_skb(struct net *net, u32 bearer_id,239238 struct sk_buff *skb,
+6-3
net/tipc/link.c
···22002200 struct tipc_msg *hdr = buf_msg(skb);22012201 struct tipc_gap_ack_blks *ga = NULL;22022202 bool reply = msg_probe(hdr), retransmitted = false;22032203- u32 dlen = msg_data_sz(hdr), glen = 0;22032203+ u32 dlen = msg_data_sz(hdr), glen = 0, msg_max;22042204 u16 peers_snd_nxt = msg_next_sent(hdr);22052205 u16 peers_tol = msg_link_tolerance(hdr);22062206 u16 peers_prio = msg_linkprio(hdr);···22392239 switch (mtyp) {22402240 case RESET_MSG:22412241 case ACTIVATE_MSG:22422242+ msg_max = msg_max_pkt(hdr);22432243+ if (msg_max < tipc_bearer_min_mtu(l->net, l->bearer_id))22442244+ break;22422245 /* Complete own link name with peer's interface name */22432246 if_name = strrchr(l->name, ':') + 1;22442247 if (sizeof(l->name) - (if_name - l->name) <= TIPC_MAX_IF_NAME)···22862283 l->peer_session = msg_session(hdr);22872284 l->in_session = true;22882285 l->peer_bearer_id = msg_bearer_id(hdr);22892289- if (l->mtu > msg_max_pkt(hdr))22902290- l->mtu = msg_max_pkt(hdr);22862286+ if (l->mtu > msg_max)22872287+ l->mtu = msg_max;22912288 break;2292228922932290 case STATE_MSG:
···438438 /* should we prevent DSP entering D3 ? */439439 if (!sdev->ipc_dump_printed)440440 dev_info(sdev->dev,441441- "preventing DSP entering D3 state to preserve context\n");442442- pm_runtime_get_noresume(sdev->dev);441441+ "Attempting to prevent DSP from entering D3 state to preserve context\n");442442+ pm_runtime_get_if_in_use(sdev->dev);443443 }444444445445 /* dump vital information to the logs */
+87-9
sound/soc/sof/intel/hda-mlink.c
···19192020#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_MLINK)21212222+/* worst-case number of sublinks is used for sublink refcount array allocation only */2323+#define HDAML_MAX_SUBLINKS (AZX_ML_LCTL_CPA_SHIFT - AZX_ML_LCTL_SPA_SHIFT)2424+2225/**2326 * struct hdac_ext2_link - HDAudio extended+alternate link2427 *···3633 * @leptr: extended link pointer3734 * @eml_lock: mutual exclusion to access shared registers e.g. CPA/SPA bits3835 * in LCTL register3636+ * @sublink_ref_count: array of refcounts, required to power-manage sublinks independently3937 * @base_ptr: pointer to shim/ip/shim_vs space4038 * @instance_offset: offset between each of @slcount instances managed by link4139 * @shim_offset: offset to SHIM register base···5753 u32 leptr;58545955 struct mutex eml_lock; /* prevent concurrent access to e.g. CPA/SPA */5656+ int sublink_ref_count[HDAML_MAX_SUBLINKS];60576158 /* internal values computed from LCAP contents */6259 void __iomem *base_ptr;···7368#define AZX_REG_SDW_SHIM_OFFSET 0x07469#define AZX_REG_SDW_IP_OFFSET 0x1007570#define AZX_REG_SDW_VS_SHIM_OFFSET 0x60007171+#define AZX_REG_SDW_SHIM_PCMSyCM(y) (0x16 + 0x4 * (y))76727773/* only one instance supported */7874#define AZX_REG_INTEL_DMIC_SHIM_OFFSET 0x0···9791 */98929993static int hdaml_lnk_enum(struct device *dev, struct hdac_ext2_link *h2link,100100- void __iomem *ml_addr, int link_idx)9494+ void __iomem *remap_addr, void __iomem *ml_addr, int link_idx)10195{10296 struct hdac_ext_link *hlink = &h2link->hext_link;10397 u32 base_offset;···132126 link_idx, h2link->slcount);133127134128 /* find IP ID and offsets */135135- h2link->leptr = readl(hlink->ml_addr + AZX_REG_ML_LEPTR);129129+ h2link->leptr = readl(ml_addr + AZX_REG_ML_LEPTR);136130137131 h2link->elid = FIELD_GET(AZX_REG_ML_LEPTR_ID, h2link->leptr);138132139133 base_offset = FIELD_GET(AZX_REG_ML_LEPTR_PTR, h2link->leptr);140140- h2link->base_ptr = hlink->ml_addr + base_offset;134134+ h2link->base_ptr = remap_addr + base_offset;141135142136 switch (h2link->elid) {143137 case AZX_REG_ML_LEPTR_ID_SDW:138138+ h2link->instance_offset = AZX_REG_SDW_INSTANCE_OFFSET;144139 h2link->shim_offset = AZX_REG_SDW_SHIM_OFFSET;145140 h2link->ip_offset = AZX_REG_SDW_IP_OFFSET;146141 h2link->shim_vs_offset = AZX_REG_SDW_VS_SHIM_OFFSET;···156149 link_idx, base_offset);157150 break;158151 case AZX_REG_ML_LEPTR_ID_INTEL_SSP:152152+ h2link->instance_offset = AZX_REG_INTEL_SSP_INSTANCE_OFFSET;159153 h2link->shim_offset = AZX_REG_INTEL_SSP_SHIM_OFFSET;160154 h2link->ip_offset = AZX_REG_INTEL_SSP_IP_OFFSET;161155 h2link->shim_vs_offset = AZX_REG_INTEL_SSP_VS_SHIM_OFFSET;···341333 writel(val, lsdiid);342334}343335336336+static void hdaml_shim_map_stream_ch(u16 __iomem *pcmsycm, int lchan, int hchan,337337+ int stream_id, int dir)338338+{339339+ u16 val;340340+341341+ val = readw(pcmsycm);342342+343343+ u16p_replace_bits(&val, lchan, GENMASK(3, 0));344344+ u16p_replace_bits(&val, hchan, GENMASK(7, 4));345345+ u16p_replace_bits(&val, stream_id, GENMASK(13, 8));346346+ u16p_replace_bits(&val, dir, BIT(15));347347+348348+ writew(val, pcmsycm);349349+}350350+344351static void hdaml_lctl_offload_enable(u32 __iomem *lctl, bool enable)345352{346353 u32 val = readl(lctl);···387364 hlink->bus = bus;388365 hlink->ml_addr = bus->mlcap + AZX_ML_BASE + (AZX_ML_INTERVAL * index);389366390390- ret = hdaml_lnk_enum(bus->dev, h2link, hlink->ml_addr, index);367367+ ret = hdaml_lnk_enum(bus->dev, h2link, bus->remap_addr, hlink->ml_addr, index);391368 if (ret < 0) {392369 kfree(h2link);393370 return ret;···664641 if (eml_lock)665642 mutex_lock(&h2link->eml_lock);666643667667- if (++hlink->ref_count > 1)668668- goto skip_init;644644+ if (!alt) {645645+ if (++hlink->ref_count > 1)646646+ goto skip_init;647647+ } else {648648+ if (++h2link->sublink_ref_count[sublink] > 1)649649+ goto skip_init;650650+ }669651670652 ret = hdaml_link_init(hlink->ml_addr + AZX_REG_ML_LCTL, sublink);671653···712684 if (eml_lock)713685 mutex_lock(&h2link->eml_lock);714686715715- if (--hlink->ref_count > 0)716716- goto skip_shutdown;717717-687687+ if (!alt) {688688+ if (--hlink->ref_count > 0)689689+ goto skip_shutdown;690690+ } else {691691+ if (--h2link->sublink_ref_count[sublink] > 0)692692+ goto skip_shutdown;693693+ }718694 ret = hdaml_link_shutdown(hlink->ml_addr + AZX_REG_ML_LCTL, sublink);719695720696skip_shutdown:···771739772740 return 0;773741} EXPORT_SYMBOL_NS(hdac_bus_eml_sdw_set_lsdiid, SND_SOC_SOF_HDA_MLINK);742742+743743+/*744744+ * the 'y' parameter comes from the PCMSyCM hardware register naming. 'y' refers to the745745+ * PDI index, i.e. the FIFO used for RX or TX746746+ */747747+int hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,748748+ int channel_mask, int stream_id, int dir)749749+{750750+ struct hdac_ext2_link *h2link;751751+ u16 __iomem *pcmsycm;752752+ u16 val;753753+754754+ h2link = find_ext2_link(bus, true, AZX_REG_ML_LEPTR_ID_SDW);755755+ if (!h2link)756756+ return -ENODEV;757757+758758+ pcmsycm = h2link->base_ptr + h2link->shim_offset +759759+ h2link->instance_offset * sublink +760760+ AZX_REG_SDW_SHIM_PCMSyCM(y);761761+762762+ mutex_lock(&h2link->eml_lock);763763+764764+ hdaml_shim_map_stream_ch(pcmsycm, 0, hweight32(channel_mask),765765+ stream_id, dir);766766+767767+ mutex_unlock(&h2link->eml_lock);768768+769769+ val = readw(pcmsycm);770770+771771+ dev_dbg(bus->dev, "channel_mask %#x stream_id %d dir %d pcmscm %#x\n",772772+ channel_mask, stream_id, dir, val);773773+774774+ return 0;775775+} EXPORT_SYMBOL_NS(hdac_bus_eml_sdw_map_stream_ch, SND_SOC_SOF_HDA_MLINK);774776775777void hda_bus_ml_put_all(struct hdac_bus *bus)776778{···901835 return &h2link->hext_link;902836}903837EXPORT_SYMBOL_NS(hdac_bus_eml_dmic_get_hlink, SND_SOC_SOF_HDA_MLINK);838838+839839+struct hdac_ext_link *hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus)840840+{841841+ struct hdac_ext2_link *h2link;842842+843843+ h2link = find_ext2_link(bus, true, AZX_REG_ML_LEPTR_ID_SDW);844844+ if (!h2link)845845+ return NULL;846846+847847+ return &h2link->hext_link;848848+}849849+EXPORT_SYMBOL_NS(hdac_bus_eml_sdw_get_hlink, SND_SOC_SOF_HDA_MLINK);904850905851int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable)906852{
+5-2
sound/soc/sof/ipc3-topology.c
···21032103 * For the case of PAUSE/HW_FREE, since there are no quirks, flags can be used as is.21042104 */2105210521062106- if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS)21062106+ if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {21072107+ /* Clear stale command */21082108+ config->flags &= ~SOF_DAI_CONFIG_FLAGS_CMD_MASK;21072109 config->flags |= flags;21082108- else21102110+ } else {21092111 config->flags = flags;21122112+ }2110211321112114 /* only send the IPC if the widget is set up in the DSP */21122115 if (swidget->use_count > 0) {
···643643 "%s/%s",644644 plat_data->tplg_filename_prefix,645645 plat_data->tplg_filename);646646- if (!tplg_filename)647647- return -ENOMEM;648648-649649- ret = snd_sof_load_topology(component, tplg_filename);650650- if (ret < 0) {651651- dev_err(component->dev, "error: failed to load DSP topology %d\n",652652- ret);653653- return ret;646646+ if (!tplg_filename) {647647+ ret = -ENOMEM;648648+ goto pm_error;654649 }655650651651+ ret = snd_sof_load_topology(component, tplg_filename);652652+ if (ret < 0)653653+ dev_err(component->dev, "error: failed to load DSP topology %d\n",654654+ ret);655655+656656+pm_error:656657 pm_runtime_mark_last_busy(component->dev);657658 pm_runtime_put_autosuspend(component->dev);658659
+13-1
sound/soc/sof/pm.c
···164164 ret = tplg_ops->set_up_all_pipelines(sdev, false);165165 if (ret < 0) {166166 dev_err(sdev->dev, "Failed to restore pipeline after resume %d\n", ret);167167- return ret;167167+ goto setup_fail;168168 }169169 }170170···177177 if (ret < 0)178178 dev_err(sdev->dev, "ctx_restore IPC error during resume: %d\n", ret);179179 }180180+181181+setup_fail:182182+#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE)183183+ if (ret < 0) {184184+ /*185185+ * Debugfs cannot be read in runtime suspend, so cache186186+ * the contents upon failure. This allows to capture187187+ * possible DSP coredump information.188188+ */189189+ sof_cache_debugfs(sdev);190190+ }191191+#endif180192181193 return ret;182194}
+8-6
sound/soc/sof/sof-client-probes.c
···218218219219 ret = ipc->points_info(cdev, &desc, &num_desc);220220 if (ret < 0)221221- goto exit;222222-223223- pm_runtime_mark_last_busy(dev);224224- err = pm_runtime_put_autosuspend(dev);225225- if (err < 0)226226- dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);221221+ goto pm_error;227222228223 for (i = 0; i < num_desc; i++) {229224 offset = strlen(buf);···236241 ret = simple_read_from_buffer(to, count, ppos, buf, strlen(buf));237242238243 kfree(desc);244244+245245+pm_error:246246+ pm_runtime_mark_last_busy(dev);247247+ err = pm_runtime_put_autosuspend(dev);248248+ if (err < 0)249249+ dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);250250+239251exit:240252 kfree(buf);241253 return ret;
+5-1
sound/soc/sof/topology.c
···586586 if (*num_copied_tuples == tuples_size)587587 return 0;588588 }589589+590590+ /* stop when we've found the required token instances */591591+ if (found == num_tokens * token_instance_num)592592+ return 0;589593 }590594591595 /* next array */···12651261 if (num_sets > 1) {12661262 struct snd_sof_tuple *new_tuples;1267126312681268- num_tuples += token_list[object_token_list[i]].count * num_sets;12641264+ num_tuples += token_list[object_token_list[i]].count * (num_sets - 1);12691265 new_tuples = krealloc(swidget->tuples,12701266 sizeof(*new_tuples) * num_tuples, GFP_KERNEL);12711267 if (!new_tuples) {
+1
sound/usb/format.c
···423423 case USB_ID(0x0e41, 0x4248): /* Line6 Helix >= fw 2.82 */424424 case USB_ID(0x0e41, 0x4249): /* Line6 Helix Rack >= fw 2.82 */425425 case USB_ID(0x0e41, 0x424a): /* Line6 Helix LT >= fw 2.82 */426426+ case USB_ID(0x0e41, 0x424b): /* Line6 Pod Go */426427 case USB_ID(0x19f7, 0x0011): /* Rode Rodecaster Pro */427428 return set_fixed_rate(fp, 48000, SNDRV_PCM_RATE_48000);428429 }
+36
tools/arch/arm64/include/uapi/asm/kvm.h
···198198 __u64 reserved[2];199199};200200201201+/*202202+ * Counter/Timer offset structure. Describe the virtual/physical offset.203203+ * To be used with KVM_ARM_SET_COUNTER_OFFSET.204204+ */205205+struct kvm_arm_counter_offset {206206+ __u64 counter_offset;207207+ __u64 reserved;208208+};209209+201210#define KVM_ARM_TAGS_TO_GUEST 0202211#define KVM_ARM_TAGS_FROM_GUEST 1203212···381372#endif382373};383374375375+/* Device Control API on vm fd */376376+#define KVM_ARM_VM_SMCCC_CTRL 0377377+#define KVM_ARM_VM_SMCCC_FILTER 0378378+384379/* Device Control API: ARM VGIC */385380#define KVM_DEV_ARM_VGIC_GRP_ADDR 0386381#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1···424411#define KVM_ARM_VCPU_TIMER_CTRL 1425412#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0426413#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1414414+#define KVM_ARM_VCPU_TIMER_IRQ_HVTIMER 2415415+#define KVM_ARM_VCPU_TIMER_IRQ_HPTIMER 3427416#define KVM_ARM_VCPU_PVTIME_CTRL 2428417#define KVM_ARM_VCPU_PVTIME_IPA 0429418···483468484469/* run->fail_entry.hardware_entry_failure_reason codes. */485470#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)471471+472472+enum kvm_smccc_filter_action {473473+ KVM_SMCCC_FILTER_HANDLE = 0,474474+ KVM_SMCCC_FILTER_DENY,475475+ KVM_SMCCC_FILTER_FWD_TO_USER,476476+477477+#ifdef __KERNEL__478478+ NR_SMCCC_FILTER_ACTIONS479479+#endif480480+};481481+482482+struct kvm_smccc_filter {483483+ __u32 base;484484+ __u32 nr_functions;485485+ __u8 action;486486+ __u8 pad[15];487487+};488488+489489+/* arm64-specific KVM_EXIT_HYPERCALL flags */490490+#define KVM_HYPERCALL_EXIT_SMC (1U << 0)491491+#define KVM_HYPERCALL_EXIT_16BIT (1U << 1)486492487493#endif488494
+21-5
tools/arch/x86/include/asm/cpufeatures.h
···9797#define X86_FEATURE_SYSENTER32 ( 3*32+15) /* "" sysenter in IA32 userspace */9898#define X86_FEATURE_REP_GOOD ( 3*32+16) /* REP microcode works well */9999#define X86_FEATURE_AMD_LBR_V2 ( 3*32+17) /* AMD Last Branch Record Extension Version 2 */100100-#define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) /* "" LFENCE synchronizes RDTSC */100100+/* FREE, was #define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) "" LFENCE synchronizes RDTSC */101101#define X86_FEATURE_ACC_POWER ( 3*32+19) /* AMD Accumulated Power Mechanism */102102#define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */103103#define X86_FEATURE_ALWAYS ( 3*32+21) /* "" Always-present feature */···226226227227/* Virtualization flags: Linux defined, word 8 */228228#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */229229-#define X86_FEATURE_VNMI ( 8*32+ 1) /* Intel Virtual NMI */230230-#define X86_FEATURE_FLEXPRIORITY ( 8*32+ 2) /* Intel FlexPriority */231231-#define X86_FEATURE_EPT ( 8*32+ 3) /* Intel Extended Page Table */232232-#define X86_FEATURE_VPID ( 8*32+ 4) /* Intel Virtual Processor ID */229229+#define X86_FEATURE_FLEXPRIORITY ( 8*32+ 1) /* Intel FlexPriority */230230+#define X86_FEATURE_EPT ( 8*32+ 2) /* Intel Extended Page Table */231231+#define X86_FEATURE_VPID ( 8*32+ 3) /* Intel Virtual Processor ID */233232234233#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer VMMCALL to VMCALL */235234#define X86_FEATURE_XENPV ( 8*32+16) /* "" Xen paravirtual guest */···306307#define X86_FEATURE_SGX_EDECCSSA (11*32+18) /* "" SGX EDECCSSA user leaf function */307308#define X86_FEATURE_CALL_DEPTH (11*32+19) /* "" Call depth tracking for RSB stuffing */308309#define X86_FEATURE_MSR_TSX_CTRL (11*32+20) /* "" MSR IA32_TSX_CTRL (Intel) implemented */310310+#define X86_FEATURE_SMBA (11*32+21) /* "" Slow Memory Bandwidth Allocation */311311+#define X86_FEATURE_BMEC (11*32+22) /* "" Bandwidth Monitoring Event Configuration */309312310313/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */311314#define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */312315#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */313316#define X86_FEATURE_CMPCCXADD (12*32+ 7) /* "" CMPccXADD instructions */317317+#define X86_FEATURE_ARCH_PERFMON_EXT (12*32+ 8) /* "" Intel Architectural PerfMon Extension */318318+#define X86_FEATURE_FZRM (12*32+10) /* "" Fast zero-length REP MOVSB */319319+#define X86_FEATURE_FSRS (12*32+11) /* "" Fast short REP STOSB */320320+#define X86_FEATURE_FSRC (12*32+12) /* "" Fast short REP {CMPSB,SCASB} */314321#define X86_FEATURE_LKGS (12*32+18) /* "" Load "kernel" (userspace) GS */315322#define X86_FEATURE_AMX_FP16 (12*32+21) /* "" AMX fp16 Support */316323#define X86_FEATURE_AVX_IFMA (12*32+23) /* "" Support for VPMADD52[H,L]UQ */324324+#define X86_FEATURE_LAM (12*32+26) /* Linear Address Masking */317325318326/* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */319327#define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */···337331#define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */338332#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */339333#define X86_FEATURE_CPPC (13*32+27) /* Collaborative Processor Performance Control */334334+#define X86_FEATURE_AMD_PSFD (13*32+28) /* "" Predictive Store Forwarding Disable */340335#define X86_FEATURE_BTC_NO (13*32+29) /* "" Not vulnerable to Branch Type Confusion */341336#define X86_FEATURE_BRS (13*32+31) /* Branch Sampling available */342337···370363#define X86_FEATURE_VGIF (15*32+16) /* Virtual GIF */371364#define X86_FEATURE_X2AVIC (15*32+18) /* Virtual x2apic */372365#define X86_FEATURE_V_SPEC_CTRL (15*32+20) /* Virtual SPEC_CTRL */366366+#define X86_FEATURE_VNMI (15*32+25) /* Virtual NMI */373367#define X86_FEATURE_SVME_ADDR_CHK (15*32+28) /* "" SVME addr check */374368375369/* Intel-defined CPU features, CPUID level 0x00000007:0 (ECX), word 16 */···435427#define X86_FEATURE_V_TSC_AUX (19*32+ 9) /* "" Virtual TSC_AUX */436428#define X86_FEATURE_SME_COHERENT (19*32+10) /* "" AMD hardware-enforced cache coherency */437429430430+/* AMD-defined Extended Feature 2 EAX, CPUID level 0x80000021 (EAX), word 20 */431431+#define X86_FEATURE_NO_NESTED_DATA_BP (20*32+ 0) /* "" No Nested Data Breakpoints */432432+#define X86_FEATURE_LFENCE_RDTSC (20*32+ 2) /* "" LFENCE always serializing / synchronizes RDTSC */433433+#define X86_FEATURE_NULL_SEL_CLR_BASE (20*32+ 6) /* "" Null Selector Clears Base */434434+#define X86_FEATURE_AUTOIBRS (20*32+ 8) /* "" Automatic IBRS */435435+#define X86_FEATURE_NO_SMM_CTL_MSR (20*32+ 9) /* "" SMM_CTL MSR is not present */436436+438437/*439438 * BUG word(s)440439 */···482467#define X86_BUG_MMIO_UNKNOWN X86_BUG(26) /* CPU is too old and its MMIO Stale Data status is unknown */483468#define X86_BUG_RETBLEED X86_BUG(27) /* CPU is affected by RETBleed */484469#define X86_BUG_EIBRS_PBRSB X86_BUG(28) /* EIBRS is vulnerable to Post Barrier RSB Predictions */470470+#define X86_BUG_SMT_RSB X86_BUG(29) /* CPU is vulnerable to Cross-Thread Return Address Predictions */485471486472#endif /* _ASM_X86_CPUFEATURES_H */
···206206207207/* Abbreviated from Intel SDM name IA32_INTEGRITY_CAPABILITIES */208208#define MSR_INTEGRITY_CAPS 0x000002d9209209+#define MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT 2210210+#define MSR_INTEGRITY_CAPS_ARRAY_BIST BIT(MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT)209211#define MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT 4210212#define MSR_INTEGRITY_CAPS_PERIODIC_BIST BIT(MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT)211213
+3
tools/arch/x86/include/uapi/asm/kvm.h
···559559#define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */560560#define KVM_VCPU_TSC_OFFSET 0 /* attribute for the TSC offset */561561562562+/* x86-specific KVM_EXIT_HYPERCALL flags. */563563+#define KVM_EXIT_HYPERCALL_LONG_MODE BIT(0)564564+562565#endif /* _ASM_X86_KVM_H */
···1010.section .noinstr.text, "ax"11111212/*1313- * We build a jump to memcpy_orig by default which gets NOPped out on1414- * the majority of x86 CPUs which set REP_GOOD. In addition, CPUs which1515- * have the enhanced REP MOVSB/STOSB feature (ERMS), change those NOPs1616- * to a jmp to memcpy_erms which does the REP; MOVSB mem copy.1717- */1818-1919-/*2013 * memcpy - Copy a memory block.2114 *2215 * Input:···1926 *2027 * Output:2128 * rax original destination2929+ *3030+ * The FSRM alternative should be done inline (avoiding the call and3131+ * the disgusting return handling), but that would require some help3232+ * from the compiler for better calling conventions.3333+ *3434+ * The 'rep movsb' itself is small enough to replace the call, but the3535+ * two register moves blow up the code. And one of them is "needed"3636+ * only for the return value that is the same as the source input,3737+ * which the compiler could/should do much better anyway.2238 */2339SYM_TYPED_FUNC_START(__memcpy)2424- ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \2525- "jmp memcpy_erms", X86_FEATURE_ERMS4040+ ALTERNATIVE "jmp memcpy_orig", "", X86_FEATURE_FSRM26412742 movq %rdi, %rax2843 movq %rdx, %rcx2929- shrq $3, %rcx3030- andl $7, %edx3131- rep movsq3232- movl %edx, %ecx3344 rep movsb3445 RET3546SYM_FUNC_END(__memcpy)···41444245SYM_FUNC_ALIAS(memcpy, __memcpy)4346EXPORT_SYMBOL(memcpy)4444-4545-/*4646- * memcpy_erms() - enhanced fast string memcpy. This is faster and4747- * simpler than memcpy. Use memcpy_erms when possible.4848- */4949-SYM_FUNC_START_LOCAL(memcpy_erms)5050- movq %rdi, %rax5151- movq %rdx, %rcx5252- rep movsb5353- RET5454-SYM_FUNC_END(memcpy_erms)55475648SYM_FUNC_START_LOCAL(memcpy_orig)5749 movq %rdi, %rax
+11-36
tools/arch/x86/lib/memset_64.S
···1818 * rdx count (bytes)1919 *2020 * rax original destination2121+ *2222+ * The FSRS alternative should be done inline (avoiding the call and2323+ * the disgusting return handling), but that would require some help2424+ * from the compiler for better calling conventions.2525+ *2626+ * The 'rep stosb' itself is small enough to replace the call, but all2727+ * the register moves blow up the code. And two of them are "needed"2828+ * only for the return value that is the same as the source input,2929+ * which the compiler could/should do much better anyway.2130 */2231SYM_FUNC_START(__memset)2323- /*2424- * Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended2525- * to use it when possible. If not available, use fast string instructions.2626- *2727- * Otherwise, use original memset function.2828- */2929- ALTERNATIVE_2 "jmp memset_orig", "", X86_FEATURE_REP_GOOD, \3030- "jmp memset_erms", X86_FEATURE_ERMS3232+ ALTERNATIVE "jmp memset_orig", "", X86_FEATURE_FSRS31333234 movq %rdi,%r93535+ movb %sil,%al3336 movq %rdx,%rcx3434- andl $7,%edx3535- shrq $3,%rcx3636- /* expand byte value */3737- movzbl %sil,%esi3838- movabs $0x0101010101010101,%rax3939- imulq %rsi,%rax4040- rep stosq4141- movl %edx,%ecx4237 rep stosb4338 movq %r9,%rax4439 RET···42474348SYM_FUNC_ALIAS(memset, __memset)4449EXPORT_SYMBOL(memset)4545-4646-/*4747- * ISO C memset - set a memory block to a byte value. This function uses4848- * enhanced rep stosb to override the fast string function.4949- * The code is simpler and shorter than the fast string function as well.5050- *5151- * rdi destination5252- * rsi value (char)5353- * rdx count (bytes)5454- *5555- * rax original destination5656- */5757-SYM_FUNC_START_LOCAL(memset_erms)5858- movq %rdi,%r95959- movb %sil,%al6060- movq %rdx,%rcx6161- rep stosb6262- movq %r9,%rax6363- RET6464-SYM_FUNC_END(memset_erms)65506651SYM_FUNC_START_LOCAL(memset_orig)6752 movq %rdi,%r10
+1-2
tools/include/asm/alternative.h
···4455/* Just disable it so we can build arch/x86/lib/memcpy_64.S for perf bench: */6677-#define altinstruction_entry #88-#define ALTERNATIVE_2 #77+#define ALTERNATIVE #98109#endif
+55-2
tools/include/uapi/drm/drm.h
···972972#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)973973#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)974974#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)975975+/**976976+ * DRM_IOCTL_GEM_CLOSE - Close a GEM handle.977977+ *978978+ * GEM handles are not reference-counted by the kernel. User-space is979979+ * responsible for managing their lifetime. For example, if user-space imports980980+ * the same memory object twice on the same DRM file description, the same GEM981981+ * handle is returned by both imports, and user-space needs to ensure982982+ * &DRM_IOCTL_GEM_CLOSE is performed once only. The same situation can happen983983+ * when a memory object is allocated, then exported and imported again on the984984+ * same DRM file description. The &DRM_IOCTL_MODE_GETFB2 IOCTL is an exception985985+ * and always returns fresh new GEM handles even if an existing GEM handle986986+ * already refers to the same memory object before the IOCTL is performed.987987+ */975988#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)976989#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)977990#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)···10251012#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)10261013#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)1027101410151015+/**10161016+ * DRM_IOCTL_PRIME_HANDLE_TO_FD - Convert a GEM handle to a DMA-BUF FD.10171017+ *10181018+ * User-space sets &drm_prime_handle.handle with the GEM handle to export and10191019+ * &drm_prime_handle.flags, and gets back a DMA-BUF file descriptor in10201020+ * &drm_prime_handle.fd.10211021+ *10221022+ * The export can fail for any driver-specific reason, e.g. because export is10231023+ * not supported for this specific GEM handle (but might be for others).10241024+ *10251025+ * Support for exporting DMA-BUFs is advertised via &DRM_PRIME_CAP_EXPORT.10261026+ */10281027#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)10281028+/**10291029+ * DRM_IOCTL_PRIME_FD_TO_HANDLE - Convert a DMA-BUF FD to a GEM handle.10301030+ *10311031+ * User-space sets &drm_prime_handle.fd with a DMA-BUF file descriptor to10321032+ * import, and gets back a GEM handle in &drm_prime_handle.handle.10331033+ * &drm_prime_handle.flags is unused.10341034+ *10351035+ * If an existing GEM handle refers to the memory object backing the DMA-BUF,10361036+ * that GEM handle is returned. Therefore user-space which needs to handle10371037+ * arbitrary DMA-BUFs must have a user-space lookup data structure to manually10381038+ * reference-count duplicated GEM handles. For more information see10391039+ * &DRM_IOCTL_GEM_CLOSE.10401040+ *10411041+ * The import can fail for any driver-specific reason, e.g. because import is10421042+ * only supported for DMA-BUFs allocated on this DRM device.10431043+ *10441044+ * Support for importing DMA-BUFs is advertised via &DRM_PRIME_CAP_IMPORT.10451045+ */10291046#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)1030104710311048#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)···11471104 * struct as the output.11481105 *11491106 * If the client is DRM master or has &CAP_SYS_ADMIN, &drm_mode_fb_cmd2.handles11501150- * will be filled with GEM buffer handles. Planes are valid until one has a11511151- * zero handle -- this can be used to compute the number of planes.11071107+ * will be filled with GEM buffer handles. Fresh new GEM handles are always11081108+ * returned, even if another GEM handle referring to the same memory object11091109+ * already exists on the DRM file description. The caller is responsible for11101110+ * removing the new handles, e.g. via the &DRM_IOCTL_GEM_CLOSE IOCTL. The same11111111+ * new handle will be returned for multiple planes in case they use the same11121112+ * memory object. Planes are valid until one has a zero handle -- this can be11131113+ * used to compute the number of planes.11521114 *11531115 * Otherwise, &drm_mode_fb_cmd2.handles will be zeroed and planes are valid11541116 * until one has a zero &drm_mode_fb_cmd2.pitches.···11611113 * If the framebuffer has a format modifier, &DRM_MODE_FB_MODIFIERS will be set11621114 * in &drm_mode_fb_cmd2.flags and &drm_mode_fb_cmd2.modifier will contain the11631115 * modifier. Otherwise, user-space must ignore &drm_mode_fb_cmd2.modifier.11161116+ *11171117+ * To obtain DMA-BUF FDs for each plane without leaking GEM handles, user-space11181118+ * can export each handle via &DRM_IOCTL_PRIME_HANDLE_TO_FD, then immediately11191119+ * close each unique handle via &DRM_IOCTL_GEM_CLOSE, making sure to not11201120+ * double-close handles which are specified multiple times in the array.11641121 */11651122#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)11661123
+24-1
tools/include/uapi/drm/i915_drm.h
···24912491#define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0 /* see i915_context_engines_load_balance */24922492#define I915_CONTEXT_ENGINES_EXT_BOND 1 /* see i915_context_engines_bond */24932493#define I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT 2 /* see i915_context_engines_parallel_submit */24942494- struct i915_engine_class_instance engines[0];24942494+ struct i915_engine_class_instance engines[];24952495} __attribute__((packed));2496249624972497#define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__, N__) struct { \···26762676 I915_OAR_FORMAT_A32u40_A4u32_B8_C8,26772677 I915_OA_FORMAT_A24u40_A14u32_B8_C8,2678267826792679+ /* MTL OAM */26802680+ I915_OAM_FORMAT_MPEC8u64_B8_C8,26812681+ I915_OAM_FORMAT_MPEC8u32_B8_C8,26822682+26792683 I915_OA_FORMAT_MAX /* non-ABI */26802684};26812685···27612757 * This property is available in perf revision 5.27622758 */27632759 DRM_I915_PERF_PROP_POLL_OA_PERIOD,27602760+27612761+ /**27622762+ * Multiple engines may be mapped to the same OA unit. The OA unit is27632763+ * identified by class:instance of any engine mapped to it.27642764+ *27652765+ * This parameter specifies the engine class and must be passed along27662766+ * with DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE.27672767+ *27682768+ * This property is available in perf revision 6.27692769+ */27702770+ DRM_I915_PERF_PROP_OA_ENGINE_CLASS,27712771+27722772+ /**27732773+ * This parameter specifies the engine instance and must be passed along27742774+ * with DRM_I915_PERF_PROP_OA_ENGINE_CLASS.27752775+ *27762776+ * This property is available in perf revision 6.27772777+ */27782778+ DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE,2764277927652780 DRM_I915_PERF_PROP_MAX /* non-ABI */27662781};
···429429 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */430430 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */431431 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */432432- snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */433433- snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */434434- snd_pcm_uframes_t silence_size; /* silence block size */432432+ /*433433+ * The following two thresholds alleviate playback buffer underruns; when434434+ * hw_avail drops below the threshold, the respective action is triggered:435435+ */436436+ snd_pcm_uframes_t stop_threshold; /* - stop playback */437437+ snd_pcm_uframes_t silence_threshold; /* - pre-fill buffer with silence */438438+ snd_pcm_uframes_t silence_size; /* max size of silence pre-fill; when >= boundary,439439+ * fill played area with silence immediately */435440 snd_pcm_uframes_t boundary; /* pointers wrap point */436441 unsigned int proto; /* protocol version */437442 unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */···575570struct __snd_pcm_mmap_control64 {576571 __pad_before_uframe __pad1;577572 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */578578- __pad_before_uframe __pad2;573573+ __pad_before_uframe __pad2; // This should be __pad_after_uframe, but binary574574+ // backwards compatibility constraints prevent a fix.579575580576 __pad_before_uframe __pad3;581577 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
+6
tools/perf/Makefile.config
···216216 dummy := $(error Error: $(BISON) is missing on this system, please install it)217217endif218218219219+ifeq ($(BUILD_BPF_SKEL),1)220220+ ifeq ($(call get-executable,$(CLANG)),)221221+ dummy := $(error $(CLANG) is missing on this system, please install it to be able to build with BUILD_BPF_SKEL=1)222222+ endif223223+endif224224+219225ifneq ($(OUTPUT),)220226 ifeq ($(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 371), 1)221227 BISON_FILE_PREFIX_MAP := --file-prefix-map=$(OUTPUT)=
+20-2
tools/perf/Makefile.perf
···1057105710581058ifdef BUILD_BPF_SKEL10591059BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool10601060-BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE)10601060+# Get Clang's default includes on this system, as opposed to those seen by10611061+# '-target bpf'. This fixes "missing" files on some architectures/distros,10621062+# such as asm/byteorder.h, asm/socket.h, asm/sockios.h, sys/cdefs.h etc.10631063+#10641064+# Use '-idirafter': Don't interfere with include mechanics except where the10651065+# build would have failed anyways.10661066+define get_sys_includes10671067+$(shell $(1) $(2) -v -E - </dev/null 2>&1 \10681068+ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \10691069+$(shell $(1) $(2) -dM -E - </dev/null | grep '__riscv_xlen ' | awk '{printf("-D__riscv_xlen=%d -D__BITS_PER_LONG=%d", $$3, $$3)}')10701070+endef10711071+10721072+ifneq ($(CROSS_COMPILE),)10731073+CLANG_TARGET_ARCH = --target=$(notdir $(CROSS_COMPILE:%-=%))10741074+endif10751075+10761076+CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH))10771077+BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) $(CLANG_SYS_INCLUDES)10781078+TOOLS_UAPI_INCLUDE := -I$(srctree)/tools/include/uapi1061107910621080$(BPFTOOL): | $(SKEL_TMP_OUT)10631081 $(Q)CFLAGS= $(MAKE) -C ../bpf/bpftool \10641082 OUTPUT=$(SKEL_TMP_OUT)/ bootstrap1065108310661084$(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) | $(SKEL_TMP_OUT)10671067- $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -Wall -Werror $(BPF_INCLUDE) \10851085+ $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -Wall -Werror $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \10681086 -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ && $(LLVM_STRIP) -g $@1069108710701088$(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)
+4-5
tools/perf/arch/arm/util/cs-etm.c
···7878 char path[PATH_MAX];7979 int err;8080 u32 val;8181- u64 contextid =8282- evsel->core.attr.config &8383- (perf_pmu__format_bits(&cs_etm_pmu->format, "contextid1") |8181+ u64 contextid = evsel->core.attr.config &8282+ (perf_pmu__format_bits(&cs_etm_pmu->format, "contextid") |8383+ perf_pmu__format_bits(&cs_etm_pmu->format, "contextid1") |8484 perf_pmu__format_bits(&cs_etm_pmu->format, "contextid2"));85858686 if (!contextid)···114114 * 0b00100 Maximum of 32-bit Context ID size.115115 * All other values are reserved.116116 */117117- val = BMVAL(val, 5, 9);118118- if (!val || val != 0x4) {117117+ if (BMVAL(val, 5, 9) != 0x4) {119118 pr_err("%s: CONTEXTIDR_EL1 isn't supported, disable with %s/contextid1=0/\n",120119 CORESIGHT_ETM_PMU_NAME, CORESIGHT_ETM_PMU_NAME);121120 return -EINVAL;
···1818 * The cpumap should cover all CPUs. Otherwise, some CPUs may1919 * not support some events or have different event IDs.2020 */2121- if (pmu->cpus->nr != cpu__max_cpu().cpu)2121+ if (RC_CHK_ACCESS(pmu->cpus)->nr != cpu__max_cpu().cpu)2222 return NULL;23232424 return pmu;
+1-1
tools/perf/arch/s390/entry/syscalls/syscall.tbl
···449449444 common landlock_create_ruleset sys_landlock_create_ruleset sys_landlock_create_ruleset450450445 common landlock_add_rule sys_landlock_add_rule sys_landlock_add_rule451451446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self452452-# 447 reserved for memfd_secret452452+447 common memfd_secret sys_memfd_secret sys_memfd_secret453453448 common process_mrelease sys_process_mrelease sys_process_mrelease454454449 common futex_waitv sys_futex_waitv sys_futex_waitv455455450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node
-4
tools/perf/bench/mem-memcpy-x86-64-asm-def.h
···77MEMCPY_FN(__memcpy,88 "x86-64-movsq",99 "movsq-based memcpy() in arch/x86/lib/memcpy_64.S")1010-1111-MEMCPY_FN(memcpy_erms,1212- "x86-64-movsb",1313- "movsb-based memcpy() in arch/x86/lib/memcpy_64.S")
+1-1
tools/perf/bench/mem-memcpy-x86-64-asm.S
···2233/* Various wrappers to make the kernel .S file build in user-space: */4455-// memcpy_orig and memcpy_erms are being defined as SYM_L_LOCAL but we need it55+// memcpy_orig is being defined as SYM_L_LOCAL but we need it66#define SYM_FUNC_START_LOCAL(name) \77 SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)88#define memcpy MEMCPY /* don't hide glibc's memcpy() */
-4
tools/perf/bench/mem-memset-x86-64-asm-def.h
···77MEMSET_FN(__memset,88 "x86-64-stosq",99 "movsq-based memset() in arch/x86/lib/memset_64.S")1010-1111-MEMSET_FN(memset_erms,1212- "x86-64-stosb",1313- "movsb-based memset() in arch/x86/lib/memset_64.S")
+1-1
tools/perf/bench/mem-memset-x86-64-asm.S
···11/* SPDX-License-Identifier: GPL-2.0 */22-// memset_orig and memset_erms are being defined as SYM_L_LOCAL but we need it22+// memset_orig is being defined as SYM_L_LOCAL but we need it33#define SYM_FUNC_START_LOCAL(name) \44 SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)55#define memset MEMSET /* don't hide glibc's memset() */
+7
tools/perf/builtin-script.c
···36473647 union perf_event *event)36483648{36493649 perf_event__read_stat_config(&stat_config, &event->stat_config);36503650+36513651+ /*36523652+ * Aggregation modes are not used since post-processing scripts are36533653+ * supposed to take care of such requirements36543654+ */36553655+ stat_config.aggr_mode = AGGR_NONE;36563656+36503657 return 0;36513658}36523659
+29-9
tools/perf/builtin-stat.c
···667667 evsel_list->core.threads->err_thread = -1;668668 return COUNTER_RETRY;669669 }670670+ } else if (counter->skippable) {671671+ if (verbose > 0)672672+ ui__warning("skipping event %s that kernel failed to open .\n",673673+ evsel__name(counter));674674+ counter->supported = false;675675+ counter->errored = true;676676+ return COUNTER_SKIP;670677 }671678672679 evsel__open_strerror(counter, &target, errno, msg, sizeof(msg));···18971890 * caused by exposing latent bugs. This is fixed properly in:18981891 * https://lore.kernel.org/lkml/bff481ba-e60a-763f-0aa0-3ee53302c480@linux.intel.com/18991892 */19001900- if (metricgroup__has_metric("TopdownL1") && !perf_pmu__has_hybrid() &&19011901- metricgroup__parse_groups(evsel_list, "TopdownL1",19021902- /*metric_no_group=*/false,19031903- /*metric_no_merge=*/false,19041904- /*metric_no_threshold=*/true,19051905- stat_config.user_requested_cpu_list,19061906- stat_config.system_wide,19071907- &stat_config.metric_events) < 0)19081908- return -1;18931893+ if (metricgroup__has_metric("TopdownL1") && !perf_pmu__has_hybrid()) {18941894+ struct evlist *metric_evlist = evlist__new();18951895+ struct evsel *metric_evsel;18961896+18971897+ if (!metric_evlist)18981898+ return -1;18991899+19001900+ if (metricgroup__parse_groups(metric_evlist, "TopdownL1",19011901+ /*metric_no_group=*/false,19021902+ /*metric_no_merge=*/false,19031903+ /*metric_no_threshold=*/true,19041904+ stat_config.user_requested_cpu_list,19051905+ stat_config.system_wide,19061906+ &stat_config.metric_events) < 0)19071907+ return -1;19081908+19091909+ evlist__for_each_entry(metric_evlist, metric_evsel) {19101910+ metric_evsel->skippable = true;19111911+ }19121912+ evlist__splice_list_tail(evsel_list, &metric_evlist->core.entries);19131913+ evlist__delete(metric_evlist);19141914+ }1909191519101916 /* Platform specific attrs */19111917 if (evlist__add_default_attrs(evsel_list, default_null_attrs) < 0)
···133133 "MetricGroup": "TopdownL1;tma_L1_group",134134 "MetricName": "tma_backend_bound",135135 "MetricThreshold": "tma_backend_bound > 0.1",136136+ "MetricgroupNoGroup": "TopdownL1",136137 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that uops must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count. The rest of these subevents count backend stalls, in cycles, due to an outstanding request which is memory bound vs core bound. The subevents are not slot based events and therefore can not be precisely added or subtracted from the Backend_Bound_Aux subevents which are slot based.",137138 "ScaleUnit": "100%",138139 "Unit": "cpu_atom"···144143 "MetricGroup": "TopdownL1;tma_L1_group",145144 "MetricName": "tma_backend_bound_aux",146145 "MetricThreshold": "tma_backend_bound_aux > 0.2",146146+ "MetricgroupNoGroup": "TopdownL1",147147 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that UOPS must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count. All of these subevents count backend stalls, in slots, due to a resource limitation. These are not cycle based events and therefore can not be precisely added or subtracted from the Backend_Bound subevents which are cycle based. These subevents are supplementary to Backend_Bound and can be used to analyze results from a resource perspective at allocation.",148148 "ScaleUnit": "100%",149149 "Unit": "cpu_atom"···155153 "MetricGroup": "TopdownL1;tma_L1_group",156154 "MetricName": "tma_bad_speculation",157155 "MetricThreshold": "tma_bad_speculation > 0.15",156156+ "MetricgroupNoGroup": "TopdownL1",158157 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend because allocation is stalled due to a mispredicted jump or a machine clear. Only issue slots wasted due to fast nukes such as memory ordering nukes are counted. Other nukes are not accounted for. Counts all issue slots blocked during this recovery window including relevant microcode flows and while uops are not yet available in the instruction queue (IQ). Also includes the issue slots that were consumed by the backend but were thrown away because they were younger than the mispredict or machine clear.",159158 "ScaleUnit": "100%",160159 "Unit": "cpu_atom"···166163 "MetricGroup": "TopdownL2;tma_L2_group;tma_retiring_group",167164 "MetricName": "tma_base",168165 "MetricThreshold": "tma_base > 0.6",166166+ "MetricgroupNoGroup": "TopdownL2",169167 "ScaleUnit": "100%",170168 "Unit": "cpu_atom"171169 },···186182 "MetricGroup": "TopdownL2;tma_L2_group;tma_bad_speculation_group",187183 "MetricName": "tma_branch_mispredicts",188184 "MetricThreshold": "tma_branch_mispredicts > 0.05",185185+ "MetricgroupNoGroup": "TopdownL2",189186 "ScaleUnit": "100%",190187 "Unit": "cpu_atom"191188 },···214209 "MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_group",215210 "MetricName": "tma_core_bound",216211 "MetricThreshold": "tma_core_bound > 0.1",212212+ "MetricgroupNoGroup": "TopdownL2",217213 "ScaleUnit": "100%",218214 "Unit": "cpu_atom"219215 },···261255 "MetricGroup": "TopdownL2;tma_L2_group;tma_frontend_bound_group",262256 "MetricName": "tma_fetch_bandwidth",263257 "MetricThreshold": "tma_fetch_bandwidth > 0.1",258258+ "MetricgroupNoGroup": "TopdownL2",264259 "ScaleUnit": "100%",265260 "Unit": "cpu_atom"266261 },···271264 "MetricGroup": "TopdownL2;tma_L2_group;tma_frontend_bound_group",272265 "MetricName": "tma_fetch_latency",273266 "MetricThreshold": "tma_fetch_latency > 0.15",267267+ "MetricgroupNoGroup": "TopdownL2",274268 "ScaleUnit": "100%",275269 "Unit": "cpu_atom"276270 },···299291 "MetricGroup": "TopdownL1;tma_L1_group",300292 "MetricName": "tma_frontend_bound",301293 "MetricThreshold": "tma_frontend_bound > 0.2",294294+ "MetricgroupNoGroup": "TopdownL1",302295 "ScaleUnit": "100%",303296 "Unit": "cpu_atom"304297 },···602593 "MetricGroup": "TopdownL2;tma_L2_group;tma_bad_speculation_group",603594 "MetricName": "tma_machine_clears",604595 "MetricThreshold": "tma_machine_clears > 0.05",596596+ "MetricgroupNoGroup": "TopdownL2",605597 "ScaleUnit": "100%",606598 "Unit": "cpu_atom"607599 },···621611 "MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_group",622612 "MetricName": "tma_memory_bound",623613 "MetricThreshold": "tma_memory_bound > 0.2",614614+ "MetricgroupNoGroup": "TopdownL2",624615 "ScaleUnit": "100%",625616 "Unit": "cpu_atom"626617 },···640629 "MetricGroup": "TopdownL2;tma_L2_group;tma_retiring_group",641630 "MetricName": "tma_ms_uops",642631 "MetricThreshold": "tma_ms_uops > 0.05",632632+ "MetricgroupNoGroup": "TopdownL2",643633 "PublicDescription": "Counts the number of uops that are from the complex flows issued by the micro-sequencer (MS). This includes uops from flows due to complex instructions, faults, assists, and inserted flows.",644634 "ScaleUnit": "100%",645635 "Unit": "cpu_atom"···741729 "MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_aux_group",742730 "MetricName": "tma_resource_bound",743731 "MetricThreshold": "tma_resource_bound > 0.2",732732+ "MetricgroupNoGroup": "TopdownL2",744733 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that uops must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count.",745734 "ScaleUnit": "100%",746735 "Unit": "cpu_atom"···752739 "MetricGroup": "TopdownL1;tma_L1_group",753740 "MetricName": "tma_retiring",754741 "MetricThreshold": "tma_retiring > 0.75",742742+ "MetricgroupNoGroup": "TopdownL1",755743 "ScaleUnit": "100%",756744 "Unit": "cpu_atom"757745 },···862848 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",863849 "MetricName": "tma_backend_bound",864850 "MetricThreshold": "tma_backend_bound > 0.2",851851+ "MetricgroupNoGroup": "TopdownL1",865852 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound. Sample with: TOPDOWN.BACKEND_BOUND_SLOTS",866853 "ScaleUnit": "100%",867854 "Unit": "cpu_core"···873858 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",874859 "MetricName": "tma_bad_speculation",875860 "MetricThreshold": "tma_bad_speculation > 0.15",861861+ "MetricgroupNoGroup": "TopdownL1",876862 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",877863 "ScaleUnit": "100%",878864 "Unit": "cpu_core"···884868 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",885869 "MetricName": "tma_branch_mispredicts",886870 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",871871+ "MetricgroupNoGroup": "TopdownL2",887872 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: TOPDOWN.BR_MISPREDICT_SLOTS. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",888873 "ScaleUnit": "100%",889874 "Unit": "cpu_core"···936919 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",937920 "MetricName": "tma_core_bound",938921 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",922922+ "MetricgroupNoGroup": "TopdownL2",939923 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",940924 "ScaleUnit": "100%",941925 "Unit": "cpu_core"···10491031 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",10501032 "MetricName": "tma_fetch_bandwidth",10511033 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 6 > 0.35",10341034+ "MetricgroupNoGroup": "TopdownL2",10521035 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",10531036 "ScaleUnit": "100%",10541037 "Unit": "cpu_core"···10601041 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",10611042 "MetricName": "tma_fetch_latency",10621043 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",10441044+ "MetricgroupNoGroup": "TopdownL2",10631045 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",10641046 "ScaleUnit": "100%",10651047 "Unit": "cpu_core"···11411121 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",11421122 "MetricName": "tma_frontend_bound",11431123 "MetricThreshold": "tma_frontend_bound > 0.15",11241124+ "MetricgroupNoGroup": "TopdownL1",11441125 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",11451126 "ScaleUnit": "100%",11461127 "Unit": "cpu_core"···11621141 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",11631142 "MetricName": "tma_heavy_operations",11641143 "MetricThreshold": "tma_heavy_operations > 0.1",11441144+ "MetricgroupNoGroup": "TopdownL2",11651145 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences. Sample with: UOPS_RETIRED.HEAVY",11661146 "ScaleUnit": "100%",11671147 "Unit": "cpu_core"···20452023 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",20462024 "MetricName": "tma_light_operations",20472025 "MetricThreshold": "tma_light_operations > 0.6",20262026+ "MetricgroupNoGroup": "TopdownL2",20482027 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",20492028 "ScaleUnit": "100%",20502029 "Unit": "cpu_core"···21052082 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",21062083 "MetricName": "tma_machine_clears",21072084 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",20852085+ "MetricgroupNoGroup": "TopdownL2",21082086 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",21092087 "ScaleUnit": "100%",21102088 "Unit": "cpu_core"···21362112 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",21372113 "MetricName": "tma_memory_bound",21382114 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",21152115+ "MetricgroupNoGroup": "TopdownL2",21392116 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",21402117 "ScaleUnit": "100%",21412118 "Unit": "cpu_core"···23352310 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",23362311 "MetricName": "tma_retiring",23372312 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",23132313+ "MetricgroupNoGroup": "TopdownL1",23382314 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.SLOTS",23392315 "ScaleUnit": "100%",23402316 "Unit": "cpu_core"
···9898 "MetricGroup": "TopdownL1;tma_L1_group",9999 "MetricName": "tma_backend_bound",100100 "MetricThreshold": "tma_backend_bound > 0.1",101101+ "MetricgroupNoGroup": "TopdownL1",101102 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that uops must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count. The rest of these subevents count backend stalls, in cycles, due to an outstanding request which is memory bound vs core bound. The subevents are not slot based events and therefore can not be precisely added or subtracted from the Backend_Bound_Aux subevents which are slot based.",102103 "ScaleUnit": "100%"103104 },···108107 "MetricGroup": "TopdownL1;tma_L1_group",109108 "MetricName": "tma_backend_bound_aux",110109 "MetricThreshold": "tma_backend_bound_aux > 0.2",110110+ "MetricgroupNoGroup": "TopdownL1",111111 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that UOPS must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count. All of these subevents count backend stalls, in slots, due to a resource limitation. These are not cycle based events and therefore can not be precisely added or subtracted from the Backend_Bound subevents which are cycle based. These subevents are supplementary to Backend_Bound and can be used to analyze results from a resource perspective at allocation.",112112 "ScaleUnit": "100%"113113 },···118116 "MetricGroup": "TopdownL1;tma_L1_group",119117 "MetricName": "tma_bad_speculation",120118 "MetricThreshold": "tma_bad_speculation > 0.15",119119+ "MetricgroupNoGroup": "TopdownL1",121120 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend because allocation is stalled due to a mispredicted jump or a machine clear. Only issue slots wasted due to fast nukes such as memory ordering nukes are counted. Other nukes are not accounted for. Counts all issue slots blocked during this recovery window including relevant microcode flows and while uops are not yet available in the instruction queue (IQ). Also includes the issue slots that were consumed by the backend but were thrown away because they were younger than the mispredict or machine clear.",122121 "ScaleUnit": "100%"123122 },···128125 "MetricGroup": "TopdownL2;tma_L2_group;tma_retiring_group",129126 "MetricName": "tma_base",130127 "MetricThreshold": "tma_base > 0.6",128128+ "MetricgroupNoGroup": "TopdownL2",131129 "ScaleUnit": "100%"132130 },133131 {···146142 "MetricGroup": "TopdownL2;tma_L2_group;tma_bad_speculation_group",147143 "MetricName": "tma_branch_mispredicts",148144 "MetricThreshold": "tma_branch_mispredicts > 0.05",145145+ "MetricgroupNoGroup": "TopdownL2",149146 "ScaleUnit": "100%"150147 },151148 {···171166 "MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_group",172167 "MetricName": "tma_core_bound",173168 "MetricThreshold": "tma_core_bound > 0.1",169169+ "MetricgroupNoGroup": "TopdownL2",174170 "ScaleUnit": "100%"175171 },176172 {···213207 "MetricGroup": "TopdownL2;tma_L2_group;tma_frontend_bound_group",214208 "MetricName": "tma_fetch_bandwidth",215209 "MetricThreshold": "tma_fetch_bandwidth > 0.1",210210+ "MetricgroupNoGroup": "TopdownL2",216211 "ScaleUnit": "100%"217212 },218213 {···222215 "MetricGroup": "TopdownL2;tma_L2_group;tma_frontend_bound_group",223216 "MetricName": "tma_fetch_latency",224217 "MetricThreshold": "tma_fetch_latency > 0.15",218218+ "MetricgroupNoGroup": "TopdownL2",225219 "ScaleUnit": "100%"226220 },227221 {···247239 "MetricGroup": "TopdownL1;tma_L1_group",248240 "MetricName": "tma_frontend_bound",249241 "MetricThreshold": "tma_frontend_bound > 0.2",242242+ "MetricgroupNoGroup": "TopdownL1",250243 "ScaleUnit": "100%"251244 },252245 {···508499 "MetricGroup": "TopdownL2;tma_L2_group;tma_bad_speculation_group",509500 "MetricName": "tma_machine_clears",510501 "MetricThreshold": "tma_machine_clears > 0.05",502502+ "MetricgroupNoGroup": "TopdownL2",511503 "ScaleUnit": "100%"512504 },513505 {···525515 "MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_group",526516 "MetricName": "tma_memory_bound",527517 "MetricThreshold": "tma_memory_bound > 0.2",518518+ "MetricgroupNoGroup": "TopdownL2",528519 "ScaleUnit": "100%"529520 },530521 {···542531 "MetricGroup": "TopdownL2;tma_L2_group;tma_retiring_group",543532 "MetricName": "tma_ms_uops",544533 "MetricThreshold": "tma_ms_uops > 0.05",534534+ "MetricgroupNoGroup": "TopdownL2",545535 "PublicDescription": "Counts the number of uops that are from the complex flows issued by the micro-sequencer (MS). This includes uops from flows due to complex instructions, faults, assists, and inserted flows.",546536 "ScaleUnit": "100%"547537 },···632620 "MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_aux_group",633621 "MetricName": "tma_resource_bound",634622 "MetricThreshold": "tma_resource_bound > 0.2",623623+ "MetricgroupNoGroup": "TopdownL2",635624 "PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that uops must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count.",636625 "ScaleUnit": "100%"637626 },···642629 "MetricGroup": "TopdownL1;tma_L1_group",643630 "MetricName": "tma_retiring",644631 "MetricThreshold": "tma_retiring > 0.75",632632+ "MetricgroupNoGroup": "TopdownL1",645633 "ScaleUnit": "100%"646634 },647635 {
···103103 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",104104 "MetricName": "tma_backend_bound",105105 "MetricThreshold": "tma_backend_bound > 0.2",106106+ "MetricgroupNoGroup": "TopdownL1",106107 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",107108 "ScaleUnit": "100%"108109 },···113112 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",114113 "MetricName": "tma_bad_speculation",115114 "MetricThreshold": "tma_bad_speculation > 0.15",115115+ "MetricgroupNoGroup": "TopdownL1",116116 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",117117 "ScaleUnit": "100%"118118 },···124122 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",125123 "MetricName": "tma_branch_mispredicts",126124 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",125125+ "MetricgroupNoGroup": "TopdownL2",127126 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",128127 "ScaleUnit": "100%"129128 },···173170 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",174171 "MetricName": "tma_core_bound",175172 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",173173+ "MetricgroupNoGroup": "TopdownL2",176174 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",177175 "ScaleUnit": "100%"178176 },···267263 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",268264 "MetricName": "tma_fetch_bandwidth",269265 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",266266+ "MetricgroupNoGroup": "TopdownL2",270267 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",271268 "ScaleUnit": "100%"272269 },···277272 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",278273 "MetricName": "tma_fetch_latency",279274 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",275275+ "MetricgroupNoGroup": "TopdownL2",280276 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",281277 "ScaleUnit": "100%"282278 },···332326 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",333327 "MetricName": "tma_frontend_bound",334328 "MetricThreshold": "tma_frontend_bound > 0.15",329329+ "MetricgroupNoGroup": "TopdownL1",335330 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",336331 "ScaleUnit": "100%"337332 },···342335 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",343336 "MetricName": "tma_heavy_operations",344337 "MetricThreshold": "tma_heavy_operations > 0.1",338338+ "MetricgroupNoGroup": "TopdownL2",345339 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",346340 "ScaleUnit": "100%"347341 },···836828 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",837829 "MetricName": "tma_light_operations",838830 "MetricThreshold": "tma_light_operations > 0.6",831831+ "MetricgroupNoGroup": "TopdownL2",839832 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",840833 "ScaleUnit": "100%"841834 },···867858 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",868859 "MetricName": "tma_machine_clears",869860 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",861861+ "MetricgroupNoGroup": "TopdownL2",870862 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",871863 "ScaleUnit": "100%"872864 },···896886 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",897887 "MetricName": "tma_memory_bound",898888 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",889889+ "MetricgroupNoGroup": "TopdownL2",899890 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",900891 "ScaleUnit": "100%"901892 },···10591048 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",10601049 "MetricName": "tma_retiring",10611050 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",10511051+ "MetricgroupNoGroup": "TopdownL1",10621052 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",10631053 "ScaleUnit": "100%"10641054 },
···9797 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",9898 "MetricName": "tma_backend_bound",9999 "MetricThreshold": "tma_backend_bound > 0.2",100100+ "MetricgroupNoGroup": "TopdownL1",100101 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound. Sample with: TOPDOWN.BACKEND_BOUND_SLOTS",101102 "ScaleUnit": "100%"102103 },···107106 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",108107 "MetricName": "tma_bad_speculation",109108 "MetricThreshold": "tma_bad_speculation > 0.15",109109+ "MetricgroupNoGroup": "TopdownL1",110110 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",111111 "ScaleUnit": "100%"112112 },···118116 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",119117 "MetricName": "tma_branch_mispredicts",120118 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",119119+ "MetricgroupNoGroup": "TopdownL2",121120 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: TOPDOWN.BR_MISPREDICT_SLOTS. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",122121 "ScaleUnit": "100%"123122 },···167164 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",168165 "MetricName": "tma_core_bound",169166 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",167167+ "MetricgroupNoGroup": "TopdownL2",170168 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",171169 "ScaleUnit": "100%"172170 },···252248 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",253249 "MetricName": "tma_fetch_bandwidth",254250 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",251251+ "MetricgroupNoGroup": "TopdownL2",255252 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",256253 "ScaleUnit": "100%"257254 },···262257 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",263258 "MetricName": "tma_fetch_latency",264259 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",260260+ "MetricgroupNoGroup": "TopdownL2",265261 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",266262 "ScaleUnit": "100%"267263 },···317311 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",318312 "MetricName": "tma_frontend_bound",319313 "MetricThreshold": "tma_frontend_bound > 0.15",314314+ "MetricgroupNoGroup": "TopdownL1",320315 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",321316 "ScaleUnit": "100%"322317 },···327320 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",328321 "MetricName": "tma_heavy_operations",329322 "MetricThreshold": "tma_heavy_operations > 0.1",323323+ "MetricgroupNoGroup": "TopdownL2",330324 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",331325 "ScaleUnit": "100%"332326 },···803795 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",804796 "MetricName": "tma_light_operations",805797 "MetricThreshold": "tma_light_operations > 0.6",798798+ "MetricgroupNoGroup": "TopdownL2",806799 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",807800 "ScaleUnit": "100%"808801 },···834825 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",835826 "MetricName": "tma_machine_clears",836827 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",828828+ "MetricgroupNoGroup": "TopdownL2",837829 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",838830 "ScaleUnit": "100%"839831 },···863853 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",864854 "MetricName": "tma_memory_bound",865855 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",856856+ "MetricgroupNoGroup": "TopdownL2",866857 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",867858 "ScaleUnit": "100%"868859 },···10241013 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",10251014 "MetricName": "tma_retiring",10261015 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",10161016+ "MetricgroupNoGroup": "TopdownL1",10271017 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.SLOTS",10281018 "ScaleUnit": "100%"10291019 },
···103103 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",104104 "MetricName": "tma_backend_bound",105105 "MetricThreshold": "tma_backend_bound > 0.2",106106+ "MetricgroupNoGroup": "TopdownL1",106107 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",107108 "ScaleUnit": "100%"108109 },···113112 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",114113 "MetricName": "tma_bad_speculation",115114 "MetricThreshold": "tma_bad_speculation > 0.15",115115+ "MetricgroupNoGroup": "TopdownL1",116116 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",117117 "ScaleUnit": "100%"118118 },···124122 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",125123 "MetricName": "tma_branch_mispredicts",126124 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",125125+ "MetricgroupNoGroup": "TopdownL2",127126 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",128127 "ScaleUnit": "100%"129128 },···173170 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",174171 "MetricName": "tma_core_bound",175172 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",173173+ "MetricgroupNoGroup": "TopdownL2",176174 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",177175 "ScaleUnit": "100%"178176 },···267263 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",268264 "MetricName": "tma_fetch_bandwidth",269265 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",266266+ "MetricgroupNoGroup": "TopdownL2",270267 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",271268 "ScaleUnit": "100%"272269 },···277272 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",278273 "MetricName": "tma_fetch_latency",279274 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",275275+ "MetricgroupNoGroup": "TopdownL2",280276 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",281277 "ScaleUnit": "100%"282278 },···332326 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",333327 "MetricName": "tma_frontend_bound",334328 "MetricThreshold": "tma_frontend_bound > 0.15",329329+ "MetricgroupNoGroup": "TopdownL1",335330 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",336331 "ScaleUnit": "100%"337332 },···342335 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",343336 "MetricName": "tma_heavy_operations",344337 "MetricThreshold": "tma_heavy_operations > 0.1",338338+ "MetricgroupNoGroup": "TopdownL2",345339 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",346340 "ScaleUnit": "100%"347341 },···837829 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",838830 "MetricName": "tma_light_operations",839831 "MetricThreshold": "tma_light_operations > 0.6",832832+ "MetricgroupNoGroup": "TopdownL2",840833 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",841834 "ScaleUnit": "100%"842835 },···878869 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",879870 "MetricName": "tma_machine_clears",880871 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",872872+ "MetricgroupNoGroup": "TopdownL2",881873 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",882874 "ScaleUnit": "100%"883875 },···907897 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",908898 "MetricName": "tma_memory_bound",909899 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",900900+ "MetricgroupNoGroup": "TopdownL2",910901 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",911902 "ScaleUnit": "100%"912903 },···10901079 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",10911080 "MetricName": "tma_retiring",10921081 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",10821082+ "MetricgroupNoGroup": "TopdownL1",10931083 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",10941084 "ScaleUnit": "100%"10951085 },
···101101 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",102102 "MetricName": "tma_backend_bound",103103 "MetricThreshold": "tma_backend_bound > 0.2",104104+ "MetricgroupNoGroup": "TopdownL1",104105 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",105106 "ScaleUnit": "100%"106107 },···111110 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",112111 "MetricName": "tma_bad_speculation",113112 "MetricThreshold": "tma_bad_speculation > 0.15",113113+ "MetricgroupNoGroup": "TopdownL1",114114 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",115115 "ScaleUnit": "100%"116116 },···122120 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",123121 "MetricName": "tma_branch_mispredicts",124122 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",123123+ "MetricgroupNoGroup": "TopdownL2",125124 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",126125 "ScaleUnit": "100%"127126 },···170167 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",171168 "MetricName": "tma_core_bound",172169 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",170170+ "MetricgroupNoGroup": "TopdownL2",173171 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",174172 "ScaleUnit": "100%"175173 },···275271 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",276272 "MetricName": "tma_fetch_bandwidth",277273 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",274274+ "MetricgroupNoGroup": "TopdownL2",278275 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",279276 "ScaleUnit": "100%"280277 },···285280 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",286281 "MetricName": "tma_fetch_latency",287282 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",283283+ "MetricgroupNoGroup": "TopdownL2",288284 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",289285 "ScaleUnit": "100%"290286 },···360354 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",361355 "MetricName": "tma_frontend_bound",362356 "MetricThreshold": "tma_frontend_bound > 0.15",357357+ "MetricgroupNoGroup": "TopdownL1",363358 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",364359 "ScaleUnit": "100%"365360 },···379372 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",380373 "MetricName": "tma_heavy_operations",381374 "MetricThreshold": "tma_heavy_operations > 0.1",375375+ "MetricgroupNoGroup": "TopdownL2",382376 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",383377 "ScaleUnit": "100%"384378 },···11501142 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",11511143 "MetricName": "tma_light_operations",11521144 "MetricThreshold": "tma_light_operations > 0.6",11451145+ "MetricgroupNoGroup": "TopdownL2",11531146 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",11541147 "ScaleUnit": "100%"11551148 },···12051196 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",12061197 "MetricName": "tma_machine_clears",12071198 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",11991199+ "MetricgroupNoGroup": "TopdownL2",12081200 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",12091201 "ScaleUnit": "100%"12101202 },···12341224 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",12351225 "MetricName": "tma_memory_bound",12361226 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",12271227+ "MetricgroupNoGroup": "TopdownL2",12371228 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",12381229 "ScaleUnit": "100%"12391230 },···14691458 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",14701459 "MetricName": "tma_retiring",14711460 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",14611461+ "MetricgroupNoGroup": "TopdownL1",14721462 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",14731463 "ScaleUnit": "100%"14741464 },
···103103 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",104104 "MetricName": "tma_backend_bound",105105 "MetricThreshold": "tma_backend_bound > 0.2",106106+ "MetricgroupNoGroup": "TopdownL1",106107 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",107108 "ScaleUnit": "100%"108109 },···113112 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",114113 "MetricName": "tma_bad_speculation",115114 "MetricThreshold": "tma_bad_speculation > 0.15",115115+ "MetricgroupNoGroup": "TopdownL1",116116 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",117117 "ScaleUnit": "100%"118118 },···124122 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",125123 "MetricName": "tma_branch_mispredicts",126124 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",125125+ "MetricgroupNoGroup": "TopdownL2",127126 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",128127 "ScaleUnit": "100%"129128 },···164161 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",165162 "MetricName": "tma_core_bound",166163 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",164164+ "MetricgroupNoGroup": "TopdownL2",167165 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",168166 "ScaleUnit": "100%"169167 },···258254 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",259255 "MetricName": "tma_fetch_bandwidth",260256 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",257257+ "MetricgroupNoGroup": "TopdownL2",261258 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",262259 "ScaleUnit": "100%"263260 },···268263 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",269264 "MetricName": "tma_fetch_latency",270265 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",266266+ "MetricgroupNoGroup": "TopdownL2",271267 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",272268 "ScaleUnit": "100%"273269 },···278272 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",279273 "MetricName": "tma_frontend_bound",280274 "MetricThreshold": "tma_frontend_bound > 0.15",275275+ "MetricgroupNoGroup": "TopdownL1",281276 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",282277 "ScaleUnit": "100%"283278 },···288281 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",289282 "MetricName": "tma_heavy_operations",290283 "MetricThreshold": "tma_heavy_operations > 0.1",284284+ "MetricgroupNoGroup": "TopdownL2",291285 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",292286 "ScaleUnit": "100%"293287 },···671663 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",672664 "MetricName": "tma_light_operations",673665 "MetricThreshold": "tma_light_operations > 0.6",666666+ "MetricgroupNoGroup": "TopdownL2",674667 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",675668 "ScaleUnit": "100%"676669 },···702693 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",703694 "MetricName": "tma_machine_clears",704695 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",696696+ "MetricgroupNoGroup": "TopdownL2",705697 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",706698 "ScaleUnit": "100%"707699 },···731721 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",732722 "MetricName": "tma_memory_bound",733723 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",724724+ "MetricgroupNoGroup": "TopdownL2",734725 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",735726 "ScaleUnit": "100%"736727 },···885874 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",886875 "MetricName": "tma_retiring",887876 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",877877+ "MetricgroupNoGroup": "TopdownL1",888878 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",889879 "ScaleUnit": "100%"890880 },
···103103 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",104104 "MetricName": "tma_backend_bound",105105 "MetricThreshold": "tma_backend_bound > 0.2",106106+ "MetricgroupNoGroup": "TopdownL1",106107 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",107108 "ScaleUnit": "100%"108109 },···113112 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",114113 "MetricName": "tma_bad_speculation",115114 "MetricThreshold": "tma_bad_speculation > 0.15",115115+ "MetricgroupNoGroup": "TopdownL1",116116 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",117117 "ScaleUnit": "100%"118118 },···124122 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",125123 "MetricName": "tma_branch_mispredicts",126124 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",125125+ "MetricgroupNoGroup": "TopdownL2",127126 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",128127 "ScaleUnit": "100%"129128 },···164161 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",165162 "MetricName": "tma_core_bound",166163 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",164164+ "MetricgroupNoGroup": "TopdownL2",167165 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",168166 "ScaleUnit": "100%"169167 },···258254 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",259255 "MetricName": "tma_fetch_bandwidth",260256 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",257257+ "MetricgroupNoGroup": "TopdownL2",261258 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",262259 "ScaleUnit": "100%"263260 },···268263 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",269264 "MetricName": "tma_fetch_latency",270265 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",266266+ "MetricgroupNoGroup": "TopdownL2",271267 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",272268 "ScaleUnit": "100%"273269 },···278272 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",279273 "MetricName": "tma_frontend_bound",280274 "MetricThreshold": "tma_frontend_bound > 0.15",275275+ "MetricgroupNoGroup": "TopdownL1",281276 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",282277 "ScaleUnit": "100%"283278 },···288281 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",289282 "MetricName": "tma_heavy_operations",290283 "MetricThreshold": "tma_heavy_operations > 0.1",284284+ "MetricgroupNoGroup": "TopdownL2",291285 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",292286 "ScaleUnit": "100%"293287 },···672664 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",673665 "MetricName": "tma_light_operations",674666 "MetricThreshold": "tma_light_operations > 0.6",667667+ "MetricgroupNoGroup": "TopdownL2",675668 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",676669 "ScaleUnit": "100%"677670 },···713704 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",714705 "MetricName": "tma_machine_clears",715706 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",707707+ "MetricgroupNoGroup": "TopdownL2",716708 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",717709 "ScaleUnit": "100%"718710 },···742732 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",743733 "MetricName": "tma_memory_bound",744734 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",735735+ "MetricgroupNoGroup": "TopdownL2",745736 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",746737 "ScaleUnit": "100%"747738 },···916905 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",917906 "MetricName": "tma_retiring",918907 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",908908+ "MetricgroupNoGroup": "TopdownL1",919909 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",920910 "ScaleUnit": "100%"921911 },
···115115 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",116116 "MetricName": "tma_backend_bound",117117 "MetricThreshold": "tma_backend_bound > 0.2",118118+ "MetricgroupNoGroup": "TopdownL1",118119 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound. Sample with: TOPDOWN.BACKEND_BOUND_SLOTS",119120 "ScaleUnit": "100%"120121 },···125124 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",126125 "MetricName": "tma_bad_speculation",127126 "MetricThreshold": "tma_bad_speculation > 0.15",127127+ "MetricgroupNoGroup": "TopdownL1",128128 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",129129 "ScaleUnit": "100%"130130 },···143141 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",144142 "MetricName": "tma_branch_mispredicts",145143 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",144144+ "MetricgroupNoGroup": "TopdownL2",146145 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",147146 "ScaleUnit": "100%"148147 },···190187 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",191188 "MetricName": "tma_core_bound",192189 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",190190+ "MetricgroupNoGroup": "TopdownL2",193191 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",194192 "ScaleUnit": "100%"195193 },···292288 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",293289 "MetricName": "tma_fetch_bandwidth",294290 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 5 > 0.35",291291+ "MetricgroupNoGroup": "TopdownL2",295292 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",296293 "ScaleUnit": "100%"297294 },···302297 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",303298 "MetricName": "tma_fetch_latency",304299 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",300300+ "MetricgroupNoGroup": "TopdownL2",305301 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",306302 "ScaleUnit": "100%"307303 },···375369 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",376370 "MetricName": "tma_frontend_bound",377371 "MetricThreshold": "tma_frontend_bound > 0.15",372372+ "MetricgroupNoGroup": "TopdownL1",378373 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",379374 "ScaleUnit": "100%"380375 },···385378 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",386379 "MetricName": "tma_heavy_operations",387380 "MetricThreshold": "tma_heavy_operations > 0.1",381381+ "MetricgroupNoGroup": "TopdownL2",388382 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",389383 "ScaleUnit": "100%"390384 },···11191111 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",11201112 "MetricName": "tma_light_operations",11211113 "MetricThreshold": "tma_light_operations > 0.6",11141114+ "MetricgroupNoGroup": "TopdownL2",11221115 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",11231116 "ScaleUnit": "100%"11241117 },···11731164 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",11741165 "MetricName": "tma_machine_clears",11751166 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",11671167+ "MetricgroupNoGroup": "TopdownL2",11761168 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",11771169 "ScaleUnit": "100%"11781170 },···12011191 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",12021192 "MetricName": "tma_memory_bound",12031193 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",11941194+ "MetricgroupNoGroup": "TopdownL2",12041195 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",12051196 "ScaleUnit": "100%"12061197 },···13711360 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",13721361 "MetricName": "tma_retiring",13731362 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",13631363+ "MetricgroupNoGroup": "TopdownL1",13741364 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.SLOTS",13751365 "ScaleUnit": "100%"13761366 },
···8080 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",8181 "MetricName": "tma_backend_bound",8282 "MetricThreshold": "tma_backend_bound > 0.2",8383+ "MetricgroupNoGroup": "TopdownL1",8384 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound. Sample with: TOPDOWN.BACKEND_BOUND_SLOTS",8485 "ScaleUnit": "100%"8586 },···9089 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",9190 "MetricName": "tma_bad_speculation",9291 "MetricThreshold": "tma_bad_speculation > 0.15",9292+ "MetricgroupNoGroup": "TopdownL1",9393 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",9494 "ScaleUnit": "100%"9595 },···108106 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",109107 "MetricName": "tma_branch_mispredicts",110108 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",109109+ "MetricgroupNoGroup": "TopdownL2",111110 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",112111 "ScaleUnit": "100%"113112 },···155152 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",156153 "MetricName": "tma_core_bound",157154 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",155155+ "MetricgroupNoGroup": "TopdownL2",158156 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",159157 "ScaleUnit": "100%"160158 },···257253 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",258254 "MetricName": "tma_fetch_bandwidth",259255 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 5 > 0.35",256256+ "MetricgroupNoGroup": "TopdownL2",260257 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",261258 "ScaleUnit": "100%"262259 },···267262 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",268263 "MetricName": "tma_fetch_latency",269264 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",265265+ "MetricgroupNoGroup": "TopdownL2",270266 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",271267 "ScaleUnit": "100%"272268 },···340334 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",341335 "MetricName": "tma_frontend_bound",342336 "MetricThreshold": "tma_frontend_bound > 0.15",337337+ "MetricgroupNoGroup": "TopdownL1",343338 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",344339 "ScaleUnit": "100%"345340 },···350343 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",351344 "MetricName": "tma_heavy_operations",352345 "MetricThreshold": "tma_heavy_operations > 0.1",346346+ "MetricgroupNoGroup": "TopdownL2",353347 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",354348 "ScaleUnit": "100%"355349 },···11421134 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",11431135 "MetricName": "tma_light_operations",11441136 "MetricThreshold": "tma_light_operations > 0.6",11371137+ "MetricgroupNoGroup": "TopdownL2",11451138 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",11461139 "ScaleUnit": "100%"11471140 },···11961187 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",11971188 "MetricName": "tma_machine_clears",11981189 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",11901190+ "MetricgroupNoGroup": "TopdownL2",11991191 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",12001192 "ScaleUnit": "100%"12011193 },···12241214 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",12251215 "MetricName": "tma_memory_bound",12261216 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",12171217+ "MetricgroupNoGroup": "TopdownL2",12271218 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",12281219 "ScaleUnit": "100%"12291220 },···14211410 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",14221411 "MetricName": "tma_retiring",14231412 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",14131413+ "MetricgroupNoGroup": "TopdownL1",14241414 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.SLOTS",14251415 "ScaleUnit": "100%"14261416 },
···103103 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",104104 "MetricName": "tma_backend_bound",105105 "MetricThreshold": "tma_backend_bound > 0.2",106106+ "MetricgroupNoGroup": "TopdownL1",106107 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",107108 "ScaleUnit": "100%"108109 },···113112 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",114113 "MetricName": "tma_bad_speculation",115114 "MetricThreshold": "tma_bad_speculation > 0.15",115115+ "MetricgroupNoGroup": "TopdownL1",116116 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",117117 "ScaleUnit": "100%"118118 },···124122 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",125123 "MetricName": "tma_branch_mispredicts",126124 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",125125+ "MetricgroupNoGroup": "TopdownL2",127126 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",128127 "ScaleUnit": "100%"129128 },···164161 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",165162 "MetricName": "tma_core_bound",166163 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",164164+ "MetricgroupNoGroup": "TopdownL2",167165 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",168166 "ScaleUnit": "100%"169167 },···258254 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",259255 "MetricName": "tma_fetch_bandwidth",260256 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",257257+ "MetricgroupNoGroup": "TopdownL2",261258 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",262259 "ScaleUnit": "100%"263260 },···268263 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",269264 "MetricName": "tma_fetch_latency",270265 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",266266+ "MetricgroupNoGroup": "TopdownL2",271267 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",272268 "ScaleUnit": "100%"273269 },···305299 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",306300 "MetricName": "tma_frontend_bound",307301 "MetricThreshold": "tma_frontend_bound > 0.15",302302+ "MetricgroupNoGroup": "TopdownL1",308303 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",309304 "ScaleUnit": "100%"310305 },···315308 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",316309 "MetricName": "tma_heavy_operations",317310 "MetricThreshold": "tma_heavy_operations > 0.1",311311+ "MetricgroupNoGroup": "TopdownL2",318312 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",319313 "ScaleUnit": "100%"320314 },···732724 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",733725 "MetricName": "tma_light_operations",734726 "MetricThreshold": "tma_light_operations > 0.6",727727+ "MetricgroupNoGroup": "TopdownL2",735728 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",736729 "ScaleUnit": "100%"737730 },···763754 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",764755 "MetricName": "tma_machine_clears",765756 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",757757+ "MetricgroupNoGroup": "TopdownL2",766758 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",767759 "ScaleUnit": "100%"768760 },···792782 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",793783 "MetricName": "tma_memory_bound",794784 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",785785+ "MetricgroupNoGroup": "TopdownL2",795786 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",796787 "ScaleUnit": "100%"797788 },···928917 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",929918 "MetricName": "tma_retiring",930919 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",920920+ "MetricgroupNoGroup": "TopdownL1",931921 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",932922 "ScaleUnit": "100%"933923 },
···103103 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",104104 "MetricName": "tma_backend_bound",105105 "MetricThreshold": "tma_backend_bound > 0.2",106106+ "MetricgroupNoGroup": "TopdownL1",106107 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",107108 "ScaleUnit": "100%"108109 },···113112 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",114113 "MetricName": "tma_bad_speculation",115114 "MetricThreshold": "tma_bad_speculation > 0.15",115115+ "MetricgroupNoGroup": "TopdownL1",116116 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",117117 "ScaleUnit": "100%"118118 },···124122 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",125123 "MetricName": "tma_branch_mispredicts",126124 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",125125+ "MetricgroupNoGroup": "TopdownL2",127126 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",128127 "ScaleUnit": "100%"129128 },···164161 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",165162 "MetricName": "tma_core_bound",166163 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",164164+ "MetricgroupNoGroup": "TopdownL2",167165 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",168166 "ScaleUnit": "100%"169167 },···258254 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",259255 "MetricName": "tma_fetch_bandwidth",260256 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",257257+ "MetricgroupNoGroup": "TopdownL2",261258 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",262259 "ScaleUnit": "100%"263260 },···268263 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",269264 "MetricName": "tma_fetch_latency",270265 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",266266+ "MetricgroupNoGroup": "TopdownL2",271267 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",272268 "ScaleUnit": "100%"273269 },···305299 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",306300 "MetricName": "tma_frontend_bound",307301 "MetricThreshold": "tma_frontend_bound > 0.15",302302+ "MetricgroupNoGroup": "TopdownL1",308303 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",309304 "ScaleUnit": "100%"310305 },···315308 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",316309 "MetricName": "tma_heavy_operations",317310 "MetricThreshold": "tma_heavy_operations > 0.1",311311+ "MetricgroupNoGroup": "TopdownL2",318312 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",319313 "ScaleUnit": "100%"320314 },···733725 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",734726 "MetricName": "tma_light_operations",735727 "MetricThreshold": "tma_light_operations > 0.6",728728+ "MetricgroupNoGroup": "TopdownL2",736729 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",737730 "ScaleUnit": "100%"738731 },···774765 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",775766 "MetricName": "tma_machine_clears",776767 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",768768+ "MetricgroupNoGroup": "TopdownL2",777769 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",778770 "ScaleUnit": "100%"779771 },···803793 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",804794 "MetricName": "tma_memory_bound",805795 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",796796+ "MetricgroupNoGroup": "TopdownL2",806797 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",807798 "ScaleUnit": "100%"808799 },···959948 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",960949 "MetricName": "tma_retiring",961950 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",951951+ "MetricgroupNoGroup": "TopdownL1",962952 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",963953 "ScaleUnit": "100%"964954 },
···7676 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",7777 "MetricName": "tma_backend_bound",7878 "MetricThreshold": "tma_backend_bound > 0.2",7979+ "MetricgroupNoGroup": "TopdownL1",7980 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",8081 "ScaleUnit": "100%"8182 },···8685 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",8786 "MetricName": "tma_bad_speculation",8887 "MetricThreshold": "tma_bad_speculation > 0.15",8888+ "MetricgroupNoGroup": "TopdownL1",8989 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",9090 "ScaleUnit": "100%"9191 },···9795 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",9896 "MetricName": "tma_branch_mispredicts",9997 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",9898+ "MetricgroupNoGroup": "TopdownL2",10099 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",101100 "ScaleUnit": "100%"102101 },···117114 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",118115 "MetricName": "tma_core_bound",119116 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",117117+ "MetricgroupNoGroup": "TopdownL2",120118 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",121119 "ScaleUnit": "100%"122120 },···164160 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",165161 "MetricName": "tma_fetch_bandwidth",166162 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",163163+ "MetricgroupNoGroup": "TopdownL2",167164 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_lcp",168165 "ScaleUnit": "100%"169166 },···174169 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",175170 "MetricName": "tma_fetch_latency",176171 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",172172+ "MetricgroupNoGroup": "TopdownL2",177173 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",178174 "ScaleUnit": "100%"179175 },···211205 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",212206 "MetricName": "tma_frontend_bound",213207 "MetricThreshold": "tma_frontend_bound > 0.15",208208+ "MetricgroupNoGroup": "TopdownL1",214209 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",215210 "ScaleUnit": "100%"216211 },···221214 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",222215 "MetricName": "tma_heavy_operations",223216 "MetricThreshold": "tma_heavy_operations > 0.1",217217+ "MetricgroupNoGroup": "TopdownL2",224218 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",225219 "ScaleUnit": "100%"226220 },···420412 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",421413 "MetricName": "tma_light_operations",422414 "MetricThreshold": "tma_light_operations > 0.6",415415+ "MetricgroupNoGroup": "TopdownL2",423416 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",424417 "ScaleUnit": "100%"425418 },···431422 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",432423 "MetricName": "tma_machine_clears",433424 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",425425+ "MetricgroupNoGroup": "TopdownL2",434426 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",435427 "ScaleUnit": "100%"436428 },···460450 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",461451 "MetricName": "tma_memory_bound",462452 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",453453+ "MetricgroupNoGroup": "TopdownL2",463454 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",464455 "ScaleUnit": "100%"465456 },···498487 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",499488 "MetricName": "tma_retiring",500489 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",490490+ "MetricgroupNoGroup": "TopdownL1",501491 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",502492 "ScaleUnit": "100%"503493 },
···7676 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",7777 "MetricName": "tma_backend_bound",7878 "MetricThreshold": "tma_backend_bound > 0.2",7979+ "MetricgroupNoGroup": "TopdownL1",7980 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",8081 "ScaleUnit": "100%"8182 },···8685 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",8786 "MetricName": "tma_bad_speculation",8887 "MetricThreshold": "tma_bad_speculation > 0.15",8888+ "MetricgroupNoGroup": "TopdownL1",8989 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",9090 "ScaleUnit": "100%"9191 },···9795 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",9896 "MetricName": "tma_branch_mispredicts",9997 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",9898+ "MetricgroupNoGroup": "TopdownL2",10099 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",101100 "ScaleUnit": "100%"102101 },···117114 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",118115 "MetricName": "tma_core_bound",119116 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",117117+ "MetricgroupNoGroup": "TopdownL2",120118 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",121119 "ScaleUnit": "100%"122120 },···164160 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",165161 "MetricName": "tma_fetch_bandwidth",166162 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",163163+ "MetricgroupNoGroup": "TopdownL2",167164 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_lcp",168165 "ScaleUnit": "100%"169166 },···174169 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",175170 "MetricName": "tma_fetch_latency",176171 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",172172+ "MetricgroupNoGroup": "TopdownL2",177173 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",178174 "ScaleUnit": "100%"179175 },···211205 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",212206 "MetricName": "tma_frontend_bound",213207 "MetricThreshold": "tma_frontend_bound > 0.15",208208+ "MetricgroupNoGroup": "TopdownL1",214209 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",215210 "ScaleUnit": "100%"216211 },···221214 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",222215 "MetricName": "tma_heavy_operations",223216 "MetricThreshold": "tma_heavy_operations > 0.1",217217+ "MetricgroupNoGroup": "TopdownL2",224218 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",225219 "ScaleUnit": "100%"226220 },···419411 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",420412 "MetricName": "tma_light_operations",421413 "MetricThreshold": "tma_light_operations > 0.6",414414+ "MetricgroupNoGroup": "TopdownL2",422415 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",423416 "ScaleUnit": "100%"424417 },···430421 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",431422 "MetricName": "tma_machine_clears",432423 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",424424+ "MetricgroupNoGroup": "TopdownL2",433425 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",434426 "ScaleUnit": "100%"435427 },···459449 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",460450 "MetricName": "tma_memory_bound",461451 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",452452+ "MetricgroupNoGroup": "TopdownL2",462453 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",463454 "ScaleUnit": "100%"464455 },···497486 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",498487 "MetricName": "tma_retiring",499488 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",489489+ "MetricgroupNoGroup": "TopdownL1",500490 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",501491 "ScaleUnit": "100%"502492 },
···8787 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",8888 "MetricName": "tma_backend_bound",8989 "MetricThreshold": "tma_backend_bound > 0.2",9090+ "MetricgroupNoGroup": "TopdownL1",9091 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound. Sample with: TOPDOWN.BACKEND_BOUND_SLOTS",9192 "ScaleUnit": "100%"9293 },···9796 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",9897 "MetricName": "tma_bad_speculation",9998 "MetricThreshold": "tma_bad_speculation > 0.15",9999+ "MetricgroupNoGroup": "TopdownL1",100100 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",101101 "ScaleUnit": "100%"102102 },···107105 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",108106 "MetricName": "tma_branch_mispredicts",109107 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",108108+ "MetricgroupNoGroup": "TopdownL2",110109 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: TOPDOWN.BR_MISPREDICT_SLOTS. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",111110 "ScaleUnit": "100%"112111 },···154151 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",155152 "MetricName": "tma_core_bound",156153 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",154154+ "MetricgroupNoGroup": "TopdownL2",157155 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",158156 "ScaleUnit": "100%"159157 },···256252 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",257253 "MetricName": "tma_fetch_bandwidth",258254 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 6 > 0.35",255255+ "MetricgroupNoGroup": "TopdownL2",259256 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",260257 "ScaleUnit": "100%"261258 },···266261 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",267262 "MetricName": "tma_fetch_latency",268263 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",264264+ "MetricgroupNoGroup": "TopdownL2",269265 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",270266 "ScaleUnit": "100%"271267 },···357351 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",358352 "MetricName": "tma_frontend_bound",359353 "MetricThreshold": "tma_frontend_bound > 0.15",354354+ "MetricgroupNoGroup": "TopdownL1",360355 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",361356 "ScaleUnit": "100%"362357 },···376369 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",377370 "MetricName": "tma_heavy_operations",378371 "MetricThreshold": "tma_heavy_operations > 0.1",372372+ "MetricgroupNoGroup": "TopdownL2",379373 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences. Sample with: UOPS_RETIRED.HEAVY",380374 "ScaleUnit": "100%"381375 },···12241216 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",12251217 "MetricName": "tma_light_operations",12261218 "MetricThreshold": "tma_light_operations > 0.6",12191219+ "MetricgroupNoGroup": "TopdownL2",12271220 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",12281221 "ScaleUnit": "100%"12291222 },···12781269 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",12791270 "MetricName": "tma_machine_clears",12801271 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",12721272+ "MetricgroupNoGroup": "TopdownL2",12811273 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",12821274 "ScaleUnit": "100%"12831275 },···13141304 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",13151305 "MetricName": "tma_memory_bound",13161306 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",13071307+ "MetricgroupNoGroup": "TopdownL2",13171308 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",13181309 "ScaleUnit": "100%"13191310 },···15201509 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",15211510 "MetricName": "tma_retiring",15221511 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",15121512+ "MetricgroupNoGroup": "TopdownL1",15231513 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.SLOTS",15241514 "ScaleUnit": "100%"15251515 },
···101101 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",102102 "MetricName": "tma_backend_bound",103103 "MetricThreshold": "tma_backend_bound > 0.2",104104+ "MetricgroupNoGroup": "TopdownL1",104105 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",105106 "ScaleUnit": "100%"106107 },···111110 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",112111 "MetricName": "tma_bad_speculation",113112 "MetricThreshold": "tma_bad_speculation > 0.15",113113+ "MetricgroupNoGroup": "TopdownL1",114114 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",115115 "ScaleUnit": "100%"116116 },···122120 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",123121 "MetricName": "tma_branch_mispredicts",124122 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",123123+ "MetricgroupNoGroup": "TopdownL2",125124 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",126125 "ScaleUnit": "100%"127126 },···170167 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",171168 "MetricName": "tma_core_bound",172169 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",170170+ "MetricgroupNoGroup": "TopdownL2",173171 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",174172 "ScaleUnit": "100%"175173 },···275271 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",276272 "MetricName": "tma_fetch_bandwidth",277273 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",274274+ "MetricgroupNoGroup": "TopdownL2",278275 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",279276 "ScaleUnit": "100%"280277 },···285280 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",286281 "MetricName": "tma_fetch_latency",287282 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",283283+ "MetricgroupNoGroup": "TopdownL2",288284 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",289285 "ScaleUnit": "100%"290286 },···351345 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",352346 "MetricName": "tma_frontend_bound",353347 "MetricThreshold": "tma_frontend_bound > 0.15",348348+ "MetricgroupNoGroup": "TopdownL1",354349 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",355350 "ScaleUnit": "100%"356351 },···370363 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",371364 "MetricName": "tma_heavy_operations",372365 "MetricThreshold": "tma_heavy_operations > 0.1",366366+ "MetricgroupNoGroup": "TopdownL2",373367 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",374368 "ScaleUnit": "100%"375369 },···10731065 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",10741066 "MetricName": "tma_light_operations",10751067 "MetricThreshold": "tma_light_operations > 0.6",10681068+ "MetricgroupNoGroup": "TopdownL2",10761069 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",10771070 "ScaleUnit": "100%"10781071 },···11191110 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",11201111 "MetricName": "tma_machine_clears",11211112 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",11131113+ "MetricgroupNoGroup": "TopdownL2",11221114 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",11231115 "ScaleUnit": "100%"11241116 },···11481138 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",11491139 "MetricName": "tma_memory_bound",11501140 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",11411141+ "MetricgroupNoGroup": "TopdownL2",11511142 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",11521143 "ScaleUnit": "100%"11531144 },···13541343 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",13551344 "MetricName": "tma_retiring",13561345 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",13461346+ "MetricgroupNoGroup": "TopdownL1",13571347 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",13581348 "ScaleUnit": "100%"13591349 },
···101101 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",102102 "MetricName": "tma_backend_bound",103103 "MetricThreshold": "tma_backend_bound > 0.2",104104+ "MetricgroupNoGroup": "TopdownL1",104105 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",105106 "ScaleUnit": "100%"106107 },···111110 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",112111 "MetricName": "tma_bad_speculation",113112 "MetricThreshold": "tma_bad_speculation > 0.15",113113+ "MetricgroupNoGroup": "TopdownL1",114114 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",115115 "ScaleUnit": "100%"116116 },···122120 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",123121 "MetricName": "tma_branch_mispredicts",124122 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",123123+ "MetricgroupNoGroup": "TopdownL2",125124 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",126125 "ScaleUnit": "100%"127126 },···170167 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",171168 "MetricName": "tma_core_bound",172169 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",170170+ "MetricgroupNoGroup": "TopdownL2",173171 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",174172 "ScaleUnit": "100%"175173 },···275271 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",276272 "MetricName": "tma_fetch_bandwidth",277273 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",274274+ "MetricgroupNoGroup": "TopdownL2",278275 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",279276 "ScaleUnit": "100%"280277 },···285280 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",286281 "MetricName": "tma_fetch_latency",287282 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",283283+ "MetricgroupNoGroup": "TopdownL2",288284 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",289285 "ScaleUnit": "100%"290286 },···360354 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",361355 "MetricName": "tma_frontend_bound",362356 "MetricThreshold": "tma_frontend_bound > 0.15",357357+ "MetricgroupNoGroup": "TopdownL1",363358 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",364359 "ScaleUnit": "100%"365360 },···379372 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",380373 "MetricName": "tma_heavy_operations",381374 "MetricThreshold": "tma_heavy_operations > 0.1",375375+ "MetricgroupNoGroup": "TopdownL2",382376 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",383377 "ScaleUnit": "100%"384378 },···11311123 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",11321124 "MetricName": "tma_light_operations",11331125 "MetricThreshold": "tma_light_operations > 0.6",11261126+ "MetricgroupNoGroup": "TopdownL2",11341127 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",11351128 "ScaleUnit": "100%"11361129 },···11861177 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",11871178 "MetricName": "tma_machine_clears",11881179 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",11801180+ "MetricgroupNoGroup": "TopdownL2",11891181 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",11901182 "ScaleUnit": "100%"11911183 },···12151205 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",12161206 "MetricName": "tma_memory_bound",12171207 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",12081208+ "MetricgroupNoGroup": "TopdownL2",12181209 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",12191210 "ScaleUnit": "100%"12201211 },···14401429 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",14411430 "MetricName": "tma_retiring",14421431 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",14321432+ "MetricgroupNoGroup": "TopdownL1",14431433 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",14441434 "ScaleUnit": "100%"14451435 },
···109109 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",110110 "MetricName": "tma_backend_bound",111111 "MetricThreshold": "tma_backend_bound > 0.2",112112+ "MetricgroupNoGroup": "TopdownL1",112113 "PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound. Sample with: TOPDOWN.BACKEND_BOUND_SLOTS",113114 "ScaleUnit": "100%"114115 },···119118 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",120119 "MetricName": "tma_bad_speculation",121120 "MetricThreshold": "tma_bad_speculation > 0.15",121121+ "MetricgroupNoGroup": "TopdownL1",122122 "PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",123123 "ScaleUnit": "100%"124124 },···137135 "MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",138136 "MetricName": "tma_branch_mispredicts",139137 "MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",138138+ "MetricgroupNoGroup": "TopdownL2",140139 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_info_mispredictions, tma_mispredicts_resteers",141140 "ScaleUnit": "100%"142141 },···184181 "MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",185182 "MetricName": "tma_core_bound",186183 "MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",184184+ "MetricgroupNoGroup": "TopdownL2",187185 "PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",188186 "ScaleUnit": "100%"189187 },···286282 "MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",287283 "MetricName": "tma_fetch_bandwidth",288284 "MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 5 > 0.35",285285+ "MetricgroupNoGroup": "TopdownL2",289286 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Sample with: FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_1_PS;FRONTEND_RETIRED.LATENCY_GE_2_PS. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_dsb_misses, tma_info_iptb, tma_lcp",290287 "ScaleUnit": "100%"291288 },···296291 "MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",297292 "MetricName": "tma_fetch_latency",298293 "MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",294294+ "MetricgroupNoGroup": "TopdownL2",299295 "PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: FRONTEND_RETIRED.LATENCY_GE_16_PS;FRONTEND_RETIRED.LATENCY_GE_8_PS",300296 "ScaleUnit": "100%"301297 },···369363 "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",370364 "MetricName": "tma_frontend_bound",371365 "MetricThreshold": "tma_frontend_bound > 0.15",366366+ "MetricgroupNoGroup": "TopdownL1",372367 "PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound. Sample with: FRONTEND_RETIRED.LATENCY_GE_4_PS",373368 "ScaleUnit": "100%"374369 },···379372 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",380373 "MetricName": "tma_heavy_operations",381374 "MetricThreshold": "tma_heavy_operations > 0.1",375375+ "MetricgroupNoGroup": "TopdownL2",382376 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",383377 "ScaleUnit": "100%"384378 },···11331125 "MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",11341126 "MetricName": "tma_light_operations",11351127 "MetricThreshold": "tma_light_operations > 0.6",11281128+ "MetricgroupNoGroup": "TopdownL2",11361129 "PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",11371130 "ScaleUnit": "100%"11381131 },···11871178 "MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",11881179 "MetricName": "tma_machine_clears",11891180 "MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",11811181+ "MetricgroupNoGroup": "TopdownL2",11901182 "PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",11911183 "ScaleUnit": "100%"11921184 },···12151205 "MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",12161206 "MetricName": "tma_memory_bound",12171207 "MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",12081208+ "MetricgroupNoGroup": "TopdownL2",12181209 "PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",12191210 "ScaleUnit": "100%"12201211 },···13851374 "MetricGroup": "TmaL1;TopdownL1;tma_L1_group",13861375 "MetricName": "tma_retiring",13871376 "MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",13771377+ "MetricgroupNoGroup": "TopdownL1",13881378 "PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.SLOTS",13891379 "ScaleUnit": "100%"13901380 },
+3-1
tools/perf/pmu-events/jevents.py
···5252# Attributes that are in pmu_metric rather than pmu_event.5353_json_metric_attributes = [5454 'metric_name', 'metric_group', 'metric_expr', 'metric_threshold', 'desc',5555- 'long_desc', 'unit', 'compat', 'aggr_mode', 'event_grouping'5555+ 'long_desc', 'unit', 'compat', 'metricgroup_no_group', 'aggr_mode',5656+ 'event_grouping'5657]5758# Attributes that are bools or enum int values, encoded as '0', '1',...5859_json_enum_attributes = ['aggr_mode', 'deprecated', 'event_grouping', 'perpkg']···304303 self.deprecated = jd.get('Deprecated')305304 self.metric_name = jd.get('MetricName')306305 self.metric_group = jd.get('MetricGroup')306306+ self.metricgroup_no_group = jd.get('MetricgroupNoGroup')307307 self.event_grouping = convert_metric_constraint(jd.get('MetricConstraint'))308308 self.metric_expr = None309309 if 'MetricExpr' in jd:
···120120121121 p = "FOO/0";122122 ret = expr__parse(&val, ctx, p);123123- TEST_ASSERT_VAL("division by zero", ret == -1);123123+ TEST_ASSERT_VAL("division by zero", ret == 0);124124+ TEST_ASSERT_VAL("division by zero", isnan(val));124125125126 p = "BAR/";126127 ret = expr__parse(&val, ctx, p);
···2828 echo "stat record and report test [Success]"2929}30303131+test_stat_record_script() {3232+ echo "stat record and script test"3333+ if ! perf stat record -o - true | perf script -i - 2>&1 | \3434+ grep -E -q "CPU[[:space:]]+THREAD[[:space:]]+VAL[[:space:]]+ENA[[:space:]]+RUN[[:space:]]+TIME[[:space:]]+EVENT"3535+ then3636+ echo "stat record and script test [Failed]"3737+ err=13838+ return3939+ fi4040+ echo "stat record and script test [Success]"4141+}4242+3143test_stat_repeat_weak_groups() {3244 echo "stat repeat weak groups test"3345 if ! perf stat -e '{cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles}' \···1059310694test_default_stat10795test_stat_record_report9696+test_stat_record_script10897test_stat_repeat_weak_groups10998test_topdown_groups11099test_topdown_weak_groups
+7
tools/perf/tests/shell/test_intel_pt.sh
···506506 echo "perf record failed with --aux-sample"507507 return 1508508 fi509509+ # Check with event with PMU name510510+ if perf_record_no_decode -o "${perfdatafile}" -e br_misp_retired.all_branches:u uname ; then511511+ if ! perf_record_no_decode -o "${perfdatafile}" -e '{intel_pt//,br_misp_retired.all_branches/aux-sample-size=8192/}:u' uname ; then512512+ echo "perf record failed with --aux-sample-size"513513+ return 1514514+ fi515515+ fi509516 echo OK510517 return 0511518}
···290290 evsel->per_pkg_mask = NULL;291291 evsel->collect_stat = false;292292 evsel->pmu_name = NULL;293293+ evsel->skippable = false;293294}294295295296struct evsel *evsel__new_idx(struct perf_event_attr *attr, int idx)···829828830829const char *evsel__group_pmu_name(const struct evsel *evsel)831830{832832- const struct evsel *leader;831831+ struct evsel *leader = evsel__leader(evsel);832832+ struct evsel *pos;833833834834- /* If the pmu_name is set use it. pmu_name isn't set for CPU and software events. */835835- if (evsel->pmu_name)836836- return evsel->pmu_name;837834 /*838835 * Software events may be in a group with other uncore PMU events. Use839839- * the pmu_name of the group leader to avoid breaking the software event840840- * out of the group.836836+ * the pmu_name of the first non-software event to avoid breaking the837837+ * software event out of the group.841838 *842839 * Aux event leaders, like intel_pt, expect a group with events from843840 * other PMUs, so substitute the AUX event's PMU in this case.844841 */845845- leader = evsel__leader(evsel);846846- if ((evsel->core.attr.type == PERF_TYPE_SOFTWARE || evsel__is_aux_event(leader)) &&847847- leader->pmu_name) {848848- return leader->pmu_name;842842+ if (evsel->core.attr.type == PERF_TYPE_SOFTWARE || evsel__is_aux_event(leader)) {843843+ /* Starting with the leader, find the first event with a named PMU. */844844+ for_each_group_evsel(pos, leader) {845845+ if (pos->pmu_name)846846+ return pos->pmu_name;847847+ }849848 }850849851851- return "cpu";850850+ return evsel->pmu_name ?: "cpu";852851}853852854853const char *evsel__metric_id(const struct evsel *evsel)···17261725 return -1;1727172617281727 fd = FD(leader, cpu_map_idx, thread);17291729- BUG_ON(fd == -1);17281728+ BUG_ON(fd == -1 && !leader->skippable);1730172917311731- return fd;17301730+ /*17311731+ * When the leader has been skipped, return -2 to distinguish from no17321732+ * group leader case.17331733+ */17341734+ return fd == -1 ? -2 : fd;17321735}1733173617341737static void evsel__remove_fd(struct evsel *pos, int nr_cpus, int nr_threads, int thread_idx)···21132108 pid = perf_thread_map__pid(threads, thread);2114210921152110 group_fd = get_group_fd(evsel, idx, thread);21112111+21122112+ if (group_fd == -2) {21132113+ pr_debug("broken group leader for %s\n", evsel->name);21142114+ err = -EINVAL;21152115+ goto out_close;21162116+ }2116211721172118 test_attr__ready();21182119
···225225{226226 if (fpclassify($3.val) == FP_ZERO) {227227 pr_debug("division by zero\n");228228- YYABORT;228228+ assert($3.ids == NULL);229229+ if (compute_ids)230230+ ids__free($1.ids);231231+ $$.val = NAN;232232+ $$.ids = NULL;229233 } else if (!compute_ids || (is_const($1.val) && is_const($3.val))) {230234 assert($1.ids == NULL);231235 assert($3.ids == NULL);
+5-5
tools/perf/util/metricgroup.c
···11441144 struct metricgroup__add_metric_data *data = vdata;11451145 int ret = 0;1146114611471147- if (pm->metric_expr &&11481148- (match_metric(pm->metric_group, data->metric_name) ||11491149- match_metric(pm->metric_name, data->metric_name))) {11471147+ if (pm->metric_expr && match_pm_metric(pm, data->metric_name)) {11481148+ bool metric_no_group = data->metric_no_group ||11491149+ match_metric(data->metric_name, pm->metricgroup_no_group);1150115011511151 data->has_match = true;11521152- ret = add_metric(data->list, pm, data->modifier, data->metric_no_group,11521152+ ret = add_metric(data->list, pm, data->modifier, metric_no_group,11531153 data->metric_no_threshold, data->user_requested_cpu_list,11541154 data->system_wide, /*root_metric=*/NULL,11551155 /*visited_metrics=*/NULL, table);···16721672{16731673 unsigned int *max_level = data;16741674 unsigned int level;16751675- const char *p = strstr(pm->metric_group, "TopdownL");16751675+ const char *p = strstr(pm->metric_group ?: "", "TopdownL");1676167616771677 if (!p || p[8] == '\0')16781678 return 0;
+15-8
tools/perf/util/parse-events.c
···21402140 int *leader_idx = state;21412141 int lhs_leader_idx = *leader_idx, rhs_leader_idx = *leader_idx, ret;21422142 const char *lhs_pmu_name, *rhs_pmu_name;21432143+ bool lhs_has_group = false, rhs_has_group = false;2143214421442145 /*21452146 * First sort by grouping/leader. Read the leader idx only if the evsel21462147 * is part of a group, as -1 indicates no group.21472148 */21482148- if (lhs_core->leader != lhs_core || lhs_core->nr_members > 1)21492149+ if (lhs_core->leader != lhs_core || lhs_core->nr_members > 1) {21502150+ lhs_has_group = true;21492151 lhs_leader_idx = lhs_core->leader->idx;21502150- if (rhs_core->leader != rhs_core || rhs_core->nr_members > 1)21522152+ }21532153+ if (rhs_core->leader != rhs_core || rhs_core->nr_members > 1) {21542154+ rhs_has_group = true;21512155 rhs_leader_idx = rhs_core->leader->idx;21562156+ }2152215721532158 if (lhs_leader_idx != rhs_leader_idx)21542159 return lhs_leader_idx - rhs_leader_idx;2155216021562156- /* Group by PMU. Groups can't span PMUs. */21572157- lhs_pmu_name = evsel__group_pmu_name(lhs);21582158- rhs_pmu_name = evsel__group_pmu_name(rhs);21592159- ret = strcmp(lhs_pmu_name, rhs_pmu_name);21602160- if (ret)21612161- return ret;21612161+ /* Group by PMU if there is a group. Groups can't span PMUs. */21622162+ if (lhs_has_group && rhs_has_group) {21632163+ lhs_pmu_name = evsel__group_pmu_name(lhs);21642164+ rhs_pmu_name = evsel__group_pmu_name(rhs);21652165+ ret = strcmp(lhs_pmu_name, rhs_pmu_name);21662166+ if (ret)21672167+ return ret;21682168+ }2162216921632170 /* Architecture specific sorting. */21642171 return arch_evlist__cmp(lhs, rhs);
···403403 if (!aggr)404404 break;405405406406- /*407407- * If an event was scaled during stat gathering, reverse408408- * the scale before computing the metric.409409- */410410- val = aggr->counts.val * (1.0 / metric_events[i]->scale);411411- source_count = evsel__source_count(metric_events[i]);406406+ if (!metric_events[i]->supported) {407407+ /*408408+ * Not supported events will have a count of 0,409409+ * which can be confusing in a410410+ * metric. Explicitly set the value to NAN. Not411411+ * counted events (enable time of 0) are read as412412+ * 0.413413+ */414414+ val = NAN;415415+ source_count = 0;416416+ } else {417417+ /*418418+ * If an event was scaled during stat gathering,419419+ * reverse the scale before computing the420420+ * metric.421421+ */422422+ val = aggr->counts.val * (1.0 / metric_events[i]->scale);423423+ source_count = evsel__source_count(metric_events[i]);424424+ }412425 }413426 n = strdup(evsel__metric_id(metric_events[i]));414427 if (!n)
+16-7
tools/power/cpupower/lib/powercap.c
···4040{4141 int fd;4242 char yes_no;4343+ int ret = 0;43444445 *mode = 0;45464647 fd = open(path, O_RDONLY);4747- if (fd == -1)4848- return -1;4848+ if (fd == -1) {4949+ ret = -1;5050+ goto out;5151+ }49525053 if (read(fd, &yes_no, 1) != 1) {5151- close(fd);5252- return -1;5454+ ret = -1;5555+ goto out_close;5356 }54575558 if (yes_no == '1') {5659 *mode = 1;5757- return 0;6060+ goto out_close;5861 } else if (yes_no == '0') {5959- return 0;6262+ goto out_close;6363+ } else {6464+ ret = -1;6565+ goto out_close;6066 }6161- return -1;6767+out_close:6868+ close(fd);6969+out:7070+ return ret;6271}63726473int powercap_get_enabled(int *mode)
···1313echo " Options:"1414echo " -h|--help Show help message"1515echo " -k|--keep Keep passed test logs"1616+echo " -K|--ktap Output in KTAP format"1617echo " -v|--verbose Increase verbosity of test messages"1718echo " -vv Alias of -v -v (Show all results in stdout)"1819echo " -vvv Alias of -v -v -v (Show all commands immediately)"···8483 ;;8584 --keep|-k)8685 KEEP_LOG=18686+ shift 18787+ ;;8888+ --ktap|-K)8989+ KTAP=18790 shift 18891 ;;8992 --verbose|-v|-vv|-vvv)···183178TEST_CASES=`find_testcases $TEST_DIR`184179LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`/185180KEEP_LOG=0181181+KTAP=0186182DEBUG=0187183VERBOSE=0188184UNSUPPORTED_RESULT=0···235229 newline=236230 shift237231 fi238238- printf "$*$newline"232232+ [ "$KTAP" != "1" ] && printf "$*$newline"239233 [ "$LOG_FILE" ] && printf "$*$newline" | strip_esc >> $LOG_FILE240234}241235catlog() { #file···266260267261INSTANCE=268262CASENO=0263263+CASENAME=269264270265testcase() { # testfile271266 CASENO=$((CASENO+1))272272- desc=`grep "^#[ \t]*description:" $1 | cut -f2- -d:`273273- prlog -n "[$CASENO]$INSTANCE$desc"267267+ CASENAME=`grep "^#[ \t]*description:" $1 | cut -f2- -d:`274268}275269276270checkreq() { # testfile···283277 grep -q "^#[ \t]*flags:.*instance" $1284278}285279280280+ktaptest() { # result comment281281+ if [ "$KTAP" != "1" ]; then282282+ return283283+ fi284284+285285+ local result=286286+ if [ "$1" = "1" ]; then287287+ result="ok"288288+ else289289+ result="not ok"290290+ fi291291+ shift292292+293293+ local comment=$*294294+ if [ "$comment" != "" ]; then295295+ comment="# $comment"296296+ fi297297+298298+ echo $CASENO $result $INSTANCE$CASENAME $comment299299+}300300+286301eval_result() { # sigval287302 case $1 in288303 $PASS)289304 prlog " [${color_green}PASS${color_reset}]"305305+ ktaptest 1290306 PASSED_CASES="$PASSED_CASES $CASENO"291307 return 0292308 ;;293309 $FAIL)294310 prlog " [${color_red}FAIL${color_reset}]"311311+ ktaptest 0295312 FAILED_CASES="$FAILED_CASES $CASENO"296313 return 1 # this is a bug.297314 ;;298315 $UNRESOLVED)299316 prlog " [${color_blue}UNRESOLVED${color_reset}]"317317+ ktaptest 0 UNRESOLVED300318 UNRESOLVED_CASES="$UNRESOLVED_CASES $CASENO"301319 return $UNRESOLVED_RESULT # depends on use case302320 ;;303321 $UNTESTED)304322 prlog " [${color_blue}UNTESTED${color_reset}]"323323+ ktaptest 1 SKIP305324 UNTESTED_CASES="$UNTESTED_CASES $CASENO"306325 return 0307326 ;;308327 $UNSUPPORTED)309328 prlog " [${color_blue}UNSUPPORTED${color_reset}]"329329+ ktaptest 1 SKIP310330 UNSUPPORTED_CASES="$UNSUPPORTED_CASES $CASENO"311331 return $UNSUPPORTED_RESULT # depends on use case312332 ;;313333 $XFAIL)314334 prlog " [${color_green}XFAIL${color_reset}]"335335+ ktaptest 1 XFAIL315336 XFAILED_CASES="$XFAILED_CASES $CASENO"316337 return 0317338 ;;318339 *)319340 prlog " [${color_blue}UNDEFINED${color_reset}]"341341+ ktaptest 0 error320342 UNDEFINED_CASES="$UNDEFINED_CASES $CASENO"321343 return 1 # this must be a test bug322344 ;;···405371run_test() { # testfile406372 local testname=`basename $1`407373 testcase $1374374+ prlog -n "[$CASENO]$INSTANCE$CASENAME"408375 if [ ! -z "$LOG_FILE" ] ; then409376 local testlog=`mktemp $LOG_DIR/${CASENO}-${testname}-log.XXXXXX`410377 else···440405# load in the helper functions441406. $TEST_DIR/functions442407408408+if [ "$KTAP" = "1" ]; then409409+ echo "TAP version 13"410410+411411+ casecount=`echo $TEST_CASES | wc -w`412412+ for t in $TEST_CASES; do413413+ test_on_instance $t || continue414414+ casecount=$((casecount+1))415415+ done416416+ echo "1..${casecount}"417417+fi418418+443419# Main loop444420for t in $TEST_CASES; do445421 run_test $t···484438prlog "# of unsupported: " `echo $UNSUPPORTED_CASES | wc -w`485439prlog "# of xfailed: " `echo $XFAILED_CASES | wc -w`486440prlog "# of undefined(test bug): " `echo $UNDEFINED_CASES | wc -w`441441+442442+if [ "$KTAP" = "1" ]; then443443+ echo -n "# Totals:"444444+ echo -n " pass:"`echo $PASSED_CASES | wc -w`445445+ echo -n " faii:"`echo $FAILED_CASES | wc -w`446446+ echo -n " xfail:"`echo $XFAILED_CASES | wc -w`447447+ echo -n " xpass:0"448448+ echo -n " skip:"`echo $UNTESTED_CASES $UNSUPPORTED_CASES | wc -w`449449+ echo -n " error:"`echo $UNRESOLVED_CASES $UNDEFINED_CASES | wc -w`450450+ echo451451+fi487452488453cleanup489454
+8
tools/testing/selftests/ftrace/ftracetest-ktap
···11+#!/bin/sh -e22+# SPDX-License-Identifier: GPL-2.0-only33+#44+# ftracetest-ktap: Wrapper to integrate ftracetest with the kselftest runner55+#66+# Copyright (C) Arm Ltd., 202377+88+./ftracetest -K
···232232 local nsname=rt-${rt}233233234234 ip netns add ${nsname}235235+236236+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.accept_dad=0237237+ ip netns exec ${nsname} sysctl -wq net.ipv6.conf.default.accept_dad=0238238+235239 ip link set veth-rt-${rt} netns ${nsname}236240 ip -netns ${nsname} link set veth-rt-${rt} name veth0237241238238- ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0242242+ ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 nodad239243 ip -netns ${nsname} link set veth0 up240244 ip -netns ${nsname} link set lo up241245···258254259255 # set the networking for the host260256 ip netns add ${hsname}257257+258258+ # disable the rp_filter otherwise the kernel gets confused about how259259+ # to route decap ipv4 packets.260260+ ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0261261+ ip netns exec ${rtname} sysctl -wq net.ipv4.conf.default.rp_filter=0262262+261263 ip -netns ${hsname} link add veth0 type veth peer name ${rtveth}262264 ip -netns ${hsname} link set ${rtveth} netns ${rtname}263265 ip -netns ${hsname} addr add ${IPv4_HS_NETWORK}.${hs}/24 dev veth0···281271 ip -netns ${rtname} link set ${rtveth} up282272283273 ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.proxy_arp=1284284-285285- # disable the rp_filter otherwise the kernel gets confused about how286286- # to route decap ipv4 packets.287287- ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0288288- ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.rp_filter=0289274290275 ip netns exec ${rtname} sh -c "echo 1 > /proc/sys/net/vrf/strict_mode"291276}
···39623962 }3963396339643964 vcpu->vcpu_idx = atomic_read(&kvm->online_vcpus);39653965- r = xa_insert(&kvm->vcpu_array, vcpu->vcpu_idx, vcpu, GFP_KERNEL_ACCOUNT);39663966- BUG_ON(r == -EBUSY);39653965+ r = xa_reserve(&kvm->vcpu_array, vcpu->vcpu_idx, GFP_KERNEL_ACCOUNT);39673966 if (r)39683967 goto unlock_vcpu_destroy;3969396839703969 /* Now it's all set up, let userspace reach it */39713970 kvm_get_kvm(kvm);39723971 r = create_vcpu_fd(vcpu);39733973- if (r < 0) {39743974- xa_erase(&kvm->vcpu_array, vcpu->vcpu_idx);39753975- kvm_put_kvm_no_destroy(kvm);39763976- goto unlock_vcpu_destroy;39723972+ if (r < 0)39733973+ goto kvm_put_xa_release;39743974+39753975+ if (KVM_BUG_ON(!!xa_store(&kvm->vcpu_array, vcpu->vcpu_idx, vcpu, 0), kvm)) {39763976+ r = -EINVAL;39773977+ goto kvm_put_xa_release;39773978 }3978397939793980 /*···39893988 kvm_create_vcpu_debugfs(vcpu);39903989 return r;3991399039913991+kvm_put_xa_release:39923992+ kvm_put_kvm_no_destroy(kvm);39933993+ xa_release(&kvm->vcpu_array, vcpu->vcpu_idx);39923994unlock_vcpu_destroy:39933995 mutex_unlock(&kvm->lock);39943996 kvm_dirty_ring_free(&vcpu->dirty_ring);···51885184static int hardware_enable_all(void)51895185{51905186 atomic_t failed = ATOMIC_INIT(0);51915191- int r = 0;51875187+ int r;51885188+51895189+ /*51905190+ * Do not enable hardware virtualization if the system is going down.51915191+ * If userspace initiated a forced reboot, e.g. reboot -f, then it's51925192+ * possible for an in-flight KVM_CREATE_VM to trigger hardware enabling51935193+ * after kvm_reboot() is called. Note, this relies on system_state51945194+ * being set _before_ kvm_reboot(), which is why KVM uses a syscore ops51955195+ * hook instead of registering a dedicated reboot notifier (the latter51965196+ * runs before system_state is updated).51975197+ */51985198+ if (system_state == SYSTEM_HALT || system_state == SYSTEM_POWER_OFF ||51995199+ system_state == SYSTEM_RESTART)52005200+ return -EBUSY;5192520151935202 /*51945203 * When onlining a CPU, cpu_online_mask is set before kvm_online_cpu()···52135196 */52145197 cpus_read_lock();52155198 mutex_lock(&kvm_lock);51995199+52005200+ r = 0;5216520152175202 kvm_usage_count++;52185203 if (kvm_usage_count == 1) {···52325213 return r;52335214}5234521552355235-static int kvm_reboot(struct notifier_block *notifier, unsigned long val,52365236- void *v)52165216+static void kvm_shutdown(void)52375217{52385218 /*52395239- * Some (well, at least mine) BIOSes hang on reboot if52405240- * in vmx root mode.52415241- *52425242- * And Intel TXT required VMX off for all cpu when system shutdown.52195219+ * Disable hardware virtualization and set kvm_rebooting to indicate52205220+ * that KVM has asynchronously disabled hardware virtualization, i.e.52215221+ * that relevant errors and exceptions aren't entirely unexpected.52225222+ * Some flavors of hardware virtualization need to be disabled before52235223+ * transferring control to firmware (to perform shutdown/reboot), e.g.52245224+ * on x86, virtualization can block INIT interrupts, which are used by52255225+ * firmware to pull APs back under firmware control. Note, this path52265226+ * is used for both shutdown and reboot scenarios, i.e. neither name is52275227+ * 100% comprehensive.52435228 */52445229 pr_info("kvm: exiting hardware virtualization\n");52455230 kvm_rebooting = true;52465231 on_each_cpu(hardware_disable_nolock, NULL, 1);52475247- return NOTIFY_OK;52485232}52495249-52505250-static struct notifier_block kvm_reboot_notifier = {52515251- .notifier_call = kvm_reboot,52525252- .priority = 0,52535253-};5254523352555234static int kvm_suspend(void)52565235{···52805263static struct syscore_ops kvm_syscore_ops = {52815264 .suspend = kvm_suspend,52825265 .resume = kvm_resume,52665266+ .shutdown = kvm_shutdown,52835267};52845268#else /* CONFIG_KVM_GENERIC_HARDWARE_ENABLING */52855269static int hardware_enable_all(void)···59855967 if (r)59865968 return r;5987596959885988- register_reboot_notifier(&kvm_reboot_notifier);59895970 register_syscore_ops(&kvm_syscore_ops);59905971#endif59915972···60566039err_vcpu_cache:60576040#ifdef CONFIG_KVM_GENERIC_HARDWARE_ENABLING60586041 unregister_syscore_ops(&kvm_syscore_ops);60596059- unregister_reboot_notifier(&kvm_reboot_notifier);60606042 cpuhp_remove_state_nocalls(CPUHP_AP_KVM_ONLINE);60616043#endif60626044 return r;···60816065 kvm_async_pf_deinit();60826066#ifdef CONFIG_KVM_GENERIC_HARDWARE_ENABLING60836067 unregister_syscore_ops(&kvm_syscore_ops);60846084- unregister_reboot_notifier(&kvm_reboot_notifier);60856068 cpuhp_remove_state_nocalls(CPUHP_AP_KVM_ONLINE);60866069#endif60876070 kvm_irqfd_exit();