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

Re: [PATCH] x86/svm: Provide EXITINFO decodes for MOV CR/DR intercepts


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 6 Apr 2023 10:52:19 +0100
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DryfQqvKLhPUZKX04YcojEKABkspmMe186zBuIMmdKw=; b=aAw0Cc+ACP1iF9TYt8/EeRM80CqVx07H+cewXsgJuIR+nH3cjk+bcnn34zJJm7k9Jw/avcYtQllTdTmTzwp5ynkR53OLbqLCGfWOXMcSPOJzq1F1ELXQwpnLKTwf89hG/KeZIT+22YN60kZpOGxNgcXeKd0HZc50H2fHfcMGiluAPr8g4d8GEJGlUgTEmQehe5IgjhEL0liuSWw4p26LPWBmUktUJn3B+/+PIIdGb/3WoMXN1Z5MrP8dHqSkjWs34MZ+8pvycznqmzJNrU24M7FrIT5Yumi4CXHIiIM6YyB7gG4YDmDs76IjRN4dnyUOhGa/SYPHJuDHLdTNW9qDnA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l0hgq3DTqbUwTIZVf4TGGn1CCsbF2o2inFaaliXgsGg/Qt9FB8YDTubMOXkcTbIIi3hHlQRPUtTmvZSA/kP1Yw4fci2sjE9BsDVz+jmExBVgVTQ3xN5Qo7hDZm2NCszd2/H/74rWCmAyjl3Mgxx+5bBRbNAPf3hM8iyCXkX6O2m9ObE4RPjgCuLxBgatsNxNR8pf3LStGsGsICEhL43Voj0GkVlR7qwjV4B3+Z9dkUYBaAhd9oDPqnFMyJOM0SKYQBUgMDhvL72245hr7kCihe96B8XcYQV92k3I+4lnG4w1vxi3zb0wbsnaKipL6tdGPnmqX3sioMy/eNdhauqzyQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 06 Apr 2023 09:53:09 +0000
  • Ironport-data: A9a23:A13gU6uuSGDMQvKzDCQyQQdrYefnVHtfMUV32f8akzHdYApBsoF/q tZmKWDSP/mIYmukeN12a4W1900P7JPVnIQ1GQc/qio2RnwS+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj6Fv0gnRkPaoQ5AOGySFMZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwOnMWQhyNruuPzpmWFeR0puUGLJTsM9ZK0p1g5Wmx4fcOZ7nmGv2Pz/kHmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0ouiP60aIS9lt+iHK25mm6xo G7c8nu/KRYdLNGFkhKO8262h/+JliT+MG4XPOTgqq820QDMlwT/DjUWc3S6jPu+0nWlXuJFI WlJoBRtvJMLoRnDot7VGkfQTGS/lhwWVsdUEuY6wBqQ0aeS6AGcbkAbShZRZdpgs9U5LRQ62 1nMk973CDhHtLyOVWnb5rqStSm1OyUeMSkFfyBscOcey9zqoYV2hBSQSN9mSfaxloesQW+2x C2Wpi8jgblVldQMy6iw4VHAhXSru4TNSQk2oA7QWwpJ8z9EWWJsXKTwgXCz0BqKBN/xooWp1 JTcp/Wj0Q==
  • Ironport-hdrordr: A9a23:PE+laqsY6QuPr8Fa8uEVgEDT7skDS9V00zEX/kB9WHVpm62j5q OTdZEgviMc5wxxZJhNo7690cq7Lk80l6QFhLX5VI3KNGOK1FdARLsSj7cKqAeBJ8SRzJ866Y 5QN4R4Fd3sHRxboK/BkXCF+51J+qjizElwv5a480tQ
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06/04/2023 10:31 am, Jan Beulich wrote:
> On 05.04.2023 22:44, Andrew Cooper wrote:
>> This removes raw number manipulation, and makes the logic easier to follow.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks.

>
> One remark though:
>
>> --- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h
>> +++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
>> @@ -450,6 +450,11 @@ struct vmcb_struct {
>>  
>>                  uint64_t nrip;
>>              } io;
>> +            struct {
>> +                uint64_t gpr:4;
>> +                uint64_t :59;
>> +                bool     mov_insn:1; /* MOV, as opposed to LMSW, CLTS, etc 
>> */
>> +            } mov;
> The field being named just "mov" makes it apparently applicable to DRn
> moves, too (and the title supports this), yet the top bit doesn't have
> this meaning there. So perhaps say "MOV-CR" (or alike) in the comment?

Hmm - I'd not spotted that distinction.

Xen never decodes the exitinfo for a DR access - we just resync dr
state, drop the intercept and reenter the guest.

Therefore I think it would be better to rename "mov" to "mov_cr" so you
can't use the mov_insn field in a context that plausibly looks like a dr
access.

Thoughts?

~Andrew



 


Rackspace

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