x86: guard against port I/O overlapping the RTC/CMOS range
authorJan Beulich <jbeulich@suse.com>
Fri, 11 Sep 2020 12:13:46 +0000 (14:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Sep 2020 12:13:46 +0000 (14:13 +0200)
commit899316e02e0d1c9bfe65cca1b20f8140ee9c4d17
tree32039142474db86f1158c0bae4e61a81c652812c
parentcc13835377debe4e300c5f5f11f8f78920778c4e
x86: guard against port I/O overlapping the RTC/CMOS range

Since we intercept RTC/CMOS port accesses, let's do so consistently in
all cases, i.e. also for e.g. a dword access to [006E,0071]. To avoid
the risk of unintended impact on Dom0 code actually doing so (despite
the belief that none ought to exist), also extend
guest_io_{read,write}() to decompose accesses where some ports are
allowed to be directly accessed and some aren't.

While splitting out the new _guest_io_write() also
- add ASSERT_UNREACHABLE(),
- drop stray casts,
- add blank lines.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/pv/emul-priv-op.c