提交 71e3343b 编写于 作者: T Tan Xiaojun 提交者: Xie XiuQi

arm_spe: add --spe=t for true_sharing in spe-c2c

hulk inclusion
category: feature
bugzilla: 18657
CVE: NA

-------------------------------------------

Add new option --spe=t for true_sharing in spe-c2c, default is no.
Signed-off-by: NTan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NXuefeng Wang <wxf.wang@hisilicon.com>
Reviewed-by: NTan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3e2d6d53
...@@ -751,8 +751,10 @@ static void arm_spe_c2c_get_samples(void *arg) ...@@ -751,8 +751,10 @@ static void arm_spe_c2c_get_samples(void *arg)
struct rb_root *listB = ((struct spe_c2c_compare_lists *)arg)->listB; struct rb_root *listB = ((struct spe_c2c_compare_lists *)arg)->listB;
struct spe_c2c_sample_queues *queues = ((struct spe_c2c_compare_lists *)arg)->queues; struct spe_c2c_sample_queues *queues = ((struct spe_c2c_compare_lists *)arg)->queues;
struct spe_c2c_sample_queues *oppoqs = ((struct spe_c2c_compare_lists *)arg)->oppoqs; struct spe_c2c_sample_queues *oppoqs = ((struct spe_c2c_compare_lists *)arg)->oppoqs;
struct arm_spe_queue *speq = queues->speq;
struct rb_node *nodeA, *nodeB; struct rb_node *nodeA, *nodeB;
struct spe_c2c_sample *sampleA, *sampleB; struct spe_c2c_sample *sampleA, *sampleB;
bool tshare = speq->spe->synth_opts.c2c_tshare;
uint64_t xor; uint64_t xor;
for (nodeA = rb_first(listA); nodeA; nodeA = rb_next(nodeA)) { for (nodeA = rb_first(listA); nodeA; nodeA = rb_next(nodeA)) {
...@@ -761,8 +763,9 @@ static void arm_spe_c2c_get_samples(void *arg) ...@@ -761,8 +763,9 @@ static void arm_spe_c2c_get_samples(void *arg)
sampleB = rb_entry(nodeB, struct spe_c2c_sample, rb_node); sampleB = rb_entry(nodeB, struct spe_c2c_sample, rb_node);
xor = sampleA->state.phys_addr ^ sampleB->state.phys_addr; xor = sampleA->state.phys_addr ^ sampleB->state.phys_addr;
if (!(xor & 0xFFFFFFFFFFFFFFC0) && (xor & 0x3F) if (!(xor & 0xFFFFFFFFFFFFFFC0)
&& sampleA->tid != sampleB->tid) { && (tshare || (xor & 0x3F))
&& (sampleA->tid != sampleB->tid)) {
pthread_mutex_lock(&mut); pthread_mutex_lock(&mut);
arm_spe_c2c_sample(queues, sampleA); arm_spe_c2c_sample(queues, sampleA);
arm_spe_c2c_sample(oppoqs, sampleB); arm_spe_c2c_sample(oppoqs, sampleB);
......
...@@ -1144,6 +1144,7 @@ void arm_spe_synth_opts__set_default(struct arm_spe_synth_opts *synth_opts) ...@@ -1144,6 +1144,7 @@ void arm_spe_synth_opts__set_default(struct arm_spe_synth_opts *synth_opts)
synth_opts->remote_access = true; synth_opts->remote_access = true;
synth_opts->c2c_remote = false; synth_opts->c2c_remote = false;
synth_opts->c2c_store = false; synth_opts->c2c_store = false;
synth_opts->c2c_tshare = false;
} }
int arm_spe_parse_synth_opts(const struct option *opt, const char *str, int arm_spe_parse_synth_opts(const struct option *opt, const char *str,
...@@ -1165,7 +1166,10 @@ int arm_spe_parse_synth_opts(const struct option *opt, const char *str, ...@@ -1165,7 +1166,10 @@ int arm_spe_parse_synth_opts(const struct option *opt, const char *str,
synth_opts->llc_miss = true; synth_opts->llc_miss = true;
break; break;
case 't': case 't':
synth_opts->tlb_miss = true; if (synth_opts->c2c_mode)
synth_opts->c2c_tshare = true;
else
synth_opts->tlb_miss = true;
break; break;
case 'b': case 'b':
synth_opts->branch_miss = true; synth_opts->branch_miss = true;
......
...@@ -121,6 +121,7 @@ struct arm_spe_synth_opts { ...@@ -121,6 +121,7 @@ struct arm_spe_synth_opts {
bool c2c_mode; bool c2c_mode;
bool c2c_remote; bool c2c_remote;
bool c2c_store; bool c2c_store;
bool c2c_tshare;
}; };
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册