[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 05/10] common/domain: allocate vmtrace_pt_buffer
Hi, On 30/06/2020 13:33, Michał Leszczyński wrote: +static int vmtrace_alloc_buffers(struct vcpu *v) +{ + struct page_info *pg; + uint64_t size = v->domain->vmtrace_pt_size; + + if ( size < PAGE_SIZE || size > GB(4) || (size & (size - 1)) ) + { + /* + * We don't accept trace buffer size smaller than single page + * and the upper bound is defined as 4GB in the specification. This is common code, so what specification are you talking about?I am guessing this is an Intel one, but I don't think Intel should dictate the common code implementation. + * The buffer size must be also a power of 2. + */ + return -EINVAL; + } + + pg = alloc_domheap_pages(v->domain, get_order_from_bytes(size), + MEMF_no_refcount); + + if ( !pg ) + return -ENOMEM; + + v->arch.vmtrace.pt_buf = pg; v->arch.vmtrace.pt_buf is not defined on Arm. Please make sure common code build on all arch. Cheers, -- Julien Grall
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |