[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5] x86/emulate: Send vm_event from emulate
On 02.07.2019 09:58, Alexandru Stefan ISAILA wrote: > > > On 01.07.2019 18:53, Jan Beulich wrote: >> On 01.07.2019 17:36, Alexandru Stefan ISAILA wrote: >>> On 01.07.2019 17:55, Jan Beulich wrote: >>>> On 01.07.2019 16:45, Alexandru Stefan ISAILA wrote: >>>>> On 01.07.2019 16:13, Jan Beulich wrote: >>>>>>>>> On 04.06.19 at 13:49, <aisaila@xxxxxxxxxxxxxxx> wrote: >>>>>>> + if ( !req.u.mem_access.flags ) >>>>>>> + return false; /* no violation */ >>>>>> >>>>>> How is the "false" here (I think this is the one the description talks >>>>>> about) matching up with the various other ones in the function? >>>>> >>>>> There should be no event if there is no access violation. So in this >>>>> case the emulation is continued as expected. >>>> >>>> But this doesn't answer my question: You use "false" as return value >>>> to indicate different things. Only the one here means "no access >>>> violation". >>> >>> Sorry about that, since this will remain the only return false apart >>> form the main one (return monitor_traps()), false = event was not sent >>> and true = event was sent. >>> >>> I understand that you are asking about the scenario when there was a >>> violation and the event was not sent. Then I can issue a domain_crash() >>> as that is potentially a big issue. >>> >>> I hope I got that correctly. >> >> I don't get the impression that you did. I count a total of four >> "return false" in the function, only one of which explicitly means >> "no access violation" (others may have that meaning implicitly). Let's >> take the p2m_get_mem_access() failure case as an example: What I don't >> understand is why this case and the "no access violation" one are both >> meant to be treated the same. > > Right, at the moment, false means that emulation should continue and > true means that emulation should stop. If it is a must that I return > different errors I will change that in the next version but in the way > that the code is right now they will be treated the same way. Again - it's not a requirement. It depends on whether the behavior is intended to be that way. If it is, it should be clarified in the description or maybe better in a code comment. But to me, without such a clarification, it doesn't look like it should be that way. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |