aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2021-03-15 15:33:39 +0000
committerWill Deacon <will@kernel.org>2021-03-18 09:44:45 +0000
commit123ee474b97b5b04b759b5d9f9f6723852b78394 (patch)
treee05bbaff9ce5fca3b74142c6fabece194d5b5edd
parent8c45f36430bd039762628c4c146c80a47cee84da (diff)
downloadkvmtool-123ee474b97b5b04b759b5d9f9f6723852b78394.tar.gz
hw/rtc: Switch to new trap handler
Now that the RTC device has a trap handler adhering to the MMIO fault handler prototype, let's switch over to the joint registration routine. This allows us to get rid of the ioport shim routines. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/r/20210315153350.19988-12-andre.przywara@arm.com Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--hw/rtc.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/hw/rtc.c b/hw/rtc.c
index 664d4cb0..ee4c9102 100644
--- a/hw/rtc.c
+++ b/hw/rtc.c
@@ -120,23 +120,6 @@ static void cmos_ram_io(struct kvm_cpu *vcpu, u64 addr, u8 *data,
}
}
-static bool cmos_ram_in(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size)
-{
- cmos_ram_io(vcpu, port, data, size, false, NULL);
- return true;
-}
-
-static bool cmos_ram_out(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size)
-{
- cmos_ram_io(vcpu, port, data, size, true, NULL);
- return true;
-}
-
-static struct ioport_operations cmos_ram_ioport_ops = {
- .io_out = cmos_ram_out,
- .io_in = cmos_ram_in,
-};
-
#ifdef CONFIG_HAS_LIBFDT
static void generate_rtc_fdt_node(void *fdt,
struct device_header *dev_hdr,
@@ -169,7 +152,7 @@ int rtc__init(struct kvm *kvm)
return r;
/* PORT 0070-007F - CMOS RAM/RTC (REAL TIME CLOCK) */
- r = ioport__register(kvm, 0x0070, &cmos_ram_ioport_ops, 2, NULL);
+ r = kvm__register_pio(kvm, 0x0070, 2, cmos_ram_io, NULL);
if (r < 0)
goto out_device;
@@ -188,7 +171,7 @@ dev_init(rtc__init);
int rtc__exit(struct kvm *kvm)
{
/* PORT 0070-007F - CMOS RAM/RTC (REAL TIME CLOCK) */
- ioport__unregister(kvm, 0x0070);
+ kvm__deregister_pio(kvm, 0x0070);
return 0;
}