monitor: Call mon_get_cpu() only once at hmp_gva2gpa()
PATCH 1/1 monitor: Call mon_get_cpu() only once at hmp_gva2gpa()
hmp_gva2gpa() calls mon_get_cpu() twice, which is unnecessary. Not an actual bug, but this is reported as a defect by Coverity Scan (CID 1401346).
--- monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
monitor.c +1 -2
@@ -1685,8 +1685,7 @@ static void hmp_gva2gpa(Monitor *mon, const QDict *qdict)return ; } - gpa =cpu_get_phys_page_attrs_debug (mon_get_cpu (), - addr &TARGET_PAGE_MASK , &attrs); + gpa =cpu_get_phys_page_attrs_debug (cs, addr &TARGET_PAGE_MASK , &attrs);if (gpa ==-1 ) {monitor_printf (mon,"Unmapped\n" ); }else {
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
Quoted 8 lines · Eduardo Habkost
hmp_gva2gpa()callsmon_get_cpu()twice, which is unnecessary. Not an actual bug, but this is reported as a defect by Coverity Scan (CID 1401346).Signed-off-by Eduardo Habkost <[email protected]>--- monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
I was about to send the same patch. ;-)
r~
Dr. David Alan Gilbert
Reviewed-byQuoted 5 lines · * Richard Henderson ([email protected]) wrote:
Quoted 4 lines · Eduardo Habkost
hmp_gva2gpa()callsmon_get_cpu()twice, which is unnecessary. Not an actual bug, but this is reported as a defect by Coverity Scan (CID 1401346).
Quoted 8 lines
Quoted 4 lines
Signed-off-by Eduardo Habkost <[email protected]>--- monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)Reviewed-by Richard Henderson <[email protected]>I was about to send the same patch. ;-)
I did :-)
Quoted 4 lines
r~
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 5 lines · * Eduardo Habkost ([email protected]) wrote:
hmp_gva2gpa()callsmon_get_cpu()twice, which is unnecessary. Not an actual bug, but this is reported as a defect by Coverity Scan (CID 1401346).Signed-off-by Eduardo Habkost <[email protected]>
I'm going to sneak this onto the end of a migration pull I'm just cooking.
Queued.
Quoted 21 lines
--- monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)monitor.c +1
-2@@ -1685,8 +1685,7 @@ static void hmp_gva2gpa(Monitor *mon, const QDict *qdict)return ; } - gpa =cpu_get_phys_page_attrs_debug (mon_get_cpu (), - addr &TARGET_PAGE_MASK , &attrs); + gpa =cpu_get_phys_page_attrs_debug (cs, addr &TARGET_PAGE_MASK , &attrs);if (gpa ==-1 ) {monitor_printf (mon,"Unmapped\n" ); }else {Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK