x86/HVM: correct partial HPET_STATUS write emulation

For partial writes the non-written parts of registers are folded into
the full 64-bit value from what they're presently set to. That's wrong
to do though when the behavior is write-1-to-clear: Writes not
including to low 3 bits would unconditionally clear all ISR bits which
are presently set. Re-calculate the value to use.

Fixes: be07023be1 ("x86/vhpet: add support for level triggered interrupts")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 41d358d2f9
master date: 2024-08-29 10:02:20 +0200
This commit is contained in:
Jan Beulich committed 2024-09-24 14:40:03 +02:00
1 parent 743af91672
commit 6e96dee93c
1 file changed
+2 -1
+2 -1
View File
@@ -404,7 +404,8 @@ static int cf_check hpet_write(
break;
case HPET_STATUS:
/* write 1 to clear. */
/* Write 1 to clear. Therefore don't use new_val directly here. */
new_val = val << ((addr & 7) * 8);
while ( new_val )
{
bool active;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.