- Make sure the array tracking which kernel text positions need to be
alternatives-patched doesn't get mishandled by out-of-order modifications, leading to it overflowing and causing page faults when patching - Avoid an infinite loop when early code does a ranged TLB invalidation before the broadcast TLB invalidation count of how many pages it can flush, has been read from CPUID - Fix a CONFIG_MODULES typo - Disable broadcast TLB invalidation when PTI is enabled to avoid an overflow of the bitmap tracking dynamic ASIDs which need to be flushed when the kernel switches between the user and kernel address space - Handle the case of a CPU going offline and thus reporting zeroes when reading top-level events in the resctrl code -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmhXwaMACgkQEsHwGGHe VUr6OQ//ThzgO6GdONGcLgTdiQ/c3Ug9tUf3k3uUeZhGp7MypEZgwBzHcU6jbkcX XYOdV5wJw+eetyj1/ueJqXBvQRWox6lOT064RZDwmmtJCRcSSAOxa5lbrHfnlgcd y9j7ml5cS/NzIfldiSynlE523SiYz2EOV0x0kY3xGkHdOT98VJHOpahgaaWmizvQ MEnv1AosYFGlwonq5kGu0vV8V4N0VRIe7/FjAxSuSNLUHwVdACqX9oyAdYbyw09p oNZjpozBJBNe70Wkg35ijQKlNGKkngwnPILmRgjZwHDH2FIRzrr6CqmHx6z336b+ FkThRmVzJZfhtQVFM9V/prBB3GW8j/zIm61j67iz2yJW1Biz3xJKnUT+s7jd4ARr gGBAB+41UoaPsVKrrSQYlCsrFkUWn6b4AFT+l1eQDgnuc+ajX+OyHHXC+qVrBUbK lL80EoYyPrEMh8pP9wx7hdtVCvOTOSSSdFPe7RrnaT7satoBI/Aemz9tZqVzmkCs 48iLZ4Xbwswo8U9mKIwap3IksG43LvDLWK1ydw+U6OzBuYGmu148JcSBKO3G1uhm YkRvmykNTxKO62mki8Wc86VP5IB5KxBcS6nO6GAGT3vsKPrkzi2GkqvaDi6Z0bEL 1kjIaN/XKG4OQglba/DWoRLBXmd9LtsVrCJ1QGuY+ejYUJYLLMA= =NT0q -----END PGP SIGNATURE----- Merge tag 'x86_urgent_for_v6.16_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Make sure the array tracking which kernel text positions need to be alternatives-patched doesn't get mishandled by out-of-order modifications, leading to it overflowing and causing page faults when patching - Avoid an infinite loop when early code does a ranged TLB invalidation before the broadcast TLB invalidation count of how many pages it can flush, has been read from CPUID - Fix a CONFIG_MODULES typo - Disable broadcast TLB invalidation when PTI is enabled to avoid an overflow of the bitmap tracking dynamic ASIDs which need to be flushed when the kernel switches between the user and kernel address space - Handle the case of a CPU going offline and thus reporting zeroes when reading top-level events in the resctrl code * tag 'x86_urgent_for_v6.16_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/alternatives: Fix int3 handling failure from broken text_poke array x86/mm: Fix early boot use of INVPLGB x86/its: Fix an ifdef typo in its_alloc() x86/mm: Disable INVLPGB when PTI is enabled x86,fs/resctrl: Remove inappropriate references to cacheinfo in the resctrl subsystempull/1270/merge
commit
5c00eca95a
|
|
@ -228,7 +228,7 @@ static void *its_alloc(void)
|
|||
struct its_array *pages = &its_pages;
|
||||
void *page;
|
||||
|
||||
#ifdef CONFIG_MODULE
|
||||
#ifdef CONFIG_MODULES
|
||||
if (its_mod)
|
||||
pages = &its_mod->arch.its_pages;
|
||||
#endif
|
||||
|
|
@ -3138,6 +3138,6 @@ void __ref smp_text_poke_batch_add(void *addr, const void *opcode, size_t len, c
|
|||
*/
|
||||
void __ref smp_text_poke_single(void *addr, const void *opcode, size_t len, const void *emulate)
|
||||
{
|
||||
__smp_text_poke_batch_add(addr, opcode, len, emulate);
|
||||
smp_text_poke_batch_add(addr, opcode, len, emulate);
|
||||
smp_text_poke_batch_finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include "cpu.h"
|
||||
|
||||
u16 invlpgb_count_max __ro_after_init;
|
||||
u16 invlpgb_count_max __ro_after_init = 1;
|
||||
|
||||
static inline int rdmsrq_amd_safe(unsigned msr, u64 *p)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -498,6 +498,7 @@ static void domain_add_cpu_mon(int cpu, struct rdt_resource *r)
|
|||
struct rdt_hw_mon_domain *hw_dom;
|
||||
struct rdt_domain_hdr *hdr;
|
||||
struct rdt_mon_domain *d;
|
||||
struct cacheinfo *ci;
|
||||
int err;
|
||||
|
||||
lockdep_assert_held(&domain_list_lock);
|
||||
|
|
@ -525,12 +526,13 @@ static void domain_add_cpu_mon(int cpu, struct rdt_resource *r)
|
|||
d = &hw_dom->d_resctrl;
|
||||
d->hdr.id = id;
|
||||
d->hdr.type = RESCTRL_MON_DOMAIN;
|
||||
d->ci = get_cpu_cacheinfo_level(cpu, RESCTRL_L3_CACHE);
|
||||
if (!d->ci) {
|
||||
ci = get_cpu_cacheinfo_level(cpu, RESCTRL_L3_CACHE);
|
||||
if (!ci) {
|
||||
pr_warn_once("Can't find L3 cache for CPU:%d resource %s\n", cpu, r->name);
|
||||
mon_domain_free(hw_dom);
|
||||
return;
|
||||
}
|
||||
d->ci_id = ci->id;
|
||||
cpumask_set_cpu(cpu, &d->hdr.cpu_mask);
|
||||
|
||||
arch_mon_domain_online(r, d);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,11 @@ void __init pti_check_boottime_disable(void)
|
|||
return;
|
||||
|
||||
setup_force_cpu_cap(X86_FEATURE_PTI);
|
||||
|
||||
if (cpu_feature_enabled(X86_FEATURE_INVLPGB)) {
|
||||
pr_debug("PTI enabled, disabling INVLPGB\n");
|
||||
setup_clear_cpu_cap(X86_FEATURE_INVLPGB);
|
||||
}
|
||||
}
|
||||
|
||||
static int __init pti_parse_cmdline(char *arg)
|
||||
|
|
|
|||
|
|
@ -594,9 +594,10 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg)
|
|||
struct rmid_read rr = {0};
|
||||
struct rdt_mon_domain *d;
|
||||
struct rdtgroup *rdtgrp;
|
||||
int domid, cpu, ret = 0;
|
||||
struct rdt_resource *r;
|
||||
struct cacheinfo *ci;
|
||||
struct mon_data *md;
|
||||
int domid, ret = 0;
|
||||
|
||||
rdtgrp = rdtgroup_kn_lock_live(of->kn);
|
||||
if (!rdtgrp) {
|
||||
|
|
@ -623,10 +624,14 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg)
|
|||
* one that matches this cache id.
|
||||
*/
|
||||
list_for_each_entry(d, &r->mon_domains, hdr.list) {
|
||||
if (d->ci->id == domid) {
|
||||
rr.ci = d->ci;
|
||||
if (d->ci_id == domid) {
|
||||
rr.ci_id = d->ci_id;
|
||||
cpu = cpumask_any(&d->hdr.cpu_mask);
|
||||
ci = get_cpu_cacheinfo_level(cpu, RESCTRL_L3_CACHE);
|
||||
if (!ci)
|
||||
continue;
|
||||
mon_event_read(&rr, r, NULL, rdtgrp,
|
||||
&d->ci->shared_cpu_map, evtid, false);
|
||||
&ci->shared_cpu_map, evtid, false);
|
||||
goto checkresult;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ struct mon_data {
|
|||
* domains in @r sharing L3 @ci.id
|
||||
* @evtid: Which monitor event to read.
|
||||
* @first: Initialize MBM counter when true.
|
||||
* @ci: Cacheinfo for L3. Only set when @d is NULL. Used when summing domains.
|
||||
* @ci_id: Cacheinfo id for L3. Only set when @d is NULL. Used when summing domains.
|
||||
* @err: Error encountered when reading counter.
|
||||
* @val: Returned value of event counter. If @rgrp is a parent resource group,
|
||||
* @val includes the sum of event counts from its child resource groups.
|
||||
|
|
@ -112,7 +112,7 @@ struct rmid_read {
|
|||
struct rdt_mon_domain *d;
|
||||
enum resctrl_event_id evtid;
|
||||
bool first;
|
||||
struct cacheinfo *ci;
|
||||
unsigned int ci_id;
|
||||
int err;
|
||||
u64 val;
|
||||
void *arch_mon_ctx;
|
||||
|
|
|
|||
|
|
@ -361,6 +361,7 @@ static int __mon_event_count(u32 closid, u32 rmid, struct rmid_read *rr)
|
|||
{
|
||||
int cpu = smp_processor_id();
|
||||
struct rdt_mon_domain *d;
|
||||
struct cacheinfo *ci;
|
||||
struct mbm_state *m;
|
||||
int err, ret;
|
||||
u64 tval = 0;
|
||||
|
|
@ -388,7 +389,8 @@ static int __mon_event_count(u32 closid, u32 rmid, struct rmid_read *rr)
|
|||
}
|
||||
|
||||
/* Summing domains that share a cache, must be on a CPU for that cache. */
|
||||
if (!cpumask_test_cpu(cpu, &rr->ci->shared_cpu_map))
|
||||
ci = get_cpu_cacheinfo_level(cpu, RESCTRL_L3_CACHE);
|
||||
if (!ci || ci->id != rr->ci_id)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
|
|
@ -400,7 +402,7 @@ static int __mon_event_count(u32 closid, u32 rmid, struct rmid_read *rr)
|
|||
*/
|
||||
ret = -EINVAL;
|
||||
list_for_each_entry(d, &rr->r->mon_domains, hdr.list) {
|
||||
if (d->ci->id != rr->ci->id)
|
||||
if (d->ci_id != rr->ci_id)
|
||||
continue;
|
||||
err = resctrl_arch_rmid_read(rr->r, d, closid, rmid,
|
||||
rr->evtid, &tval, rr->arch_mon_ctx);
|
||||
|
|
|
|||
|
|
@ -3036,7 +3036,7 @@ static void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
|
|||
char name[32];
|
||||
|
||||
snc_mode = r->mon_scope == RESCTRL_L3_NODE;
|
||||
sprintf(name, "mon_%s_%02d", r->name, snc_mode ? d->ci->id : d->hdr.id);
|
||||
sprintf(name, "mon_%s_%02d", r->name, snc_mode ? d->ci_id : d->hdr.id);
|
||||
if (snc_mode)
|
||||
sprintf(subname, "mon_sub_%s_%02d", r->name, d->hdr.id);
|
||||
|
||||
|
|
@ -3061,7 +3061,7 @@ static int mon_add_all_files(struct kernfs_node *kn, struct rdt_mon_domain *d,
|
|||
return -EPERM;
|
||||
|
||||
list_for_each_entry(mevt, &r->evt_list, list) {
|
||||
domid = do_sum ? d->ci->id : d->hdr.id;
|
||||
domid = do_sum ? d->ci_id : d->hdr.id;
|
||||
priv = mon_get_kn_priv(r->rid, domid, mevt, do_sum);
|
||||
if (WARN_ON_ONCE(!priv))
|
||||
return -EINVAL;
|
||||
|
|
@ -3089,7 +3089,7 @@ static int mkdir_mondata_subdir(struct kernfs_node *parent_kn,
|
|||
lockdep_assert_held(&rdtgroup_mutex);
|
||||
|
||||
snc_mode = r->mon_scope == RESCTRL_L3_NODE;
|
||||
sprintf(name, "mon_%s_%02d", r->name, snc_mode ? d->ci->id : d->hdr.id);
|
||||
sprintf(name, "mon_%s_%02d", r->name, snc_mode ? d->ci_id : d->hdr.id);
|
||||
kn = kernfs_find_and_get(parent_kn, name);
|
||||
if (kn) {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ struct rdt_ctrl_domain {
|
|||
/**
|
||||
* struct rdt_mon_domain - group of CPUs sharing a resctrl monitor resource
|
||||
* @hdr: common header for different domain types
|
||||
* @ci: cache info for this domain
|
||||
* @ci_id: cache info id for this domain
|
||||
* @rmid_busy_llc: bitmap of which limbo RMIDs are above threshold
|
||||
* @mbm_total: saved state for MBM total bandwidth
|
||||
* @mbm_local: saved state for MBM local bandwidth
|
||||
|
|
@ -170,7 +170,7 @@ struct rdt_ctrl_domain {
|
|||
*/
|
||||
struct rdt_mon_domain {
|
||||
struct rdt_domain_hdr hdr;
|
||||
struct cacheinfo *ci;
|
||||
unsigned int ci_id;
|
||||
unsigned long *rmid_busy_llc;
|
||||
struct mbm_state *mbm_total;
|
||||
struct mbm_state *mbm_local;
|
||||
|
|
|
|||
Loading…
Reference in New Issue