xen/xen-unstable.xentrace.t_info_first_offset.patch
Charles Arnold 8547e28bd5 - Upstream patches from Jan
23233-hvm-cr-access.patch
  23234-svm-decode-assist-base.patch
  23235-svm-decode-assist-crs.patch
  23236-svm-decode-assist-invlpg.patch
  23238-svm-decode-assist-insn-fetch.patch
  23303-cpufreq-misc.patch
  23304-amd-oprofile-strings.patch
  23305-amd-fam15-xenoprof.patch
  23306-amd-fam15-vpmu.patch
  23334-amd-fam12+14-vpmu.patch
  23338-vtd-force-intremap.patch

- fate#310957 - Update to Xen 4.1.1-rc1 c/s 23064 

- xentrace: dynamic tracebuffer allocation
  xen-unstable.xentrace.dynamic_tbuf.patch
  xen-unstable.xentrace.empty_t_info_pages.patch
  xen-unstable.xentrace.verbose.patch
  xen-unstable.xentrace.no_gdprintk.patch
  xen-unstable.xentrace.comments.patch
  xen-unstable.xentrace.printk_prefix.patch
  xen-unstable.xentrace.remove_debug_printk.patch
  xen-unstable.xentrace.t_info_pages-formula.patch
  xen-unstable.xentrace.register_cpu_notifier-boot_time.patch
  xen-unstable.xentrace.t_info_page-overflow.patch
  xen-unstable.xentrace.t_info_first_offset.patch
  xen-unstable.xentrace.data_size__read_mostly.patch
  xen-unstable.xentrace.__insert_record-dst-type.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=124
2011-05-31 17:35:29 +00:00

69 lines
2.4 KiB
Diff

xentrace: Move the global variable t_info_first_offset into calculate_tbuf_size()
(xen-unstable changeset 23308:fb5313e64335)
Move the global variable t_info_first_offset into
calculate_tbuf_size() because it is only used there. Change the type
from u32 to uint32_t to match type in other places.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
xen/common/trace.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: xen-4.1.1-testing/xen/common/trace.c
===================================================================
--- xen-4.1.1-testing.orig/xen/common/trace.c
+++ xen-4.1.1-testing/xen/common/trace.c
@@ -56,7 +56,6 @@ static DEFINE_PER_CPU_READ_MOSTLY(struct
static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, t_data);
static DEFINE_PER_CPU_READ_MOSTLY(spinlock_t, t_lock);
static u32 data_size;
-static u32 t_info_first_offset __read_mostly;
/* High water mark for trace buffers; */
/* Send virtual interrupt when buffer level reaches this point */
@@ -95,10 +94,10 @@ static struct notifier_block cpu_nfb = {
.notifier_call = cpu_callback
};
-static void calc_tinfo_first_offset(void)
+static uint32_t calc_tinfo_first_offset(void)
{
int offset_in_bytes = offsetof(struct t_info, mfn_offset[NR_CPUS]);
- t_info_first_offset = fit_to_type(uint32_t, offset_in_bytes);
+ return fit_to_type(uint32_t, offset_in_bytes);
}
/**
@@ -108,7 +107,7 @@ static void calc_tinfo_first_offset(void
* The t_info layout is fixed and cant be changed without breaking xentrace.
* Initialize t_info_pages based on number of trace pages.
*/
-static int calculate_tbuf_size(unsigned int pages)
+static int calculate_tbuf_size(unsigned int pages, uint32_t t_info_first_offset)
{
struct t_buf dummy_size;
typeof(dummy_size.prod) max_size;
@@ -157,6 +156,7 @@ static int alloc_trace_bufs(unsigned int
int i, cpu, order;
/* Start after a fixed-size array of NR_CPUS */
uint32_t *t_info_mfn_list;
+ uint32_t t_info_first_offset;
int offset;
if ( t_info )
@@ -166,9 +166,9 @@ static int alloc_trace_bufs(unsigned int
return -EINVAL;
/* Calculate offset in u32 of first mfn */
- calc_tinfo_first_offset();
+ t_info_first_offset = calc_tinfo_first_offset();
- pages = calculate_tbuf_size(pages);
+ pages = calculate_tbuf_size(pages, t_info_first_offset);
order = get_order_from_pages(pages);
t_info = alloc_xenheap_pages(get_order_from_pages(t_info_pages), 0);