hvm/hpet: Correctly limit period to a maximum.
authorDon Slutz <dslutz@verizon.com>
Fri, 2 May 2014 20:18:02 +0000 (16:18 -0400)
committerTim Deegan <tim@xen.org>
Thu, 8 May 2014 11:03:53 +0000 (12:03 +0100)
commit825e70b1ec9df2a2d9f949232c4a368a0ea77416
treec51db101ba72b7816479e60de6fc7656b88879f4
parent02c8401f0cd5f1f7ea3cfd8d98a0f246b2999c88
hvm/hpet: Correctly limit period to a maximum.

In the code section after the comment:

    /*
     * Clamp period to reasonable min/max values:
     *  - minimum is 100us, same as timers controlled by vpt.c
     *  - maximum is to prevent overflow in time_after() calculations
     */

The current maximum limit actually allows "bad" values like 0 and 1.
This is because it uses a mask not a maximum.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/hpet.c