[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/vPIT: check/bound values loaded from state save record
- To: Jason Andryuk <jandryuk@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 12 May 2023 08:50:39 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=XNG8OUxPuCywyEEjSHCJgHFlKeyS1oZ3pXQQZ4rrj20=; b=VpBVDK4MjubYtqmndcmfCaqYV/Rggyf9qsazfbav32kbwYle0gwzvrxqDwu4khgVdI2qWaSN5YYRkFUJWq4uNaDvRJG6jVMauG9Yr5ZTjyIsa4XvLe3sY4LukLsTckFrLwIsMfw5VIj8LDfqwX4OxTinOhGHdQBmY9IxI8EyjpsSm6i+ms5QW8jnTGCYG11cVMDgM7MFTRa3Nd3NTnHJIFv07gj5GK5oynOcACpyD9d1EJ3lcRghRlKQa5VJgZlvlmlntPuRisNDmUHH+rf8ECChg66TzObOb2fx0ZCrTNz6qafgFicMkQkOihtRtix2NWd04v5CBZXWhrAl6II4HQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wtz11kCnOZudvZPrJoREUNwS3Aufk/jjUGq3lzu7XzcaAnUYp1XhYlkbruafbNYpMsIQnUVmQmj9HoQgHdvhCJfV0buv/lF31qkoHkBx1B2qes6icna+uHkqvX6XmULogiyq4VgvcqY5WAlVuJbrDJ6tbjVVp4uG1urji4x4KoH5mRJ97kxh4n1dggqsjrKQ5A93G6RCmZwtBqQFDc2OPAL7rbkenTjvw9Z29kdEQUkHeYlnGJvFEE2n3uDM29iSkLaOiIS+9yd3vjQdxc/Y6LzohSRNrP0PdYBcrjGDKfipu25Bi/PBijOrf8L8HPsFTy9UW6su9O5PTSi/oOgHPA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Fri, 12 May 2023 06:51:00 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11.05.2023 19:51, Jason Andryuk wrote:
> On Thu, May 11, 2023 at 7:50 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> @@ -426,6 +427,33 @@ static int cf_check pit_load(struct doma
>> }
>>
>> /*
>> + * Convert loaded values to be within valid range, for them to represent
>> + * actually reachable state. Uses of some of the values elsewhere
>> assume
>> + * this is the case.
>> + */
>> + for ( i = 0; i < ARRAY_SIZE(pit->hw.channels); ++i )
>> + {
>> + struct hvm_hw_pit_channel *ch = &pit->hw.channels[i];
>> +
>> + /* pit_load_count() will convert 0 suitably back to 0x10000. */
>> + ch->count &= 0xffff;
>> + if ( ch->count_latched >= RW_STATE_NUM )
>> + ch->count_latched = 0;
>> + if ( ch->read_state >= RW_STATE_NUM )
>> + ch->read_state = 0;
>> + if ( ch->read_state >= RW_STATE_NUM )
>> + ch->write_state = 0;
>
> Should these both be write_state?
Definitely. Thanks for noticing!
Jan
|