vpci: fix updating the command register
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 26 Nov 2018 14:40:06 +0000 (15:40 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Nov 2018 14:40:06 +0000 (15:40 +0100)
commit0290d553e0d5ae395c88bd82301251d579e15ea7
tree215bb24276f0a0dbfd258cc77834abbaa934a123
parentfc3637e9af9a301d92695999299a3e9a8458c3c1
vpci: fix updating the command register

When switching the memory decoding bit in the command register the
rest of the changes where dropped, leading to only the memory decoding
bit being updated.

Fix this by writing the command register once the guest physmap
manipulations are done if there are changes to the memory decoding
bit.

Note that when only mapping/unmapping the ROM BAR a fabricated command
register value is passed to modify_bars which is only used to signal
whether the action is a mapping or unmapping, but the value is never
written to the device command register. Turn the maodify_decoding
ASSERT into an ASSERT_UNREACHABLE and make sure that non-debug builds
won't end up writing to the command register if only modifying the ROM
BAR.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/vpci/header.c
xen/include/xen/vpci.h