[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH for-4.14 v3] x86/rtc: provide mediated access to RTC for PVH dom0
On 08.06.2020 13:45, Roger Pau Monné wrote: > On Mon, Jun 08, 2020 at 12:12:40PM +0100, Paul Durrant wrote: >>> From: Roger Pau Monne <roger.pau@xxxxxxxxxx> >>> Sent: 08 June 2020 11:30 >>> >>> @@ -1110,6 +1111,67 @@ static unsigned long get_cmos_time(void) >>> return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec); >>> } >>> >>> +/* Helpers for guest accesses to the physical RTC. */ >>> +unsigned int rtc_guest_read(unsigned int port) >>> +{ >>> + const struct domain *currd = current->domain; >>> + unsigned long flags; >>> + unsigned int data = ~0; >>> + >>> + switch ( port ) >>> + { >>> + case RTC_PORT(0): >>> + /* >>> + * All PV domains are allowed to read the latched value of the >>> first >>> + * RTC port. This is useful in order to store data when debugging. >>> + */ >> >> Is this comment correct. AFAICT your call to register_portio_handler() would >> allow a PVH dom0 to access this too. > > Oh, maybe this is not clear enough. Yes, PV/PVH dom0 will get access > to both ports, but a PV domU will also get read/write access to the > latched value in the first RTC port, even when it doesn't have access > to the second RTC port. I'd word this slightly differently: "..., even when it doesn't have access to either physical RTC port." Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |