lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 28 Sep 2021 16:10:39 -0700
From:   "Luck, Tony" <>
To:     Dave Hansen <>
Cc:     Andy Lutomirski <>,
        Fenghua Yu <>,
        Thomas Gleixner <>,
        Ingo Molnar <>, Borislav Petkov <>,
        "Peter Zijlstra (Intel)" <>,
        Lu Baolu <>,
        Joerg Roedel <>,
        Josh Poimboeuf <>,
        Dave Jiang <>,
        Jacob Jun Pan <>,
        Raj Ashok <>,
        "Shankar, Ravi V" <>,,
        the arch/x86 maintainers <>,
        Linux Kernel Mailing List <>
Subject: Re: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

Moving beyond pseudo-code and into compiles-but-probably-broken-code.

The intent of the functions below is that Fenghua should be able to

void fpu__pasid_write(u32 pasid)
	u64 msr_val = pasid | MSR_IA32_PASID_VALID;
	struct ia32_pasid_state *addr;

	addr = begin_update_one_xsave_feature(current, XFEATURE_PASID, true);
	addr->pasid = msr_val;

So here's the two new functions that would be added to


void *begin_update_one_xsave_feature(struct task_struct *tsk,
                                     enum xfeature xfeature, bool full)
        struct xregs_state *xsave = &tsk->thread.fpu.state.xsave;
        struct xregs_state *xinit = &init_fpstate.xsave;
        u64 fmask = 1ull << xfeature;
        void *addr;

        BUG_ON(!(xsave->header.xcomp_bv & fmask));


        addr = __raw_xsave_addr(xsave, xfeature);

        if (full || tsk != current) {
                memcpy(addr, __raw_xsave_addr(xinit, xfeature), xstate_sizes[xfeature]);
                goto out;

	/* could optimize some cases where xsaves() isn't fastest option */
        if (!(xsave->header.xfeatures & fmask))
                xsaves(xsave, fmask);

        xsave->header.xfeatures |= fmask;
        return addr;

void finish_update_one_xsave_feature(struct task_struct *tsk)
        set_ti_thread_flag(task_thread_info(tsk), TIF_NEED_FPU_LOAD);



Powered by blists - more mailing lists