Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145719557
D29026.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29026.diff
View Options
diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c
--- a/sys/amd64/linux/linux_machdep.c
+++ b/sys/amd64/linux/linux_machdep.c
@@ -251,7 +251,7 @@
switch (args->code) {
case LINUX_ARCH_SET_GS:
if (args->addr < VM_MAXUSER_ADDRESS) {
- set_pcb_flags(pcb, PCB_FULL_IRET);
+ update_pcb_bases(pcb);
pcb->pcb_gsbase = args->addr;
td->td_frame->tf_gs = _ugssel;
error = 0;
@@ -260,7 +260,7 @@
break;
case LINUX_ARCH_SET_FS:
if (args->addr < VM_MAXUSER_ADDRESS) {
- set_pcb_flags(pcb, PCB_FULL_IRET);
+ update_pcb_bases(pcb);
pcb->pcb_fsbase = args->addr;
td->td_frame->tf_fs = _ufssel;
error = 0;
@@ -290,6 +290,7 @@
return (EPERM);
pcb = td->td_pcb;
+ update_pcb_bases(pcb);
pcb->pcb_fsbase = (register_t)desc;
td->td_frame->tf_fs = _ufssel;
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c
--- a/sys/amd64/linux32/linux32_machdep.c
+++ b/sys/amd64/linux32/linux32_machdep.c
@@ -394,11 +394,9 @@
int
linux_set_cloned_tls(struct thread *td, void *desc)
{
- struct user_segment_descriptor sd;
struct l_user_desc info;
struct pcb *pcb;
int error;
- int a[2];
error = copyin(desc, &info, sizeof(struct l_user_desc));
if (error) {
@@ -410,14 +408,10 @@
if (error)
linux_msg(td, "set_cloned_tls copyout info failed!");
- a[0] = LINUX_LDT_entry_a(&info);
- a[1] = LINUX_LDT_entry_b(&info);
-
- memcpy(&sd, &a, sizeof(a));
pcb = td->td_pcb;
+ update_pcb_bases(pcb);
pcb->pcb_gsbase = (register_t)info.base_addr;
td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
- set_pcb_flags(pcb, PCB_32BIT);
}
return (error);
@@ -668,9 +662,7 @@
struct linux_set_thread_area_args *args)
{
struct l_user_desc info;
- struct user_segment_descriptor sd;
struct pcb *pcb;
- int a[2];
int error;
error = copyin(args->desc, &info, sizeof(struct l_user_desc));
@@ -721,18 +713,9 @@
if (error)
return (error);
- if (LINUX_LDT_empty(&info)) {
- a[0] = 0;
- a[1] = 0;
- } else {
- a[0] = LINUX_LDT_entry_a(&info);
- a[1] = LINUX_LDT_entry_b(&info);
- }
-
- memcpy(&sd, &a, sizeof(a));
pcb = td->td_pcb;
+ update_pcb_bases(pcb);
pcb->pcb_gsbase = (register_t)info.base_addr;
- set_pcb_flags(pcb, PCB_32BIT);
update_gdt_gsbase(td, info.base_addr);
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 24, 1:13 PM (4 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28974101
Default Alt Text
D29026.diff (2 KB)
Attached To
Mode
D29026: amd64: Cleanups to setting TLS registers for Linux binaries.
Attached
Detach File
Event Timeline
Log In to Comment