[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 10/10] x86/vm_event: Carry Processor Trace buffer offset in vm_event
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Fri, 29 Jan 2021 23:22:22 +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=5iQJ6DC5JbUpdSrZK2XCjVwldLMtD1Z2rfQeIraRGWU=; b=MAYqOq4hBcWFT/Usz1DPSV20Ke6MJsmSowee1yYZ59jo7N80Cg1vjdLAXmGGpzaIzcEUPdzBbQgSvYuTHFm6WrC2VwyoXf/rJsLTVEZWc/dtMx4LfH68ogFyD37xPnqjX5D54Nh44UvksSrILdk3QmUSIS10Z7E4Se2KMM7mqteM3r6+sK5k/oH/DVLDMaXkW18ilAYs8nE4q7XYyVvM82yo8hvPzlOMpwMbNT/9IQQ8dfJu+BG3roKgyN7tr35zmb3SuO+Ob7SZBNrGHqJOJlNuamhilabb8OrUi/WVFYYRlTY5HtBhJDWrF9XonQkt5dSOKuRVqKMeMeZadFhwEg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eke2mlhLJj0VbaQBTNwkWm+yGTIyDPaapF8eKkh9jE9pRPB6CmuHqpFFJp4pw4A8tmYDZHkj3rqKO2o2K5Y1JI9HHIBucJOi9Qt3rNKt/dn1lHxD+OxxDKTi8jkXUJmwCrKOApSzD/5jw8etm69MUeiIbewqh4oKZ/H8utt8eyGNzikODvucx96kxF5p1RgszzylEND8d/osfsmQ6+f6lj4OBm7YL9ECeQWEs0f/kEG+I39GNfaGDq0bfCz64GZy538bVnWUJbQMus4x8Q/XBuyBEgmuTZMundaNaOB4Pn5BiAo+dnTpIEqNxttSDIvCq30tfKLGqbUUBRcqmigCgw==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Michał Leszczyński <michal.leszczynski@xxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 29 Jan 2021 23:22:43 +0000
- Ironport-sdr: LcypBY2ms1cwZsp9r5UpLupyBzd2kRXa8EltVAw8HkKuw8HIz1QvstvVLN8PFkFmg71RPyMUeE KiIc4K33j+VyK/nKxAhHW0P+6SJkdroIoQDY9rIoJk3gurIFmqY4PN1pC8/c/AUquP2j9pxbWV inkZh6i4qvWbRX9anVCXjKt52ViC03YY7MCWmdccUVn9SOuB0iintV1oI/mikmcNAKPYsaUrR/ Dg5xO0DiZMlf1gLTBQuDOsVeuywBrbnud6QNiBmysJpoTM9dk0IBy0tDR96wHYWP/TgMo0Y0Py eSI=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 26/01/2021 14:27, Jan Beulich wrote:
> On 21.01.2021 22:27, Andrew Cooper wrote:
>> --- a/xen/arch/x86/vm_event.c
>> +++ b/xen/arch/x86/vm_event.c
>> @@ -251,6 +251,9 @@ void vm_event_fill_regs(vm_event_request_t *req)
>>
>> req->data.regs.x86.shadow_gs = ctxt.shadow_gs;
>> req->data.regs.x86.dr6 = ctxt.dr6;
>> +
>> + if ( hvm_vmtrace_output_position(curr, &req->data.regs.x86.pt_offset)
>> != 1 )
>> + req->data.regs.x86.pt_offset = ~0;
> Ah. (Regarding my earlier question about this returning -errno or
> boolean).
>
>> --- a/xen/include/public/vm_event.h
>> +++ b/xen/include/public/vm_event.h
>> @@ -223,6 +223,12 @@ struct vm_event_regs_x86 {
>> */
>> uint64_t npt_base;
>>
>> + /*
>> + * Current offset in the Processor Trace buffer. For Intel Processor
>> Trace
>> + * this is MSR_RTIT_OUTPUT_MASK. Set to ~0 if no Processor Trace is
>> active.
>> + */
>> + uint64_t pt_offset;
> According to vmtrace_output_position() the value is only one half
> of what the named MSR contains. Perhaps "... this is from MSR_..."?
> Not sure whether, despite this, there still is a reason to have
> this 64-bit wide.
This is a vestigial remnant which escaped the "use vmtrace uniformly" work.
It should match the domctl_vmtrace_output_position() format, so each
interface gives the same content for the attempted-platform-neutral version.
~Andrew
|