[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/vmx: Provide named fields for IO exit qualification
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 21 Mar 2023 10:18:11 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w7pNI2lOTWTJSy3yy4DlRG2H2RV1SYngs6WL/wKhKxY=; b=TIhTUSQI2fhNI4STQKN+YnCMGhWlqodsCpqkYfEKFyEkoEpevA5srwxCyfNgMysaxz2Q1vezIUAbyY0sQexFJWixf0HGs840TMtb/KXBFDFU5V6w4rhQq8U06dgDjVRgXLjtcTTQXjY5wS2CrEX3XACXXE2/oPAywjAZHccEdVnCKQiWFp7j1lNoAWLN2W4vapnMy0l8ZNzAOxvRIBWknRcLxYh0dlZAur9WqMBwxeGh/xd3WzGRS4UU5LL9G+abEK1sHwkty7EpXm9kxhOPopK0IMjkBQcbQWd3OuW7xDuRG00WJIXZUISKaKAUxrwEQmFoSzNYHGO1fi5hnx0RMg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QV89mGK+2aSMQeDTgUIEa1g3fQXQPMK/PDPhW+WFgqzFnrUoa9tJsLUaL+q5qviKOXtQC+j0ozzJlKKAjR2pumPotxw4X6ZW3MiZx9CsQ77Oky22caP3DHAd9jPwJO2X92Os1vA6tE1b3GghQwvqficgSD9COKOFd0hPeLtmuUMEfc84veNMa5jMRs96shmidUoCwjnDVhFaPTMMsjZUGzhl2TPz9NVFGeKnQQKbgyM6VStkjtBceZ26KynIfYbvqk8+A1cgSsj495xta/dsXU0CVUZxuCSg14Cjvlna+2Quw+K+X7xWxBw6j+HQxzsX8FTkYdZnX6+mlkitVO06oQ==
- 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>, Kevin Tian <kevin.tian@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 21 Mar 2023 10:18:38 +0000
- Ironport-data: A9a23:drNyMaLI9CMGnGMlFE+R6ZQlxSXFcZb7ZxGr2PjKsXjdYENS1D0An zMYWDuDPqnbMDb8Lo0nb4yx/R9V757XxodjQAJlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPTwP9TlK6q4mhA5QZnPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5FOmNy7 LsUBQxdUQqllsy82Z2VQ9Vz05FLwMnDZOvzu1lG5BSBV7MMZ8mGRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dupTSLpOBy+OGF3N79U9qGX8hK2G2fo XrL5T/RCRAGLt2PjzGC9xpAg8eWxXqlCNhPROfQGvhChmyInTQ3LRMqcUqAguL+sHCnXOwcA hlBksYphe1onKCxdfH/VRClpH+PvjYHRsFdVeY97Wml1a788wufQG8eQVZpa9E4tclwWT0j0 HeImc/kAXpkt7j9YWKQ8PKYoC2/PQARLHQefmkUQA0d+d7hrYovyBXVQb5e/LWdi9T0HXT6x WmMpS1m3bEL15ZXj+O84EzNhC+qqt7RVAkp6w7LX2WjqARkeIqiYI/u4l/ehRpdELukopC6l CBss6CjAComVPlhSATlrD0xIYyU
- Ironport-hdrordr: A9a23:OTGeJ685V+T9N2pW2CJuk+DjI+orL9Y04lQ7vn2ZKCYlCvBw8v rF8cjzuiWE7Ar5NEtQ/+xoW5PgfZq/z+8R3WB5B97LNzUO3lHYT72KwrGSoQEIcBeOkdK1u5 0QCpSWy+eeMbG5t6rHCcWDferICePmzJyV
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 21/03/2023 7:59 am, Jan Beulich wrote:
> On 20.03.2023 19:20, Andrew Cooper wrote:
>> This removes most of the opencoded bit logic on the exit qualification.
>> Unfortunately, size is 1-based not 0-based, so need adjusting in a separate
>> variable.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> In principle
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> but ...
>
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -4560,23 +4560,37 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
>> break;
>>
>> case EXIT_REASON_IO_INSTRUCTION:
>> - __vmread(EXIT_QUALIFICATION, &exit_qualification);
>> - if ( exit_qualification & 0x10 )
>> + {
>> + union {
>> + unsigned long raw;
>> + struct {
>> + uint32_t size:3;
>> + bool in:1;
>> + bool str:1;
>> + bool rep:1;
>> + bool imm:1;
>> + uint32_t :9;
>> + uint16_t port;
> ... I'm not sure this is sufficiently portable: Whether a bitfield of type
> uint32_t followed by a non-bitfield is padded to fill the rest of the
> containing 32-bit field is left unspecified by C99; this particular aspect
> isn't even "implementation defined" (afaics). Therefore I think it would
> be better if either uint32_t was replaced by uint16_t, or if port also was
> made a bit field (and then perhaps also of type uint32_t, or unsigned int).
Port is a naturally aligned uint16_t field so I'd prefer to keep it as is.
I'll drop the others to uint16_t. Furthermore, as it's simple cleanup
specifically for another pending patch, I'll commit this now and follow
up on the other thread.
~Andrew
|