Skip to content
  • Andrew Jones's avatar
    arm/arm64: add per thread user_mode flag · f6d10793
    Andrew Jones authored
    
    
    While current_mode() == USR_MODE works on armv7 from PL0 to check
    if we're in user mode, current_mode() would require reading a
    privileged register on armv8. To work around this, on arm64 we
    introduced a 'user_mode' variable. This variable needs to be per
    thread now. Rather than starting to pollute thread_info with a
    bunch of bools, create a flags field and a TIF_USER_MODE flag to
    replace it. Use it on armv7 too for consistency. Also, now that
    we need to create a thread_info initializer, add mpidr utilities
    for setting thread_info->cpu.
    
    Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
    Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    f6d10793