[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18485.62848.335125.152538@harpo.it.uu.se>
Date: Fri, 23 May 2008 00:36:48 +0200
From: Mikael Pettersson <mikpe@...uu.se>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Suresh Siddha <suresh.b.siddha@...el.com>,
Mikael Pettersson <mikpe@...uu.se>,
Andi Kleen <andi@...stfloor.org>, mingo@...e.hu,
tglx@...utronix.de, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, roland@...hat.com, drepper@...hat.com,
Hongjiu.lu@...el.com, linux-kernel@...r.kernel.org,
arjan@...ux.intel.com, rmk+lkml@....linux.org.uk, dan@...ian.org,
asit.k.mallick@...el.com
Subject: Re: [RFC] x86: xsave/xrstor support, ucontext_t extensions
H. Peter Anvin writes:
> Suresh Siddha wrote:
> >
> > hpa, What is the virtualization problem? Are you referring to perf problem?
> > As you noted, regular non-rt signal handlers won't need this cpuid check. It's
> > needed only for those who manually look at non-rt signal frames and interpret it.
> > And also, they can do this check only once and not everytime.
> >
>
> No, relying on CPUID and vdso both have implications for virtualization.
>
> > To me, prtcl() just seems to be an overkill.
>
> I don't think it is ... it's not overkill but rather "underkill"... it's
> a low-performance solution but it's guaranteed to be safe in the
> presence of virtualization of all its various ilk. Note that you don't
> need to be able to *set* the format via prctl(), just *query* (get) it.
I agree. It works, user-space only needs to query it once, so it's not
a big deal that it's a syscall. Admittedly a sigcontext flag would have
been better, but that doesn't seem to be viable.
> > While restoring from the user, kernel also need to find out what layout
> > the user is passing. So it's bi-directional. I prefer the same mechanism
> > (using cookies/magic numbers etc inaddition to uc_flags or cpuid checks) to
> > interpret the fpstate for both user/kernel.
>
> No, it really doesn't: the kernel only needs to be able to read the same
> format as it itself wrote.
The kernel needs to accept one(*) of the formats it can produce, which
is not necessarily what it last produced. It's not inconceivable that
user-space will construct sigframes on the fly (to emulate setcontext),
or that it will mangle sigframes (e.g. to map non-rt to rt before sigreturn).
(*) The format is determined by which version of sys_sigreturn the
user invokes.
/Mikael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists