[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 08/16] xen/domain: Add vmtrace_size domain creation parameter


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 1 Feb 2021 11:19:46 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WK4h1NonlODp/K5/vAkWB4w8rS9acAkKX6uErWPY+To=; b=WmR1Yo9dcIg9y/BUUXULmCwVqBnfa1DdmVE7Ibmdv7rUcsOdM9TsWZJJ/wM4mBZBL2Er1kKVejVgqbnHOthWxsFVH1RLxu6TjyWWm6P6tCVp0bIo9JQt2Bg3ZhYjd8nQRh0f+f5rao4jdCbbF8bCByPYFs4qjq5E8aPc+7dyzdwuzGCMUpdoJUCLbIKduwSHq+lTwRBLSwBzNPexx4pw8Oyd4Fu4EuCQTceUBB57fz41Rq17YdVS4UgwL07Zf1oVZuNzcyp8Fmq/1UhcGv7hgrAwxzJHqP6RLrkNbrqI2KSQLRFwHu8Ye88bauw6V506EStBLonKMRCnJoFMCdo/Mw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R7bM7vhPuVB1HkDaSMuaH54xy8B1EuDZW7BLuYeBEg4oeYhAU4cOSt/wR+rQ/iMokyW8lW0fSHs660EkbhKj3k04NzFPxsbRrwmP66DphDVZXwbqBFpqJz8YnMraKHPRjaa9d67fyGKz7khPJwagU56thlQRn32N5Y0kzAS2tTZV/1lgSQwKexawdv/PkFFR5W+3hSUJYGLCYqf5RUBP2Ox6zXZmz4wmN5gEn9mieHc9jKqAiheBNnfjsUpvMRt9N9nVausMSKMm1bUCc2ULbJ1lvrKJ43AyknJR0L8qrZw5MoQpA7ScolEnB6dPOk8CuvKkZ/zZNGaURP2jMyLauw==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Michał Leszczyński <michal.leszczynski@xxxxxxx>, "Jan Beulich" <JBeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • Delivery-date: Mon, 01 Feb 2021 11:20:11 +0000
  • Ironport-sdr: ZdEBIlaBH/IEloNEBEteueFtJkdo72H2ux3hy4IGsGLLSGXWRqrQNiOuXzmoAq+zfWII31gFnH ofTI758DA3gw5H7EhUwsXCJb/Ch4xQRqyrMhEMv18L8OZru40Z3qoLQz8HqzwpExRWUlVtB5n7 li1RfuyFDt1++0g5OtTWhpGfaDZ91tla2YIHA4ZDUVReGkdOHjsg8iyViURP8AQ7vxblUqjsDz QuXVEeOE5Y6OZTn0MiugHNFdj9Nm7mu7zXonZ0DQBs9hPKV/5Oq2GjGcBU1p7AQYGpJ3db0VNB 598=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01/02/2021 10:51, Roger Pau Monné wrote:
> On Sat, Jan 30, 2021 at 02:58:44AM +0000, Andrew Cooper wrote:
>> From: Michał Leszczyński <michal.leszczynski@xxxxxxx>
>>
>> To use vmtrace, buffers of a suitable size need allocating, and different
>> tasks will want different sizes.
>>
>> Add a domain creation parameter, and audit it appropriately in the
>> {arch_,}sanitise_domain_config() functions.
>>
>> For now, the x86 specific auditing is tuned to Processor Trace running in
>> Single Output mode, which requires a single contiguous range of memory.
>>
>> The size is given an arbitrary limit of 64M which is expected to be enough 
>> for
>> anticipated usecases, but not large enough to get into long-running-hypercall
>> problems.
>>
>> Signed-off-by: Michał Leszczyński <michal.leszczynski@xxxxxxx>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.

>> diff --git a/xen/common/domain.c b/xen/common/domain.c
>> index d1e94d88cf..491b32812e 100644
>> --- a/xen/common/domain.c
>> +++ b/xen/common/domain.c
>> @@ -132,6 +132,71 @@ static void vcpu_info_reset(struct vcpu *v)
>>      v->vcpu_info_mfn = INVALID_MFN;
>>  }
>>  
>> +static void vmtrace_free_buffer(struct vcpu *v)
>> +{
>> +    const struct domain *d = v->domain;
>> +    struct page_info *pg = v->vmtrace.pg;
>> +    unsigned int i;
>> +
>> +    if ( !pg )
>> +        return;
>> +
>> +    v->vmtrace.pg = NULL;
>> +
>> +    for ( i = 0; i < (d->vmtrace_size >> PAGE_SHIFT); i++ )
>> +    {
>> +        put_page_alloc_ref(&pg[i]);
>> +        put_page_and_type(&pg[i]);
>> +    }
>> +}
>> +
>> +static int vmtrace_alloc_buffer(struct vcpu *v)
> You might as well make this return true/false, as the error code is
> ignored by the caller (at least in this patch).

At some point vcpu_create() needs to be fixed not to lose the error
code.  That is the real bug here.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.