diff options
-rw-r--r-- | arch/x86/include/asm/intel_rdt.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_rdt.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 62 |
3 files changed, 62 insertions, 2 deletions
diff --git a/arch/x86/include/asm/intel_rdt.h b/arch/x86/include/asm/intel_rdt.h index b0f0a600c739..167fe10f00b9 100644 --- a/arch/x86/include/asm/intel_rdt.h +++ b/arch/x86/include/asm/intel_rdt.h | |||
@@ -174,6 +174,7 @@ struct rdt_resource { | |||
174 | }; | 174 | }; |
175 | 175 | ||
176 | void rdt_get_cache_infofile(struct rdt_resource *r); | 176 | void rdt_get_cache_infofile(struct rdt_resource *r); |
177 | void rdt_get_mba_infofile(struct rdt_resource *r); | ||
177 | 178 | ||
178 | extern struct mutex rdtgroup_mutex; | 179 | extern struct mutex rdtgroup_mutex; |
179 | 180 | ||
diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c index b387e04885be..438efefd6862 100644 --- a/arch/x86/kernel/cpu/intel_rdt.c +++ b/arch/x86/kernel/cpu/intel_rdt.c | |||
@@ -203,6 +203,7 @@ static bool rdt_get_mem_config(struct rdt_resource *r) | |||
203 | return false; | 203 | return false; |
204 | } | 204 | } |
205 | r->data_width = 3; | 205 | r->data_width = 3; |
206 | rdt_get_mba_infofile(r); | ||
206 | 207 | ||
207 | r->capable = true; | 208 | r->capable = true; |
208 | r->enabled = true; | 209 | r->enabled = true; |
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 65d957b96567..f5af0cc7eb0d 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | |||
@@ -515,7 +515,6 @@ static int rdt_num_closids_show(struct kernfs_open_file *of, | |||
515 | struct rdt_resource *r = of->kn->parent->priv; | 515 | struct rdt_resource *r = of->kn->parent->priv; |
516 | 516 | ||
517 | seq_printf(seq, "%d\n", r->num_closid); | 517 | seq_printf(seq, "%d\n", r->num_closid); |
518 | |||
519 | return 0; | 518 | return 0; |
520 | } | 519 | } |
521 | 520 | ||
@@ -525,7 +524,6 @@ static int rdt_default_ctrl_show(struct kernfs_open_file *of, | |||
525 | struct rdt_resource *r = of->kn->parent->priv; | 524 | struct rdt_resource *r = of->kn->parent->priv; |
526 | 525 | ||
527 | seq_printf(seq, "%x\n", r->default_ctrl); | 526 | seq_printf(seq, "%x\n", r->default_ctrl); |
528 | |||
529 | return 0; | 527 | return 0; |
530 | } | 528 | } |
531 | 529 | ||
@@ -535,7 +533,33 @@ static int rdt_min_cbm_bits_show(struct kernfs_open_file *of, | |||
535 | struct rdt_resource *r = of->kn->parent->priv; | 533 | struct rdt_resource *r = of->kn->parent->priv; |
536 | 534 | ||
537 | seq_printf(seq, "%u\n", r->cache.min_cbm_bits); | 535 | seq_printf(seq, "%u\n", r->cache.min_cbm_bits); |
536 | return 0; | ||
537 | } | ||
538 | |||
539 | static int rdt_min_bw_show(struct kernfs_open_file *of, | ||
540 | struct seq_file *seq, void *v) | ||
541 | { | ||
542 | struct rdt_resource *r = of->kn->parent->priv; | ||
538 | 543 | ||
544 | seq_printf(seq, "%u\n", r->membw.min_bw); | ||
545 | return 0; | ||
546 | } | ||
547 | |||
548 | static int rdt_bw_gran_show(struct kernfs_open_file *of, | ||
549 | struct seq_file *seq, void *v) | ||
550 | { | ||
551 | struct rdt_resource *r = of->kn->parent->priv; | ||
552 | |||
553 | seq_printf(seq, "%u\n", r->membw.bw_gran); | ||
554 | return 0; | ||
555 | } | ||
556 | |||
557 | static int rdt_delay_linear_show(struct kernfs_open_file *of, | ||
558 | struct seq_file *seq, void *v) | ||
559 | { | ||
560 | struct rdt_resource *r = of->kn->parent->priv; | ||
561 | |||
562 | seq_printf(seq, "%u\n", r->membw.delay_linear); | ||
539 | return 0; | 563 | return 0; |
540 | } | 564 | } |
541 | 565 | ||
@@ -561,6 +585,40 @@ static struct rftype res_cache_info_files[] = { | |||
561 | }, | 585 | }, |
562 | }; | 586 | }; |
563 | 587 | ||
588 | /* rdtgroup information files for memory bandwidth. */ | ||
589 | static struct rftype res_mba_info_files[] = { | ||
590 | { | ||
591 | .name = "num_closids", | ||
592 | .mode = 0444, | ||
593 | .kf_ops = &rdtgroup_kf_single_ops, | ||
594 | .seq_show = rdt_num_closids_show, | ||
595 | }, | ||
596 | { | ||
597 | .name = "min_bandwidth", | ||
598 | .mode = 0444, | ||
599 | .kf_ops = &rdtgroup_kf_single_ops, | ||
600 | .seq_show = rdt_min_bw_show, | ||
601 | }, | ||
602 | { | ||
603 | .name = "bandwidth_gran", | ||
604 | .mode = 0444, | ||
605 | .kf_ops = &rdtgroup_kf_single_ops, | ||
606 | .seq_show = rdt_bw_gran_show, | ||
607 | }, | ||
608 | { | ||
609 | .name = "delay_linear", | ||
610 | .mode = 0444, | ||
611 | .kf_ops = &rdtgroup_kf_single_ops, | ||
612 | .seq_show = rdt_delay_linear_show, | ||
613 | }, | ||
614 | }; | ||
615 | |||
616 | void rdt_get_mba_infofile(struct rdt_resource *r) | ||
617 | { | ||
618 | r->info_files = res_mba_info_files; | ||
619 | r->nr_info_files = ARRAY_SIZE(res_mba_info_files); | ||
620 | } | ||
621 | |||
564 | void rdt_get_cache_infofile(struct rdt_resource *r) | 622 | void rdt_get_cache_infofile(struct rdt_resource *r) |
565 | { | 623 | { |
566 | r->info_files = res_cache_info_files; | 624 | r->info_files = res_cache_info_files; |