[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets
From: |
Ahmed Karaman |
Subject: |
Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets |
Date: |
Thu, 21 May 2020 13:32:27 +0200 |
On Tue, May 19, 2020 at 8:01 PM Richard Henderson
<address@hidden> wrote:
>
> On 5/19/20 9:21 AM, Ahmed Karaman wrote:
> > The issue arose because the page crossings check in use_goto_tb()
> > function is required only in the system mode. Checking it in both
> > modes causes an unnecessary overhead in the user mode.
>
> It is not only required in system mode.
>
> You can see failures in user-mode if you modify executable pages, or
> change their permissions with mmap. Such as if the guest program
> contains a JIT.
>
>
> r~
Hi Mr. Richard,
I've checked how the use_goto_tb() function is implemented in other
targets, and it appears that they do the page crossings check in the
system mode only.
Below is an example from the arm64 target:
-----------------------------------------------------------------------
static inline bool use_goto_tb(DisasContext *s, int n, uint64_t dest)
{
/* No direct tb linking with singlestep (either QEMU's or the ARM
* debug architecture kind) or deterministic io
*/
if (s->base.singlestep_enabled || s->ss_active ||
(tb_cflags(s->base.tb) & CF_LAST_IO)) {
return false;
}
#ifndef CONFIG_USER_ONLY
/* Only link tbs from inside the same guest page */
if ((s->base.tb->pc & TARGET_PAGE_MASK)!=(dest & TARGET_PAGE_MASK)) {
return false;
}
#endif
return true;
}
-----------------------------------------------------------------------
Please let me know what you think. Does this mean that there is a bug
in this function for the other targets?
That we have to do the page crossings check in both modes to avoid the
user-mode failures that you have mentioned above?
Regards,
Ahmed Karaman
- [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Ahmed Karaman, 2020/05/19
- [PATCH 2/2] target/rx: Check for page crossings in use_goto_tb(), Ahmed Karaman, 2020/05/19
- [PATCH 1/2] target/hppa: Check page crossings in use_goto_tb() only in system mode, Ahmed Karaman, 2020/05/19
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Richard Henderson, 2020/05/19
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Alex Bennée, 2020/05/19
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets,
Ahmed Karaman <=
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Richard Henderson, 2020/05/21
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/25
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/26
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Ahmed Karaman, 2020/05/26
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/26
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/26
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/26