Skip to content

Commit efc775e

Browse files
author
James Morse
committed
arm_mpam: resctrl: Add empty definitions for assorted resctrl functions
A few resctrl features and hooks need to be provided, but aren't needed or supported on MPAM platforms. resctrl has individual hooks to separately enable and disable the closid/partid and rmid/pmg context switching code. For MPAM this is all the same thing, as the value in struct task_struct is used to cache the value that should be written to hardware. arm64's context switching code is enabled once MPAM is usable, but doesn't touch the hardware unless the value has changed. For now event configuration is not supported, and can be turned off by returning 'false' from resctrl_arch_is_evt_configurable(). The new io_alloc feature is not supported either, always return false from the enable helper to indicate and fail the enable. Add this, and empty definitions for the other hooks. Tested-by: Gavin Shan <gshan@redhat.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Tested-by: Peter Newman <peternewman@google.com> Tested-by: Zeng Heng <zengheng4@huawei.com> Tested-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com> Tested-by: Jesse Chick <jessechick@os.amperecomputing.com> Reviewed-by: Zeng Heng <zengheng4@huawei.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Co-developed-by: Ben Horgan <ben.horgan@arm.com> Signed-off-by: Ben Horgan <ben.horgan@arm.com> Signed-off-by: James Morse <james.morse@arm.com>
1 parent 49b04e4 commit efc775e

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

drivers/resctrl/mpam_resctrl.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,71 @@ bool resctrl_arch_mon_capable(void)
9191
return l3->mon_capable;
9292
}
9393

94+
bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt)
95+
{
96+
return false;
97+
}
98+
99+
void resctrl_arch_mon_event_config_read(void *info)
100+
{
101+
}
102+
103+
void resctrl_arch_mon_event_config_write(void *info)
104+
{
105+
}
106+
107+
void resctrl_arch_reset_rmid_all(struct rdt_resource *r, struct rdt_l3_mon_domain *d)
108+
{
109+
}
110+
111+
void resctrl_arch_reset_rmid(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
112+
u32 closid, u32 rmid, enum resctrl_event_id eventid)
113+
{
114+
}
115+
116+
void resctrl_arch_reset_cntr(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
117+
u32 closid, u32 rmid, int cntr_id,
118+
enum resctrl_event_id eventid)
119+
{
120+
}
121+
122+
void resctrl_arch_config_cntr(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
123+
enum resctrl_event_id evtid, u32 rmid, u32 closid,
124+
u32 cntr_id, bool assign)
125+
{
126+
}
127+
128+
int resctrl_arch_cntr_read(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
129+
u32 unused, u32 rmid, int cntr_id,
130+
enum resctrl_event_id eventid, u64 *val)
131+
{
132+
return -EOPNOTSUPP;
133+
}
134+
135+
bool resctrl_arch_mbm_cntr_assign_enabled(struct rdt_resource *r)
136+
{
137+
return false;
138+
}
139+
140+
int resctrl_arch_mbm_cntr_assign_set(struct rdt_resource *r, bool enable)
141+
{
142+
return -EINVAL;
143+
}
144+
145+
int resctrl_arch_io_alloc_enable(struct rdt_resource *r, bool enable)
146+
{
147+
return -EOPNOTSUPP;
148+
}
149+
150+
bool resctrl_arch_get_io_alloc_enabled(struct rdt_resource *r)
151+
{
152+
return false;
153+
}
154+
155+
void resctrl_arch_pre_mount(void)
156+
{
157+
}
158+
94159
bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level rid)
95160
{
96161
return mpam_resctrl_controls[rid].cdp_enabled;

include/linux/arm_mpam.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ struct rdt_resource;
6767
void *resctrl_arch_mon_ctx_alloc(struct rdt_resource *r, enum resctrl_event_id evtid);
6868
void resctrl_arch_mon_ctx_free(struct rdt_resource *r, enum resctrl_event_id evtid, void *ctx);
6969

70+
/*
71+
* The CPU configuration for MPAM is cheap to write, and is only written if it
72+
* has changed. No need for fine grained enables.
73+
*/
74+
static inline void resctrl_arch_enable_mon(void) { }
75+
static inline void resctrl_arch_disable_mon(void) { }
76+
static inline void resctrl_arch_enable_alloc(void) { }
77+
static inline void resctrl_arch_disable_alloc(void) { }
78+
7079
static inline unsigned int resctrl_arch_round_mon_val(unsigned int val)
7180
{
7281
return val;

0 commit comments

Comments
 (0)