This patch aims to have mem access vm events sent from the emulator.
This is useful in the case of page-walks that have to emulate
instructions in access denied pages.
We use hvmemul_map_linear_addr() ro intercept r/w access and
hvmemul_insn_fetch() to intercept exec access.
First we try to send
On Mon, Jan 7, 2019 at 2:11 PM Alexandru Stefan ISAILA
wrote:
>
> This patch aims to have mem access vm events sent from the emulator.
> This is useful in the case of page-walks that have to emulate
> instructions in access denied pages.
>
> We use hvmemul_map_linear_addr() ro intercept r/w access
>>> On 09.01.19 at 16:47, wrote:
> On Mon, Jan 7, 2019 at 2:11 PM Alexandru Stefan ISAILA
> wrote:
>> +
>> +req.reason = VM_EVENT_REASON_MEM_ACCESS;
>> +req.u.mem_access.gfn = gfn_x(gfn);
>> +req.u.mem_access.flags |= MEM_ACCESS_FAULT_WITH_GLA |
>> MEM_ACCESS_GLA_VALID;
>> +req.
>> +if ( altp2m_active(current->domain) )
>> +p2m = p2m_get_altp2m(current);
>> +if ( !p2m )
>> +p2m = p2m_get_hostp2m(current->domain);
>> +
>> +gfn_lock(p2m, gfn, 0);
>> +mfn = p2m->get_entry(p2m, gfn, &p2mt, &access, 0, NULL, NULL);
>> +gfn_unlock(p2m, gfn, 0
On Thu, Jan 10, 2019 at 10:41 AM Alexandru Stefan ISAILA
wrote:
>
>
> >> +if ( altp2m_active(current->domain) )
> >> +p2m = p2m_get_altp2m(current);
> >> +if ( !p2m )
> >> +p2m = p2m_get_hostp2m(current->domain);
> >> +
> >> +gfn_lock(p2m, gfn, 0);
> >> +mfn = p2m->
>>>
>>> Newline.
>>>
+default:
+return false;
+}
>>>
>>> I'm not sure the switch is needed, you can't have a PFEC_write_access
>>> for example if the p2m type is p2m_access_w or p2m_access_rw, hence it
>>> seems like it could be simplified to only take the pfec into
>>>
>>> Newline.
>>>
+default:
+return false;
+}
>>>
>>> I'm not sure the switch is needed, you can't have a PFEC_write_access
>>> for example if the p2m type is p2m_access_w or p2m_access_rw, hence it
>>> seems like it could be simplified to only take the pfec into
On Thu, Jan 10, 2019 at 5:40 PM Alexandru Stefan ISAILA
wrote:
>
>
> >>>
> >>> Newline.
> >>>
> +default:
> +return false;
> +}
> >>>
> >>> I'm not sure the switch is needed, you can't have a PFEC_write_access
> >>> for example if the p2m type is p2m_access_w or p2m_