Re: [PATCH 1/2] HV: acrntrace: Output event time cost with milliseconds
Why we use float? Long should be enough, not?
toggle quoted messageShow quoted text
-----Original Message-----
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [PATCH] VHM: add ioctl/hypercall for UOS intr data monitor
Minggui Cao
On 8/14/2018 2:56 PM, Zhao, Yakui wrote:
Yes, it includes the intr data.-----Original Message-----Does the page include intr data of monitored VM after this call is returned? Another is that since we are adding more and more hcall, can we add one HC to query whether one function is supported in HV?if that we need add another one hypercall :); currently if not support, the HV will return failure; it should be OK. actually, I have a re-factor idea on current hypercall, talked with Jason/Eddie, will give a proposal recently; mainly points: is to classify them, if not need VHM handle, just pass it to HV.... (hypercall + sub-cmd) to design them; reduce some of them, just add in DM/HV. + break;
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [PATCH] VHM: add ioctl/hypercall for UOS intr data monitor
Zhao, Yakui
toggle quoted messageShow quoted text
-----Original Message-----Does the page include intr data of monitored VM after this call is returned? Another is that since we are adding more and more hcall, can we add one HC to query whether one function is supported in HV? In such case it can help to assure that the kernel is decoupled with HV. + break;
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[RESEND 1/2] tools: acrnalyze: Output event time cost with milliseconds
Originally, we output "Time Consumed" with RTC cycles. It's not easy to read.
So, this patch convert it to milliseconds. BTW, this patch also output "Total run time" with ms instead of original second. Signed-off-by: Kaige Fu <kaige.fu@...> --- tools/acrntrace/scripts/vmexit_analyze.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/tools/acrntrace/scripts/vmexit_analyze.py b/tools/acrntrace/scripts/vmexit_analyze.py index 21cfa23..0eee590 100755 --- a/tools/acrntrace/scripts/vmexit_analyze.py +++ b/tools/acrntrace/scripts/vmexit_analyze.py @@ -80,7 +80,13 @@ TIME_IN_EXIT = { # 4 * 64bit per trace entry TRCREC = "QQQQ" -def parse_trace_data(ifile): +def tsc_to_ms(tsc, freq): + """convert tsc to milliseconds according freq + """ + + return float(tsc) / (float(freq) * 1000) + +def parse_trace_data(ifile, freq): """parse the trace data file Args: ifile: input trace data file @@ -116,7 +122,8 @@ def parse_trace_data(ifile): tsc_last_exit_period = tsc_enter - tsc_exit if tsc_last_exit_period != 0: - TIME_IN_EXIT[last_ev_id] += tsc_last_exit_period + TIME_IN_EXIT[last_ev_id] += \ + tsc_to_ms(tsc_last_exit_period, freq) elif event == VM_EXIT: tsc_exit = tsc @@ -157,30 +164,31 @@ def generate_report(ofile, freq): tsc_end %d, tsc_begin %d"\ % (TSC_END, TSC_BEGIN) - rt_sec = float(rt_cycle) / (float(freq) * 1000 * 1000) + rt_ms = tsc_to_ms(rt_cycle, freq) + rt_sec = float(rt_ms) / 1000.0 for event in LIST_EVENTS: total_exit_time += TIME_IN_EXIT[event] print ("Total run time: %d cycles" % (rt_cycle)) print ("TSC Freq: %f MHz" % (freq)) - print ("Total run time: %d sec" % (rt_sec)) + print ("Total run time: %d ms" % (rt_ms)) - f_csv.writerow(['Run time(cycles)', 'Run time(Sec)', 'Freq(MHz)']) + f_csv.writerow(['Run time(cycles)', 'Run time(ms)', 'Freq(MHz)']) f_csv.writerow(['%d' % (rt_cycle), - '%.3f' % (rt_sec), + '%.3f' % (rt_ms), '%d' % (freq)]) - print ("Event \tNR_Exit \tNR_Exit/Sec \tTime Consumed \tTime Percentage") + print ("Event \tNR_Exit \tNR_Exit/Sec \tTime Consumed(ms) \tTime Percentage") f_csv.writerow(['Exit_Reason', 'NR_Exit', 'NR_Exit/Sec', - 'Time Consumed(cycles)', + 'Time Consumed(ms)', 'Time Percentage']) for event in LIST_EVENTS: ev_freq = float(NR_EXITS[event]) / rt_sec - pct = float(TIME_IN_EXIT[event]) * 100 / float(rt_cycle) + pct = float(TIME_IN_EXIT[event]) * 100 / float(rt_ms) print ("%s \t%d \t%.2f \t%d \t%2.2f" % (event, NR_EXITS[event], ev_freq, TIME_IN_EXIT[event], pct)) @@ -189,7 +197,7 @@ def generate_report(ofile, freq): f_csv.writerow(row) ev_freq = float(TOTAL_NR_EXITS) / rt_sec - pct = float(total_exit_time) * 100 / float(rt_cycle) + pct = float(total_exit_time) * 100 / float(rt_ms) print("Total \t%d \t%.2f \t%d \t%2.2f" % (TOTAL_NR_EXITS, ev_freq, total_exit_time, pct)) row = ["Total", TOTAL_NR_EXITS, '%.2f' % ev_freq, total_exit_time, @@ -211,6 +219,6 @@ def analyze_vm_exit(ifile, ofile): print("VM exits analysis started... \n\tinput file: %s\n" "\toutput file: %s.csv" % (ifile, ofile)) - parse_trace_data(ifile) + parse_trace_data(ifile, TSC_FREQ) # save report to the output file generate_report(ofile, TSC_FREQ) -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[RESEND 2/2] tools: acrnalyze: Make the result easier to read
Originally, we don't format the output of analyser well. It is hard to read the
result. This patch make every entry of the result align with the corresponding title to make it easier for users to read. Without patch: Event NR_Exit NR_Exit/Sec Time Consumed(ms) Time Percentage VMEXIT_INTERRUPT_WINDOW 78090 130.15 40 0.01 VMEXIT_CR_ACCESS 0 0.00 0 0.00 VMEXIT_APICV_ACCESS 0 0.00 0 0.00 VMEXIT_EXCEPTION_OR_NMI 0 0.00 0 0.00 VMEXIT_RDTSC 0 0.00 0 0.00 ... Vector Count NR_Exit/Sec 0x000000f0 82337 137.23 0x000000ef 247713 412.85 With patch: Event NR_Exit NR_Exit/Sec Time Consumed(ms) Time percentage VMEXIT_INTERRUPT_WINDOW 78090 130.15 40 0.01 VMEXIT_WRMSR 309085 515.14 128 0.02 VMEXIT_RDTSCP 0 0.00 0 0.00 VMEXIT_IO_INSTRUCTION 75250 125.42 12924 2.15 VMEXIT_EXTERNAL_INTERRUPT 330050 550.08 726 0.12 ... Vector Count NR_Exit/Sec 0x000000f0 82337 137.23 0x000000ef 247713 412.85 Signed-off-by: Kaige Fu <kaige.fu@...> --- tools/acrntrace/scripts/irq_analyze.py | 6 +++--- tools/acrntrace/scripts/vmexit_analyze.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/acrntrace/scripts/irq_analyze.py b/tools/acrntrace/scripts/irq_analyze.py index f475da7..0d555aa 100755 --- a/tools/acrntrace/scripts/irq_analyze.py +++ b/tools/acrntrace/scripts/irq_analyze.py @@ -80,12 +80,12 @@ def generate_report(ofile, freq): rt_sec = float(rt_cycle) / (float(freq) * 1000 * 1000) - print ("\nVector \t\tCount \tNR_Exit/Sec") + print ("%-8s\t%-8s\t%-8s" % ("Vector", "Count", "NR_Exit/Sec")) f_csv.writerow(['Vector', 'NR_Exit', 'NR_Exit/Sec']) for e in IRQ_EXITS.keys(): pct = float(IRQ_EXITS[e]) / rt_sec - print ("0x%08x \t %d \t%.2f" % (e, IRQ_EXITS[e], pct)) - f_csv.writerow([e, IRQ_EXITS[e], '%.2f' % pct]) + print ("0x%08x\t%-8d\t%-8.2f" % (e, IRQ_EXITS[e], pct)) + f_csv.writerow(['0x%08x' % e, IRQ_EXITS[e], '%.2f' % pct]) except IOError as err: print ("Output File Error: " + str(err)) diff --git a/tools/acrntrace/scripts/vmexit_analyze.py b/tools/acrntrace/scripts/vmexit_analyze.py index 0eee590..96dd40a 100755 --- a/tools/acrntrace/scripts/vmexit_analyze.py +++ b/tools/acrntrace/scripts/vmexit_analyze.py @@ -179,7 +179,8 @@ def generate_report(ofile, freq): '%.3f' % (rt_ms), '%d' % (freq)]) - print ("Event \tNR_Exit \tNR_Exit/Sec \tTime Consumed(ms) \tTime Percentage") + print ("%-28s\t%-12s\t%-12s\t%-18s\t%-16s" % ("Event", "NR_Exit", + "NR_Exit/Sec", "Time Consumed(ms)", "Time percentage")) f_csv.writerow(['Exit_Reason', 'NR_Exit', 'NR_Exit/Sec', @@ -190,7 +191,7 @@ def generate_report(ofile, freq): ev_freq = float(NR_EXITS[event]) / rt_sec pct = float(TIME_IN_EXIT[event]) * 100 / float(rt_ms) - print ("%s \t%d \t%.2f \t%d \t%2.2f" % + print ("%-28s\t%-12d\t%-12.2f\t%-18d\t%-16.2f" % (event, NR_EXITS[event], ev_freq, TIME_IN_EXIT[event], pct)) row = [event, NR_EXITS[event], '%.2f' % ev_freq, TIME_IN_EXIT[event], '%2.2f' % (pct)] @@ -198,8 +199,8 @@ def generate_report(ofile, freq): ev_freq = float(TOTAL_NR_EXITS) / rt_sec pct = float(total_exit_time) * 100 / float(rt_ms) - print("Total \t%d \t%.2f \t%d \t%2.2f" - % (TOTAL_NR_EXITS, ev_freq, total_exit_time, pct)) + print("%-28s\t%-12d\t%-12.2f\t%-18d\t%-16.2f" + % ("Total", TOTAL_NR_EXITS, ev_freq, total_exit_time, pct)) row = ["Total", TOTAL_NR_EXITS, '%.2f' % ev_freq, total_exit_time, '%2.2f' % (pct)] f_csv.writerow(row) -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[RESEND 0/2] Minor improvement of acrnalyze
Kaige Fu (2):
tools: acrnalyze: Output event time cost with milliseconds tools: acrnalyze: Make the result easier to read tools/acrntrace/scripts/irq_analyze.py | 6 ++--- tools/acrntrace/scripts/vmexit_analyze.py | 37 +++++++++++++++++++------------ 2 files changed, 26 insertions(+), 17 deletions(-) -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [PATCH 0/2] Minor improvement of acrnalyser
Patch title are wrong. Will fix it and resend them.
toggle quoted messageShow quoted text
Sorry for the noise.
On 08-14 Tue 14:29, Kaige Fu wrote:
This patch mainly focus on:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH v5 1/1] vbs: fix virtio_vq_index_get func handling of multi VQ concurrent request.
Ong Hock Yu <ong.hock.yu@...>
Under multiple VQ use case, it is possible to have concurrent requests.
Added support to return multiple vq index from all vcpu. Signed-off-by: Ong Hock Yu <ong.hock.yu@...> --- drivers/vbs/vbs.c | 22 +++++++++++++++++----- drivers/vbs/vbs_rng.c | 2 +- include/linux/vbs/vbs.h | 8 ++++++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/vbs/vbs.c b/drivers/vbs/vbs.c index 65b8a0bbe3d3..1cda5727a626 100644 --- a/drivers/vbs/vbs.c +++ b/drivers/vbs/vbs.c @@ -148,9 +148,11 @@ long virtio_dev_deregister(struct virtio_dev_info *dev) return 0; } -int virtio_vq_index_get(struct virtio_dev_info *dev, unsigned long *ioreqs_map) +int virtio_vqs_index_get(struct virtio_dev_info *dev, + unsigned long *ioreqs_map, + int *vqs_index, int max_vqs_index) { - int val = -1; + int idx = 0; struct vhm_request *req; int vcpu; @@ -178,10 +180,20 @@ int virtio_vq_index_get(struct virtio_dev_info *dev, unsigned long *ioreqs_map) } else { pr_debug("%s: write request! type %d\n", __func__, req->type); + + if(idx == max_vqs_index) + { + pr_warn("%s: The allocated vqs size (%d) is smaller than \ + the number of vcpu (%d)! This might caused the process \ + of some requests be delayed.",__func__,max_vqs_index, \ + dev->_ctx.max_vcpu); + break; + } + if (dev->io_range_type == PIO_RANGE) - val = req->reqs.pio_request.value; + vqs_index[idx++] = req->reqs.pio_request.value; else - val = req->reqs.mmio_request.value; + vqs_index[idx++] = req->reqs.mmio_request.value; } smp_mb(); atomic_set(&req->processed, REQ_STATE_COMPLETE); @@ -189,7 +201,7 @@ int virtio_vq_index_get(struct virtio_dev_info *dev, unsigned long *ioreqs_map) } } - return val; + return idx; } static long virtio_vqs_info_set(struct virtio_dev_info *dev, diff --git a/drivers/vbs/vbs_rng.c b/drivers/vbs/vbs_rng.c index fd2bb27af66e..c5e28cc12c55 100644 --- a/drivers/vbs/vbs_rng.c +++ b/drivers/vbs/vbs_rng.c @@ -268,7 +268,7 @@ static int handle_kick(int client_id, unsigned long *ioreqs_map) return -EINVAL; } - val = virtio_vq_index_get(&rng->dev, ioreqs_map); + virtio_vqs_index_get(&rng->dev, ioreqs_map, &val, 1); if (val >= 0) handle_vq_kick(rng, val); diff --git a/include/linux/vbs/vbs.h b/include/linux/vbs/vbs.h index 30df8ebf68a0..964bacac865c 100644 --- a/include/linux/vbs/vbs.h +++ b/include/linux/vbs/vbs.h @@ -262,7 +262,7 @@ long virtio_dev_register(struct virtio_dev_info *dev); long virtio_dev_deregister(struct virtio_dev_info *dev); /** - * virtio_vq_index_get - get virtqueue index that frontend kicks + * virtio_vqs_index_get - get virtqueue indexes that frontend kicks * * This API is normally called in the VBS-K device's callback * function, to get value write to the "kick" register from @@ -270,10 +270,14 @@ long virtio_dev_deregister(struct virtio_dev_info *dev); * * @dev: Pointer to VBS-K device data struct * @ioreqs_map: requests bitmap need to handle, provided by VHM + * @vqs_index: array to store the vq indexes + * @max_vqs_index: size of vqs_index array * * Return: >=0 on virtqueue index, <0 on error */ -int virtio_vq_index_get(struct virtio_dev_info *dev, unsigned long *ioreqs_map); +int virtio_vqs_index_get(struct virtio_dev_info *dev, + unsigned long *ioreqs_map, + int *vqs_index, int max_vqs_index); /** * virtio_dev_reset - reset a VBS-K device -- 2.17.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH 2/2] HV: acrntrace: Make the result easier to read
Originally, we don't format the output of analyser well. It is hard to read the
result. This patch make every entry of the result align with the corresponding title to make it easier for users to read. Without patch: Event NR_Exit NR_Exit/Sec Time Consumed(ms) Time Percentage VMEXIT_INTERRUPT_WINDOW 78090 130.15 40 0.01 VMEXIT_CR_ACCESS 0 0.00 0 0.00 VMEXIT_APICV_ACCESS 0 0.00 0 0.00 VMEXIT_EXCEPTION_OR_NMI 0 0.00 0 0.00 VMEXIT_RDTSC 0 0.00 0 0.00 ... Vector Count NR_Exit/Sec 0x000000f0 82337 137.23 0x000000ef 247713 412.85 With patch: Event NR_Exit NR_Exit/Sec Time Consumed(ms) Time percentage VMEXIT_INTERRUPT_WINDOW 78090 130.15 40 0.01 VMEXIT_WRMSR 309085 515.14 128 0.02 VMEXIT_RDTSCP 0 0.00 0 0.00 VMEXIT_IO_INSTRUCTION 75250 125.42 12924 2.15 VMEXIT_EXTERNAL_INTERRUPT 330050 550.08 726 0.12 ... Vector Count NR_Exit/Sec 0x000000f0 82337 137.23 0x000000ef 247713 412.85 Signed-off-by: Kaige Fu <kaige.fu@...> --- tools/acrntrace/scripts/irq_analyze.py | 6 +++--- tools/acrntrace/scripts/vmexit_analyze.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/acrntrace/scripts/irq_analyze.py b/tools/acrntrace/scripts/irq_analyze.py index f475da7..0d555aa 100755 --- a/tools/acrntrace/scripts/irq_analyze.py +++ b/tools/acrntrace/scripts/irq_analyze.py @@ -80,12 +80,12 @@ def generate_report(ofile, freq): rt_sec = float(rt_cycle) / (float(freq) * 1000 * 1000) - print ("\nVector \t\tCount \tNR_Exit/Sec") + print ("%-8s\t%-8s\t%-8s" % ("Vector", "Count", "NR_Exit/Sec")) f_csv.writerow(['Vector', 'NR_Exit', 'NR_Exit/Sec']) for e in IRQ_EXITS.keys(): pct = float(IRQ_EXITS[e]) / rt_sec - print ("0x%08x \t %d \t%.2f" % (e, IRQ_EXITS[e], pct)) - f_csv.writerow([e, IRQ_EXITS[e], '%.2f' % pct]) + print ("0x%08x\t%-8d\t%-8.2f" % (e, IRQ_EXITS[e], pct)) + f_csv.writerow(['0x%08x' % e, IRQ_EXITS[e], '%.2f' % pct]) except IOError as err: print ("Output File Error: " + str(err)) diff --git a/tools/acrntrace/scripts/vmexit_analyze.py b/tools/acrntrace/scripts/vmexit_analyze.py index 0eee590..96dd40a 100755 --- a/tools/acrntrace/scripts/vmexit_analyze.py +++ b/tools/acrntrace/scripts/vmexit_analyze.py @@ -179,7 +179,8 @@ def generate_report(ofile, freq): '%.3f' % (rt_ms), '%d' % (freq)]) - print ("Event \tNR_Exit \tNR_Exit/Sec \tTime Consumed(ms) \tTime Percentage") + print ("%-28s\t%-12s\t%-12s\t%-18s\t%-16s" % ("Event", "NR_Exit", + "NR_Exit/Sec", "Time Consumed(ms)", "Time percentage")) f_csv.writerow(['Exit_Reason', 'NR_Exit', 'NR_Exit/Sec', @@ -190,7 +191,7 @@ def generate_report(ofile, freq): ev_freq = float(NR_EXITS[event]) / rt_sec pct = float(TIME_IN_EXIT[event]) * 100 / float(rt_ms) - print ("%s \t%d \t%.2f \t%d \t%2.2f" % + print ("%-28s\t%-12d\t%-12.2f\t%-18d\t%-16.2f" % (event, NR_EXITS[event], ev_freq, TIME_IN_EXIT[event], pct)) row = [event, NR_EXITS[event], '%.2f' % ev_freq, TIME_IN_EXIT[event], '%2.2f' % (pct)] @@ -198,8 +199,8 @@ def generate_report(ofile, freq): ev_freq = float(TOTAL_NR_EXITS) / rt_sec pct = float(total_exit_time) * 100 / float(rt_ms) - print("Total \t%d \t%.2f \t%d \t%2.2f" - % (TOTAL_NR_EXITS, ev_freq, total_exit_time, pct)) + print("%-28s\t%-12d\t%-12.2f\t%-18d\t%-16.2f" + % ("Total", TOTAL_NR_EXITS, ev_freq, total_exit_time, pct)) row = ["Total", TOTAL_NR_EXITS, '%.2f' % ev_freq, total_exit_time, '%2.2f' % (pct)] f_csv.writerow(row) -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH 1/2] HV: acrntrace: Output event time cost with milliseconds
Originally, we output "Time Consumed" with RTC cycles. It's not easy to read.
So, this patch convert it to milliseconds. BTW, this patch also output "Total run time" with ms instead of original second. Signed-off-by: Kaige Fu <kaige.fu@...> --- tools/acrntrace/scripts/vmexit_analyze.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/tools/acrntrace/scripts/vmexit_analyze.py b/tools/acrntrace/scripts/vmexit_analyze.py index 21cfa23..0eee590 100755 --- a/tools/acrntrace/scripts/vmexit_analyze.py +++ b/tools/acrntrace/scripts/vmexit_analyze.py @@ -80,7 +80,13 @@ TIME_IN_EXIT = { # 4 * 64bit per trace entry TRCREC = "QQQQ" -def parse_trace_data(ifile): +def tsc_to_ms(tsc, freq): + """convert tsc to milliseconds according freq + """ + + return float(tsc) / (float(freq) * 1000) + +def parse_trace_data(ifile, freq): """parse the trace data file Args: ifile: input trace data file @@ -116,7 +122,8 @@ def parse_trace_data(ifile): tsc_last_exit_period = tsc_enter - tsc_exit if tsc_last_exit_period != 0: - TIME_IN_EXIT[last_ev_id] += tsc_last_exit_period + TIME_IN_EXIT[last_ev_id] += \ + tsc_to_ms(tsc_last_exit_period, freq) elif event == VM_EXIT: tsc_exit = tsc @@ -157,30 +164,31 @@ def generate_report(ofile, freq): tsc_end %d, tsc_begin %d"\ % (TSC_END, TSC_BEGIN) - rt_sec = float(rt_cycle) / (float(freq) * 1000 * 1000) + rt_ms = tsc_to_ms(rt_cycle, freq) + rt_sec = float(rt_ms) / 1000.0 for event in LIST_EVENTS: total_exit_time += TIME_IN_EXIT[event] print ("Total run time: %d cycles" % (rt_cycle)) print ("TSC Freq: %f MHz" % (freq)) - print ("Total run time: %d sec" % (rt_sec)) + print ("Total run time: %d ms" % (rt_ms)) - f_csv.writerow(['Run time(cycles)', 'Run time(Sec)', 'Freq(MHz)']) + f_csv.writerow(['Run time(cycles)', 'Run time(ms)', 'Freq(MHz)']) f_csv.writerow(['%d' % (rt_cycle), - '%.3f' % (rt_sec), + '%.3f' % (rt_ms), '%d' % (freq)]) - print ("Event \tNR_Exit \tNR_Exit/Sec \tTime Consumed \tTime Percentage") + print ("Event \tNR_Exit \tNR_Exit/Sec \tTime Consumed(ms) \tTime Percentage") f_csv.writerow(['Exit_Reason', 'NR_Exit', 'NR_Exit/Sec', - 'Time Consumed(cycles)', + 'Time Consumed(ms)', 'Time Percentage']) for event in LIST_EVENTS: ev_freq = float(NR_EXITS[event]) / rt_sec - pct = float(TIME_IN_EXIT[event]) * 100 / float(rt_cycle) + pct = float(TIME_IN_EXIT[event]) * 100 / float(rt_ms) print ("%s \t%d \t%.2f \t%d \t%2.2f" % (event, NR_EXITS[event], ev_freq, TIME_IN_EXIT[event], pct)) @@ -189,7 +197,7 @@ def generate_report(ofile, freq): f_csv.writerow(row) ev_freq = float(TOTAL_NR_EXITS) / rt_sec - pct = float(total_exit_time) * 100 / float(rt_cycle) + pct = float(total_exit_time) * 100 / float(rt_ms) print("Total \t%d \t%.2f \t%d \t%2.2f" % (TOTAL_NR_EXITS, ev_freq, total_exit_time, pct)) row = ["Total", TOTAL_NR_EXITS, '%.2f' % ev_freq, total_exit_time, @@ -211,6 +219,6 @@ def analyze_vm_exit(ifile, ofile): print("VM exits analysis started... \n\tinput file: %s\n" "\toutput file: %s.csv" % (ifile, ofile)) - parse_trace_data(ifile) + parse_trace_data(ifile, TSC_FREQ) # save report to the output file generate_report(ofile, TSC_FREQ) -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH 0/2] Minor improvement of acrnalyser
This patch mainly focus on:
- Output "Time Consumed" and "Total run time" with milliseconds. - Format the output to make the result entry align with the title. Kaige Fu (2): HV: acrntrace: Output event time cost with milliseconds HV: acrntrace: Make the result easier to read tools/acrntrace/scripts/irq_analyze.py | 6 ++--- tools/acrntrace/scripts/vmexit_analyze.py | 37 +++++++++++++++++++------------ 2 files changed, 26 insertions(+), 17 deletions(-) -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ACRN Project Technical Community Meeting: @ Weekly 9PM-10PM (China-Shanghai), 6AM-7AM (US-West Coast), 3PM-4PM (Europe-London)
Agenda (8/15): ACRN ACPI
Management
Â
Â
Â
Â
Â
We're still in the early stages of forming this TSC, so instead we invite you to attend a weekly "Technical Community" meeting where we'll meet community members and
talk about the ACRN project and plans. As we explore community interest and involvement opportunities, we'll (re)schedule these meetings at a time convenient to most attendees:
Â
Â
Best regards.
Hongbo
Tel: +86-21-6116 7445
MP: +86-1364 1793 689
Mail: hongbo.wang@...
Â
Â
Â
Â
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH] VHM: add ioctl/hypercall for UOS intr data monitor
Minggui Cao
DM or VM monitor can use this ioctl/hypercall to get the UOS
interrupt count data, to check if it in normal status, and give a response. Signed-off-by: Minggui Cao <minggui.cao@...> --- drivers/char/vhm/vhm_dev.c | 17 +++++++++++++++++ drivers/vhm/vhm_hypercall.c | 5 +++++ include/linux/vhm/acrn_hv_defs.h | 1 + include/linux/vhm/vhm_hypercall.h | 1 + include/linux/vhm/vhm_ioctl_defs.h | 1 + 5 files changed, 25 insertions(+) diff --git a/drivers/char/vhm/vhm_dev.c b/drivers/char/vhm/vhm_dev.c index c681ace..fc1e852 100644 --- a/drivers/char/vhm/vhm_dev.c +++ b/drivers/char/vhm/vhm_dev.c @@ -604,6 +604,23 @@ static long vhm_dev_ioctl(struct file *filep, break; } + case IC_VM_INTR_MONITOR: { + struct page *page; + + ret = get_user_pages_fast(ioctl_param, 1, 1, &page); + if (unlikely(ret != 1) || (page == NULL)) { + pr_err("vhm-dev: failed to pin intr hdr buffer!\n"); + return -ENOMEM; + } + + ret = hcall_vm_intr_monitor(vm->vmid, page_to_phys(page)); + if (ret < 0) { + pr_err("vhm-dev: monitor intr data err=%d\n", ret); + return -EFAULT; + } + break; + } + default: pr_warn("Unknown IOCTL 0x%x\n", ioctl_num); ret = 0; diff --git a/drivers/vhm/vhm_hypercall.c b/drivers/vhm/vhm_hypercall.c index 9a92d68..9a974e8 100644 --- a/drivers/vhm/vhm_hypercall.c +++ b/drivers/vhm/vhm_hypercall.c @@ -172,3 +172,8 @@ inline long hcall_vm_gpa2hpa(unsigned long vmid, unsigned long addr) { return acrn_hypercall2(HC_VM_GPA2HPA, vmid, addr); } + +inline long hcall_vm_intr_monitor(unsigned long vmid, unsigned long addr) +{ + return acrn_hypercall2(HC_VM_INTR_MONITOR, vmid, addr); +} diff --git a/include/linux/vhm/acrn_hv_defs.h b/include/linux/vhm/acrn_hv_defs.h index c12deaa..01494de 100644 --- a/include/linux/vhm/acrn_hv_defs.h +++ b/include/linux/vhm/acrn_hv_defs.h @@ -85,6 +85,7 @@ #define HC_DEASSERT_IRQLINE _HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x01) #define HC_PULSE_IRQLINE _HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x02) #define HC_INJECT_MSI _HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x03) +#define HC_VM_INTR_MONITOR _HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x04UL) /* DM ioreq management */ #define HC_ID_IOREQ_BASE 0x30UL diff --git a/include/linux/vhm/vhm_hypercall.h b/include/linux/vhm/vhm_hypercall.h index bc9feec..868541e 100644 --- a/include/linux/vhm/vhm_hypercall.h +++ b/include/linux/vhm/vhm_hypercall.h @@ -166,5 +166,6 @@ inline long hcall_reset_ptdev_intr_info(unsigned long vmid, unsigned long pt_irq); inline long hcall_remap_pci_msix(unsigned long vmid, unsigned long msi); inline long hcall_vm_gpa2hpa(unsigned long vmid, unsigned long addr); +inline long hcall_vm_intr_monitor(unsigned long vmid, unsigned long addr); #endif /* __VHM_HYPERCALL_H__ */ diff --git a/include/linux/vhm/vhm_ioctl_defs.h b/include/linux/vhm/vhm_ioctl_defs.h index 32e081a..042b8e9 100644 --- a/include/linux/vhm/vhm_ioctl_defs.h +++ b/include/linux/vhm/vhm_ioctl_defs.h @@ -80,6 +80,7 @@ #define IC_DEASSERT_IRQLINE _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x01) #define IC_PULSE_IRQLINE _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x02) #define IC_INJECT_MSI _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x03) +#define IC_VM_INTR_MONITOR _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x04) /* DM ioreq management */ #define IC_ID_IOREQ_BASE 0x30UL -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH 2/2] DM: add monitor thread to check intrrupt status
Minggui Cao
intr monitor thread will check UOS interrupt status,
first to get intr data, and check if "interrupt storm" happen as the condition setting, if happened, it will handle it as the policy setting. TODO: the policy setting and handling. Signed-off-by: Minggui Cao <minggui.cao@...> --- devicemodel/core/monitor.c | 128 ++++++++++++++++++++++++++++ devicemodel/core/vmmapi.c | 6 ++ devicemodel/include/public/acrn_common.h | 20 +++++ devicemodel/include/public/vhm_ioctl_defs.h | 1 + devicemodel/include/vmmapi.h | 1 + 5 files changed, 156 insertions(+) diff --git a/devicemodel/core/monitor.c b/devicemodel/core/monitor.c index c5b41f1..58dcd61 100644 --- a/devicemodel/core/monitor.c +++ b/devicemodel/core/monitor.c @@ -15,11 +15,135 @@ #include <string.h> #include <sys/stat.h> #include <sys/queue.h> +#include <unistd.h> #include <pthread.h> #include "dm.h" #include "monitor.h" #include "acrn_mngr.h" #include "pm.h" +#include "vmmapi.h" + +#define CHECK_PERIOD 10 /*10seconds*/ +#define INTR_STORM_THRESHOLD 1000000 /* 10K times per second */ + +union intr_monitor_t { + struct acrn_intr_monitor monitor; + char reserved[4096]; +}__attribute__ ((aligned(4096))); + +static union intr_monitor_t intr_data; +static uint64_t intr_cnt_buf[MAX_INTR_NUM]; +static pthread_t intr_check_pid; + +//#define INTR_CHECK_DEBUG +#ifdef INTR_CHECK_DEBUG +static FILE * dbg_file; +#define DPRINTF(format, args...) \ +do { fprintf(dbg_file, format, args); fflush(dbg_file); } while (0) +#else +#define DPRINTF(format, arg...) +#endif + +#ifdef INTR_CHECK_DEBUG +static void write_intr_monitor_to_file(const struct acrn_intr_monitor *hdr) +{ + static int wr_cnt = 0; + int j; + + wr_cnt++; + fprintf(dbg_file, "\n======%d time IRQs=%d=====\n", wr_cnt, hdr->intr_num); + fprintf(dbg_file, "IRQ\t\tCount\n"); + + for (j = 0; j < hdr->intr_num; j++) { + if (hdr->buffer[j] != 0) + fprintf(dbg_file, "%d\t\t%ld\n", j, hdr->buffer[j]); + } + + fflush(dbg_file); +} +#endif + +static void *intr_check_thread(void *arg) +{ + struct vmctx *ctx = (struct vmctx *)arg; + struct acrn_intr_monitor *intr_hdr = &intr_data.monitor; + bool abnormal_checked = false; + int ret, i; + +#ifdef INTR_CHECK_DEBUG + dbg_file = fopen("/tmp/intr_log", "w+"); +#endif + sleep(CHECK_PERIOD); + + /* first to get interrupt data */ + intr_hdr->cmd = INTR_CMD_GET_DATA; + intr_hdr->intr_num = MAX_INTR_NUM; + memset(intr_hdr->buffer, 0, sizeof(uint64_t) * intr_hdr->intr_num); + + ret = vm_intr_monitor(ctx, intr_hdr); + if (ret) { + DPRINTF("first get intr data failed, ret: %d\n", ret); + intr_check_pid = 0; + return NULL; + } + + while (1) { +#ifdef INTR_CHECK_DEBUG + write_intr_monitor_to_file(intr_hdr); +#endif + memcpy(intr_cnt_buf, intr_hdr->buffer, sizeof(uint64_t) * intr_hdr->intr_num); + sleep(CHECK_PERIOD); + + /* next time to get interrupt data */ + memset(intr_hdr->buffer, 0, sizeof(uint64_t) * intr_hdr->intr_num); + ret = vm_intr_monitor(ctx, intr_hdr); + if (ret) { + DPRINTF("next get intr data failed, ret: %d\n", ret); + intr_check_pid = 0; + break; + } + + /* calc the delta of the two times data */ + for (i = 0; i < intr_hdr->intr_num; i++) { + uint64_t delta = intr_hdr->buffer[i] - intr_cnt_buf[i]; + + if (delta > INTR_STORM_THRESHOLD) { + /* TODO to handle the intr abnormal status as policy*/ + DPRINTF("irq=%d, delta=%ld, in-buf=%ld, tmp=%ld\n", i, + delta, intr_hdr->buffer[i], intr_cnt_buf[i]); + intr_check_pid = 0; + abnormal_checked = true; + break; + } + } + + if (abnormal_checked) + break; + } + + return NULL; +} + +static void start_intr_data_check(struct vmctx *ctx) +{ + int ret; + + ret = pthread_create(&intr_check_pid, NULL, intr_check_thread, ctx); + if (ret) { + printf("failed %s %d\n", __FUNCTION__, __LINE__); + intr_check_pid = 0; + } + + printf("start monitor interrupt data...\n"); +} + +static void stop_intr_data_check(void) +{ + if (intr_check_pid) { + pthread_cancel(intr_check_pid); + intr_check_pid = 0; + } +} /* helpers */ /* Check if @path is a directory, and create if not exist */ @@ -255,6 +379,8 @@ int monitor_init(struct vmctx *ctx) monitor_register_vm_ops(&pmc_ops, ctx, "PMC_VM_OPs"); + start_intr_data_check(ctx); + return 0; handlers_err: @@ -269,4 +395,6 @@ void monitor_close(void) { if (monitor_fd >= 0) mngr_close(monitor_fd); + + stop_intr_data_check(); } diff --git a/devicemodel/core/vmmapi.c b/devicemodel/core/vmmapi.c index 6a1310a..9419ad5 100644 --- a/devicemodel/core/vmmapi.c +++ b/devicemodel/core/vmmapi.c @@ -635,3 +635,9 @@ vm_get_cpu_state(struct vmctx *ctx, void *state_buf) { return ioctl(ctx->fd, IC_PM_GET_CPU_STATE, state_buf); } + +int +vm_intr_monitor(struct vmctx *ctx, void *intr_buf) +{ + return ioctl(ctx->fd, IC_VM_INTR_MONITOR, intr_buf); +} diff --git a/devicemodel/include/public/acrn_common.h b/devicemodel/include/public/acrn_common.h index 0019d3a..6a43217 100644 --- a/devicemodel/include/public/acrn_common.h +++ b/devicemodel/include/public/acrn_common.h @@ -367,6 +367,26 @@ enum pm_cmd_type { }; /** + * @brief Info to get a VM interrupt count data + * + * the parameter for HC_GET_VM_INTR_DATA hypercall + */ +#define MAX_INTR_NUM 320 +struct acrn_intr_monitor { + /** sub command for intr monitor */ + uint32_t cmd; + /** the number of interrupts this buffer save */ + uint32_t intr_num; + + /** the buffer which save each interrupt count */ + uint64_t buffer[MAX_INTR_NUM]; +} __aligned(8); + +/** cmd for intr monitor **/ +#define INTR_CMD_GET_DATA 0 +#define INTR_CMD_MASK_INT 1 + +/** * @} */ #endif /* _ACRN_COMMON_H_ */ diff --git a/devicemodel/include/public/vhm_ioctl_defs.h b/devicemodel/include/public/vhm_ioctl_defs.h index 356d95c..158883e 100644 --- a/devicemodel/include/public/vhm_ioctl_defs.h +++ b/devicemodel/include/public/vhm_ioctl_defs.h @@ -80,6 +80,7 @@ #define IC_DEASSERT_IRQLINE _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x01) #define IC_PULSE_IRQLINE _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x02) #define IC_INJECT_MSI _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x03) +#define IC_VM_INTR_MONITOR _IC_ID(IC_ID, IC_ID_IRQ_BASE + 0x04) /* DM ioreq management */ #define IC_ID_IOREQ_BASE 0x30UL diff --git a/devicemodel/include/vmmapi.h b/devicemodel/include/vmmapi.h index 0f8709a..b9d08bb 100644 --- a/devicemodel/include/vmmapi.h +++ b/devicemodel/include/vmmapi.h @@ -148,6 +148,7 @@ int vm_reset_ptdev_intx_info(struct vmctx *ctx, int virt_pin, bool pic_pin); int vm_create_vcpu(struct vmctx *ctx, uint16_t vcpu_id); int vm_get_cpu_state(struct vmctx *ctx, void *state_buf); +int vm_intr_monitor(struct vmctx *ctx, void *intr_buf); void vm_stop_watchdog(struct vmctx *ctx); void vm_reset_watchdog(struct vmctx *ctx); #endif /* _VMMAPI_H_ */ -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH 1/2] HV: add hypercall to monitor UOS interrupt data
Minggui Cao
this hypercall can be used by DM or VMM manager
to monitor UOS interrupt work status; for example, to check if there is an "interrupt storm", and do some reactions according to its policy. Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/866 Signed-off-by: Minggui Cao <minggui.cao@...> --- hypervisor/arch/x86/guest/vmcall.c | 4 ++++ hypervisor/arch/x86/irq.c | 23 +++++++++++++++++++++ hypervisor/common/hypercall.c | 34 ++++++++++++++++++++++++++++++++ hypervisor/include/arch/x86/irq.h | 3 +++ hypervisor/include/common/hypercall.h | 12 +++++++++++ hypervisor/include/public/acrn_common.h | 20 +++++++++++++++++++ hypervisor/include/public/acrn_hv_defs.h | 1 + 7 files changed, 97 insertions(+) diff --git a/hypervisor/arch/x86/guest/vmcall.c b/hypervisor/arch/x86/guest/vmcall.c index 3e3a7c7..cef1841 100644 --- a/hypervisor/arch/x86/guest/vmcall.c +++ b/hypervisor/arch/x86/guest/vmcall.c @@ -170,6 +170,10 @@ int vmcall_vmexit_handler(struct vcpu *vcpu) ret = hcall_get_cpu_pm_state(vm, param1, param2); break; + case HC_VM_INTR_MONITOR: + ret = hcall_vm_intr_monitor(vm, (uint16_t)param1, param2); + break; + default: pr_err("op %d: Invalid hypercall\n", hypcall_id); ret = -EPERM; diff --git a/hypervisor/arch/x86/irq.c b/hypervisor/arch/x86/irq.c index 14a629f..1728b63 100644 --- a/hypervisor/arch/x86/irq.c +++ b/hypervisor/arch/x86/irq.c @@ -732,6 +732,29 @@ void get_cpu_interrupt_info(char *str_arg, int str_max) } #endif /* HV_DEBUG */ +void get_vm_intr_data(const struct vm *target_vm, uint64_t *cnt_buf, + uint32_t intr_num) +{ + uint32_t irq, vector, i; + struct vcpu *vcpu; + struct irq_desc *desc; + + for (irq = 0U; irq < intr_num; irq++) { + desc = irq_desc_array + irq; + vector = irq_to_vector(irq); + + if ((desc->used != IRQ_NOT_ASSIGNED) && + (vector != VECTOR_INVALID)) { + + /* for timer & ipi not need to count? */ + foreach_vcpu(i, target_vm, vcpu) { + cnt_buf[irq] += per_cpu(irq_count, + vcpu->pcpu_id)[irq]; + } + } + } +} + void interrupt_init(uint16_t pcpu_id) { struct host_idt_descriptor *idtd = &HOST_IDTR; diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index 280bfd0..c5bee04 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -893,3 +893,37 @@ int32_t hcall_get_cpu_pm_state(struct vm *vm, uint64_t cmd, uint64_t param) } } + +int32_t hcall_vm_intr_monitor(struct vm *vm, uint16_t vmid, uint64_t param) +{ + struct acrn_intr_monitor *intr_hdr; + uint64_t hpa; + struct vm *target_vm = get_vm_from_vmid(vmid); + + if (!is_vm0(vm) || (target_vm == NULL)) { + return -1; + } + + hpa = gpa2hpa(vm, param); + if (hpa == 0UL) { + pr_err("%s: invalid GPA.\n", __func__); + return -EINVAL; + } + + intr_hdr = (struct acrn_intr_monitor *)HPA2HVA(hpa); + + switch(intr_hdr->cmd) { + case INTR_CMD_GET_DATA: + if (intr_hdr->intr_num > NR_IRQS) { + intr_hdr->intr_num = NR_IRQS; + } + + get_vm_intr_data(target_vm, intr_hdr->buffer, intr_hdr->intr_num); + break; + + default: + break; + } + + return 0; +} diff --git a/hypervisor/include/arch/x86/irq.h b/hypervisor/include/arch/x86/irq.h index 7a677a3..1cc989d 100644 --- a/hypervisor/include/arch/x86/irq.h +++ b/hypervisor/include/arch/x86/irq.h @@ -99,4 +99,7 @@ void cancel_event_injection(struct vcpu *vcpu); void get_cpu_interrupt_info(char *str_arg, int str_max); #endif /* HV_DEBUG */ +void get_vm_intr_data(const struct vm *target_vm, uint64_t *cnt_buf, + uint32_t intr_num); + #endif /* ARCH_IRQ_H */ diff --git a/hypervisor/include/common/hypercall.h b/hypervisor/include/common/hypercall.h index 7673c64..f9d8eeb 100644 --- a/hypervisor/include/common/hypercall.h +++ b/hypervisor/include/common/hypercall.h @@ -356,6 +356,18 @@ int32_t hcall_setup_sbuf(struct vm *vm, uint64_t param); int32_t hcall_get_cpu_pm_state(struct vm *vm, uint64_t cmd, uint64_t param); /** + * @brief Get VCPU a VM's interrupt count data. + * + * @param vm pointer to VM data structure + * @param vmid id of the VM + * @param param guest physical address. This gpa points to data structure of + * acrn_intr_monitor + * + * @return 0 on success, non-zero on error. + */ +int32_t hcall_vm_intr_monitor(struct vm *vm, uint16_t vmid, uint64_t param); + +/** * @defgroup trusty_hypercall Trusty Hypercalls * * This is a special group that includes all hypercalls diff --git a/hypervisor/include/public/acrn_common.h b/hypervisor/include/public/acrn_common.h index df00de8..f52a8ab 100644 --- a/hypervisor/include/public/acrn_common.h +++ b/hypervisor/include/public/acrn_common.h @@ -463,6 +463,26 @@ enum pm_cmd_type { }; /** + * @brief Info to get a VM interrupt count data + * + * the parameter for HC_GET_VM_INTR_DATA hypercall + */ +#define MAX_INTR_NUM 320 +struct acrn_intr_monitor { + /** sub command for intr monitor */ + uint32_t cmd; + /** the number of interrupts this buffer save */ + uint32_t intr_num; + + /** the buffer which save each interrupt count */ + uint64_t buffer[MAX_INTR_NUM]; +} __aligned(8); + +/** cmd for intr monitor **/ +#define INTR_CMD_GET_DATA 0 +#define INTR_CMD_MASK_INT 1 + +/** * @} */ #endif /* ACRN_COMMON_H */ diff --git a/hypervisor/include/public/acrn_hv_defs.h b/hypervisor/include/public/acrn_hv_defs.h index d4477d2..19c1ce1 100644 --- a/hypervisor/include/public/acrn_hv_defs.h +++ b/hypervisor/include/public/acrn_hv_defs.h @@ -43,6 +43,7 @@ #define HC_DEASSERT_IRQLINE BASE_HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x01UL) #define HC_PULSE_IRQLINE BASE_HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x02UL) #define HC_INJECT_MSI BASE_HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x03UL) +#define HC_VM_INTR_MONITOR BASE_HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x04UL) /* DM ioreq management */ #define HC_ID_IOREQ_BASE 0x30UL -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[PATCH 0/2] *** interrupt storm mitigation ***
Minggui Cao
add the UOS interrupt data check first.
*** BLURB HERE *** Minggui Cao (2): HV: add hypercall to monitor UOS interrupt data DM: add monitor thread to check intrrupt status devicemodel/core/monitor.c | 128 ++++++++++++++++++++++++++++ devicemodel/core/vmmapi.c | 6 ++ devicemodel/include/public/acrn_common.h | 20 +++++ devicemodel/include/public/vhm_ioctl_defs.h | 1 + devicemodel/include/vmmapi.h | 1 + hypervisor/arch/x86/guest/vmcall.c | 4 + hypervisor/arch/x86/irq.c | 23 +++++ hypervisor/common/hypercall.c | 34 ++++++++ hypervisor/include/arch/x86/irq.h | 3 + hypervisor/include/common/hypercall.h | 12 +++ hypervisor/include/public/acrn_common.h | 20 +++++ hypervisor/include/public/acrn_hv_defs.h | 1 + 12 files changed, 253 insertions(+) -- 2.7.4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [PATCH v4 1/1] vbs: fix virtio_vq_index_get func handling of multi VQ concurrent request.
Shuo A Liu
Hi OH,
On Mon 13.Aug'18 at 19:22:28 +0000, Ong Hock Yu wrote: Under multiple VQ use case, it is possible to have concurrent requests.Remove this line. Signed-off-by: Ong Hock Yu <ong.hock.yu@...>This might casue a lots of logs for normal case. The corner case happens rarely. How about while (1) { vcpu = find_first_bit(ioreqs_map, dev->_ctx.max_vcpu); if (vcpu == dev->_ctx.max_vcpu) break; ... if (atomic_read(&req->processed) == REQ_STATE_PROCESSING && req->client == dev->_ctx.vhm_client_id) { if (idx == max_vqs_index) { pr_warn("xxx"); break; } ... } } ? Thanks shuo + while (idx < max_vqs_index) {
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [PATCH v2] HV: Add const qualifiers where required
Junjie Mao
Arindam Roy <arindam.roy@...> writes:
V1:Reviewed-by: Junjie Mao <junjie.mao@...> Please also include the scope of this patch in your commit log. I think this patch covers the const qualifiers in some sources, but not all. Stating what you changed explicitly can help others review for completeness. ---
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [PATCH v2] HV: Enclose debug specific code with #ifdef HV_DEBUG
#ifdef
On 08-14 Tue 03:44, Eddie Dong wrote:
Will fix it when PR.-----Original Message-----We also need to do this compile option protection in vmcall.c side for HC_SETUP_SBUF.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [PATCH 5/6] DM USB: xHCI: change flow of creation of virtual USB device
Wu, Xiaoguang
On 18-08-13 22:35:32, Yu Wang wrote:
On 18-08-13 16:48:34, Wu, Xiaoguang wrote:xgwu:The xHCI emulation greatly depends on the user space library libusbI think it should be re-connection instead of disconnection, right? ok, will change. thx. will bind class driver to the physical USB device instead of usbfs,Currently, the native S3 will disable the vbus for all xHCI ports and xguw: ok, will change. thx. Can we merge the native_assign_ports and usb_native_devinfo?... Why the xgwu: change it to: native_assign_ports -> port_map_tbl native_assign_info -> native_dev_info In futurn, should refine it. thanks. xgwu: ok, as discussed, change it to 4. and change USB_NATIVE_NUM_PORT to 20 thanks. xgwu:struct timespec mf_prev_time; /* previous time of accessing MFINDEX */Please change the port_start/port_end to vport_start/vport_end. ok, will change it. thanks. xgwu:-Confused, you are trying to find one free virtual port? Why every native the code is not good, will change to simpler way. thanks. xgwu:We need to rework this loop-loop-loop-if-if-if code... It is too ugly ok, will change. thanks. Ditto. xgwu: will remove the loop. thx. xgwu:+ assert(i < USB_NATIVE_NUM_BUS);Define one macro instead of -1. ok, will change.thx. UPRINTF(LDBG, "report virtual port %d status\r\n", port);Ditto xgwu: will use a function do this. thanks. + }
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|