[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 22/29] plugins/cache: limited the scope of a mutex lock
From: |
Alex Bennée |
Subject: |
[PATCH v1 22/29] plugins/cache: limited the scope of a mutex lock |
Date: |
Wed, 21 Jul 2021 00:26:56 +0100 |
From: Mahmoud Mandour <ma.mandourr@gmail.com>
It's not necessary to lock the address translation portion of the
vcpu_mem_access callback.
Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210714172151.8494-3-ma.mandourr@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
contrib/plugins/cache.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c
index 4a71602639..695fb969dc 100644
--- a/contrib/plugins/cache.c
+++ b/contrib/plugins/cache.c
@@ -355,15 +355,14 @@ static void vcpu_mem_access(unsigned int vcpu_index,
qemu_plugin_meminfo_t info,
struct qemu_plugin_hwaddr *hwaddr;
InsnData *insn;
- g_mutex_lock(&mtx);
hwaddr = qemu_plugin_get_hwaddr(info, vaddr);
if (hwaddr && qemu_plugin_hwaddr_is_io(hwaddr)) {
- g_mutex_unlock(&mtx);
return;
}
effective_addr = hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vaddr;
+ g_mutex_lock(&mtx);
if (!access_cache(dcache, effective_addr)) {
insn = (InsnData *) userdata;
insn->dmisses++;
--
2.32.0.264.g75ae10bc75
- [PATCH v1 12/29] contrib/gitdm: add domain-map/group-map for Wind River, (continued)
- [PATCH v1 12/29] contrib/gitdm: add domain-map/group-map for Wind River, Alex Bennée, 2021/07/20
- [PATCH v1 10/29] contrib/gitdm: add domain-map/group-map mappings for Samsung, Alex Bennée, 2021/07/20
- [PATCH v1 23/29] plugins/cache: Fixed "function decl. is not a prototype" warnings, Alex Bennée, 2021/07/20
- [PATCH v1 11/29] contrib/gitdm: add domain-map for Eldorado, Alex Bennée, 2021/07/20
- [PATCH v1 17/29] contrib/gitdm: add an explicit academic entry for BU, Alex Bennée, 2021/07/20
- [PATCH v1 15/29] contrib/gitdm: add domain-map for NVIDIA, Alex Bennée, 2021/07/20
- [PATCH v1 19/29] contrib/gitdm: add more individual contributor entries., Alex Bennée, 2021/07/20
- [PATCH v1 25/29] hw/tricore: fix inclusion of tricore_testboard, Alex Bennée, 2021/07/20
- [PATCH v1 27/29] gitlab: enable a very minimal build with the tricore container, Alex Bennée, 2021/07/20
- [PATCH v1 26/29] tests/tcg/configure.sh: add handling for assembler only builds, Alex Bennée, 2021/07/20
- [PATCH v1 22/29] plugins/cache: limited the scope of a mutex lock,
Alex Bennée <=
- [PATCH v1 14/29] contrib/gitdm: add domain-map for Crudebyte, Alex Bennée, 2021/07/20
- [PATCH v1 24/29] plugins: Fix physical address calculation for IO regions, Alex Bennée, 2021/07/20
- [PATCH v1 18/29] contrib/gitdm: add a new interns group-map for GSoC/Outreachy work, Alex Bennée, 2021/07/20
- [PATCH v1 16/29] contrib/gitdm: add group-map for Netflix, Alex Bennée, 2021/07/20
- [PATCH v1 21/29] plugins/cache: Fixed a bug with destroying FIFO metadata, Alex Bennée, 2021/07/20
- [PATCH v1 20/29] tcg/plugins: implement a qemu_plugin_user_exit helper, Alex Bennée, 2021/07/20
- [PATCH v1 29/29] gitlab-ci: Extract OpenSBI job rules to reusable section, Alex Bennée, 2021/07/20
- [PATCH v1 28/29] gitlab-ci: Remove the second superfluous macos task, Alex Bennée, 2021/07/20