lkml.org 
[lkml]   [2022]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCHv3 4/8] x86/mm: Handle LAM on context switch
    On Thu, Jun 16, 2022 at 11:08:07AM +0200, Peter Zijlstra wrote:
    > Either use that one spare byte, or find room elsewhere I suppose.

    Okay, I will put into the byte after invalidate_other and modify
    tlbstate_lam_cr3_mask() and set_tlbstate_lam_cr3_mask() to shift it
    accordingly.

    It looks like this:

    struct tlb_state {
    struct mm_struct * loaded_mm; /* 0 8 */
    union {
    struct mm_struct * last_user_mm; /* 8 8 */
    unsigned long last_user_mm_spec; /* 8 8 */
    }; /* 8 8 */
    union {
    struct mm_struct * last_user_mm; /* 0 8 */
    unsigned long last_user_mm_spec; /* 0 8 */
    };

    u16 loaded_mm_asid; /* 16 2 */
    u16 next_asid; /* 18 2 */
    bool invalidate_other; /* 20 1 */
    u8 lam; /* 21 1 */
    unsigned short user_pcid_flush_mask; /* 22 2 */
    unsigned long cr4; /* 24 8 */
    struct tlb_context ctxs[6]; /* 32 96 */

    /* size: 128, cachelines: 2, members: 9 */
    };

    --
    Kirill A. Shutemov

    \
     
     \ /
      Last update: 2022-06-16 18:41    [W:6.108 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site