uti: rename x86-specific 'fs' to 'tls' + arm implem
Note: the original fujitsu implementation didn't rename the various save_fs function/desc to save_tls for some reason, might as well go all the way though... Change-Id: Ic362c15c8b320c4d258d2ead8c5fd4eafd9d0ae9 Fujitsu: POSTK_DEBUG_ARCH_DEP_91
This commit is contained in:
committed by
Masamichi Takagi
parent
8356ef6c96
commit
c32edff2bb
@@ -261,25 +261,35 @@ struct trans_uctx {
|
||||
};
|
||||
|
||||
void
|
||||
restore_fs(unsigned long fs)
|
||||
restore_tls(unsigned long addr)
|
||||
{
|
||||
wrmsrl(MSR_FS_BASE, fs);
|
||||
wrmsrl(MSR_FS_BASE, addr);
|
||||
}
|
||||
|
||||
void
|
||||
save_fs_ctx(void *ctx)
|
||||
save_tls_ctx(void __user *ctx)
|
||||
{
|
||||
struct trans_uctx *tctx = ctx;
|
||||
struct trans_uctx __user *tctx = ctx;
|
||||
struct trans_uctx kctx;
|
||||
|
||||
rdmsrl(MSR_FS_BASE, tctx->fs);
|
||||
if (copy_from_user(&kctx, tctx, sizeof(struct trans_uctx))) {
|
||||
pr_err("%s: copy_from_user failed.\n", __func__);
|
||||
return;
|
||||
}
|
||||
rdmsrl(MSR_FS_BASE, kctx.fs);
|
||||
}
|
||||
|
||||
unsigned long
|
||||
get_fs_ctx(void *ctx)
|
||||
get_tls_ctx(void __user *ctx)
|
||||
{
|
||||
struct trans_uctx *tctx = ctx;
|
||||
struct trans_uctx __user *tctx = ctx;
|
||||
struct trans_uctx kctx;
|
||||
|
||||
return tctx->fs;
|
||||
if (copy_from_user(&kctx, tctx, sizeof(struct trans_uctx))) {
|
||||
pr_err("%s: copy_from_user failed.\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
return kctx.fs;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
@@ -370,9 +380,9 @@ static inline bool pte_is_write_combined(pte_t pte)
|
||||
|
||||
/*
|
||||
* The assembler switch_ctx is save/load registers in the context.
|
||||
* Do FS save/load and register host_thread with ioctl.
|
||||
* Do TLS save/load and register host_thread with ioctl.
|
||||
*/
|
||||
long arch_switch_ctx(struct uti_save_fs_desc *desc)
|
||||
long arch_switch_ctx(struct uti_switch_ctx_desc *desc)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user