Unix

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • gnumach ChangeLog i386/i386/gdt.h i386/i386/pcb...

    8 answers - 3823 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello!
    CVSRT:/cvsroot/hurd
    Module name:gnumach
    Branch:gnumach-1-branch
    Changes by:Samuel Thibault <sthibaul>06/11/05 20:39:25
    []
    2006-11-05 Barry deFreese <bddebian (AT) comcast (DOT) net>
    [task #5878 ``Backport code from GNU Mach's trunk to
    gnumach-1-branch: i386_set_gdt, i386_get_gdt'']
    []
    * i386/i386/user_ldt.c (i386_set_gdt, i386_get_gdt): New functions.
    Since this is a back-port from SKit Mach's code, it might be interesting
    to explain the following divergences from the SKit code perhaps
    Roland would like to have these changes explained, as he's written the
    original code, if I recall correctly:
    #v+
    @@ -221,16 +223,16 @@ i386_set_ldt(thread, first_selector, des
    []
    - else if (thread == current_thread()) {
    - struct x86_desc template = {0, 0, 0, ACC_P, 0, 0 ,0};
    + else {
    + struct real_descriptor template = {0, 0, 0, ACC_P, 0, 0 ,0};
    #v-
    The following differences might be caused simply by the SKit Mach code
    being different from the GNU Mach one, but you can confirm that more
    easily than I could do right now.
    #v+
    @@ -411,46 +413,45 @@ i386_set_gdt (thread_t thread, int *sele
    if (*selector == -1)
    {
    - for (idx = sel_idx (USER_GDT); idx < sel_idx (USER_GDT) + USER_GDT_SLTS;
    - ++idx)
    + for (idx = 0; idx < USER_GDT_SLTS; ++idx)
    if ((thread->pcb->ims.user_gdt[idx].access & ACC_P) == 0)
    {
    - *selector = (idx << 3) | SEL_PL_U;
    + *selector = ((idx + sel_idx(USER_GDT)) << 3) | SEL_PL_U;
    break;
    }
    - if (idx == sel_idx (USER_GDT) + USER_GDT_SLTS)
    + if (idx == USER_GDT_SLTS)
    return KERN_NSPACE; /* ? */
    }
    else if ((*selector & (SEL_LDT|SEL_PL)) != SEL_PL_U
    - || sel_idx (*selector) < USER_GDT
    - || sel_idx (*selector) >= USER_GDT + USER_GDT_SLTS)
    + || sel_idx (*selector) < sel_idx(USER_GDT)
    + || sel_idx (*selector) >= sel_idx(USER_GDT) + USER_GDT_SLTS)
    return KERN_INVALID_ARGUMENT;
    else
    - idx = sel_idx (*selector);
    + idx = sel_idx (*selector) - sel_idx(USER_GDT);
    - if ((desc->access & ACC_P) == 0)
    + if ((desc.access & ACC_P) == 0)
    memset (&thread->pcb->ims.user_gdt[idx], 0,
    sizeof thread->pcb->ims.user_gdt[idx]);
    - else if ((desc->access & (ACC_TYPE|ACC_PL)) != (ACC_TYPE_USER|ACC_PL_U))
    + else if ((desc.access & (ACC_TYPE_USER|ACC_PL)) != (ACC_TYPE_USER|ACC_PL_U))
    return KERN_INVALID_ARGUMENT;
    else
    - thread->pcb->ims.user_gdt[idx] = *desc;
    + thread->pcb->ims.user_gdt[idx] = desc;
    return KERN_SUCCESS;
    }
    []
    [i386_get_gdt]
    if ((selector & (SEL_LDT|SEL_PL)) != SEL_PL_U
    - || sel_idx (selector) < USER_GDT
    - || sel_idx (selector) >= USER_GDT + USER_GDT_SLTS)
    + || sel_idx (selector) < sel_idx(USER_GDT)
    + || sel_idx (selector) >= sel_idx(USER_GDT) + USER_GDT_SLTS)
    return KERN_INVALID_ARGUMENT;
    - *desc = thread->pcb->ims.user_gdt[sel_idx (selector)];
    + *desc = thread->pcb->ims.user_gdt[sel_idx (selector) - sel_idx(USER_GDT)];
    #v-
    Please also add a note to the ChangeLog that this commit is a back-port,
    see the Roland McGrath ChangeLog entry from 2006-05-14 for an idea how
    this might look like.
    * New file.
    Please move that file to `linux/src/include/linux/head.h' (and then add a
    proper ChangeLog entry for that file). I'm not going to follow the `src'
    vs. `dev' distinction any further.
    Thanks for completing this task!
    Regards,
    Thomas
    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
    PGP SIGNATURE
    Version: GnuPG v1.2.5 (GNU/Linux)
    HHblzpt9vn59PcY3Ht2L3M0=
    =Xy+I
    PGP SIGNATURE
  • No.1 | | 1099 bytes | |

    Hello again!

    CVSRT:/cvsroot/hurd
    Module name:gnumach
    Branch:gnumach-1-branch
    Changes by:Samuel Thibault <sthibaul>06/11/05 20:39:25

    []
    2006-11-05 Barry deFreese <bddebian (AT) comcast (DOT) net>

    [task #5878 ``Backport code from GNU Mach's trunk to
    gnumach-1-branch: i386_set_gdt, i386_get_gdt'']

    I saw some notes on the #hurd irc channel on freenode that you've been
    writing a tiny program to test this functionality. Would things like
    that be worth for being added to GNU Mach's test suite? course the
    problem is that you first have to reboot to the freshly built kernel in
    order to be able to test it, but it might nevertheless be useful to boot
    the newly built kernel and then return to the build directory and run
    `make check-SMETHING' or similar. What are other's thoughts?

    Regards,
    Thomas

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.2.5 (GNU/Linux)

    EvHlTk75NALkomwF+32M=
    =vELK
    PGP SIGNATURE
  • No.2 | | 1235 bytes | |

    Hi,

    Thomas Schwinge, le Sun 05 Nov 2006 22:34:56 +0100, a :
    #v+
    @@ -221,16 +223,16 @@ i386_set_ldt(thread, first_selector, des
    []
    - else if (thread == current_thread()) {
    - struct x86_desc template = {0, 0, 0, ACC_P, 0, 0 ,0};
    + else {
    + struct real_descriptor template = {0, 0, 0, ACC_P, 0, 0 ,0};
    #v-
    The following differences might be caused simply by the SKit Mach code
    being different from the GNU Mach one,

    Exactly. Just the names differ.
    - for (idx = sel_idx (USER_GDT); idx < sel_idx (USER_GDT) + USER_GDT_SLTS;
    - ++idx)
    + for (idx = 0; idx < USER_GDT_SLTS; ++idx)

    There was a mixture of index / selector in this code, which eventually
    wasn't working. Defining idx between 0 an USER_GDT_SLT-1 makes the
    whole code easier to read, and eventually work :).

    * New file.

    Please move that file to `linux/src/include/linux/head.h' (and then add a
    proper ChangeLog entry for that file). I'm not going to follow the `src'
    vs. `dev' distinction any further.

    Ah. I guess this policy change should be clearly stated somewhere.

    Samuel

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
  • No.3 | | 458 bytes | |

    Roland McGrath, le Sun 05 Nov 2006 13:41:43 -0800, a :
    - else if (thread == current_thread()) {
    - struct x86_desc template = {0, 0, 0, ACC_P, 0, 0 ,0};
    + else {
    + struct real_descriptor template = {0, 0, 0, ACC_P, 0, 0 ,0};

    This can't be right (changing the if).

    Uh, didn't notice that. Barry, do you remember why you dropped the if?

    Samuel

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
  • No.4 | | 303 bytes | |

    Roland McGrath, le Sun 05 Nov 2006 13:43:08 -0800, a :
    It's worthwhile to collect such test cases, but let's not worry about
    putting them into the gnumach package yet.

    Where to put them then?

    Samuel

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
  • No.5 | | 642 bytes | |

    Samuel Thibault, le Sun 05 Nov 2006 22:49:59 +0100, a :
    Roland McGrath, le Sun 05 Nov 2006 13:41:43 -0800, a :
    - else if (thread == current_thread()) {
    - struct x86_desc template = {0, 0, 0, ACC_P, 0, 0 ,0};
    + else {
    + struct real_descriptor template = {0, 0, 0, ACC_P, 0, 0 ,0};

    This can't be right (changing the if).

    Uh, didn't notice that. Barry, do you remember why you dropped the if?

    That's actually not from Barry's patch (the code above deals with LDT,
    not GDT), but from Jeroen's.

    Samuel

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
  • No.6 | | 1418 bytes | |

    Hello!

    Sun, Nov 05, 2006 at 10:46:38PM +0100, Samuel Thibault wrote:
    Thomas Schwinge, le Sun 05 Nov 2006 22:34:56 +0100, a ?crit :
    * New file.

    Please move that file to `linux/src/include/linux/head.h' (and then add a
    proper ChangeLog entry for that file). I'm not going to follow the `src'
    vs. `dev' distinction any further.

    Ah.

    Thanks for changing this.

    I guess this policy change should be clearly stated somewhere.

    Done:

    #v+
    2006-11-05 Thomas Schwinge <tschwinge (AT) gnu (DOT) org>

    * linux/dev/README: New file.
    #v-
    #v+
    This hierarchy used to contain modified files, based on files from the
    Linux kernel, as opposed to `/src/' containing only files that have not
    been modified (or have only been modified marginally). This policy is
    NT adhered to any further, so please don't change (or even add) files
    below here, but instead merge the files in here back into `/src/'
    (which should really be called `/linux-2.0' or similar) or even better
    when adding large chunks create a more suitable hierarchy like
    we've done with `/pcmcia-cs/'.
    #v-

    Regards,
    Thomas

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.2.5 (GNU/Linux)

    ZUizTbHyqJ3UX0pY0KvdwbM=
    =JI8
    PGP SIGNATURE
  • No.7 | | 1376 bytes | |

    Hello!

    Sun, Nov 05, 2006 at 10:58:12PM +0100, Samuel Thibault wrote:
    Samuel Thibault, le Sun 05 Nov 2006 22:49:59 +0100, a ?crit :
    Roland McGrath, le Sun 05 Nov 2006 13:41:43 -0800, a ?crit :
    - else if (thread == current_thread()) {
    - struct x86_desc template = {0, 0, 0, ACC_P, 0, 0 ,0};
    + else {
    + struct real_descriptor template = {0, 0, 0, ACC_P, 0, 0 ,0};

    This can't be right (changing the if).

    Uh, didn't notice that. Barry, do you remember why you dropped the if?

    That's actually not from Barry's patch (the code above deals with LDT,
    not GDT), but from Jeroen's.

    Ah, right.

    #v+
    2006-01-26 Jeroen Dekkers <jeroen (AT) dekkers (DOT) cx>

    * i386/i386/locore.S (trap_push_segs): Switch fs and gs to kernel
    data segment too.
    (syscall_entry_2): Likewise.
    * i386/i386/user_ldt.c (i386_set_ldt): Always copy the master LDT
    when there is no old user LDT.
    #v-
    So, I guess we want to keep this installed? We installed it that that
    time, because it prevented GNU Mach from crashing when using the `ld.so'
    of a tls enabled glibc.

    Regards,
    Thomas

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.2.5 (GNU/Linux)

    D2+Te2gJykiSEF54xAIYU=
    =MsVM
    PGP SIGNATURE
  • No.8 | | 1185 bytes | |

    Message
    From: "Samuel Thibault" <samuel.thibault (AT) ens-lyon (DOT) org>
    To: "Roland McGrath" <roland (AT) frob (DOT) com>
    Cc: "Thomas Schwinge" <tschwinge (AT) gnu (DOT) org>; <bug-hurd (AT) gnu (DOT) org>; "Barry
    deFreese" <bddebian (AT) comcast (DOT) net>; <commit-hurd (AT) gnu (DOT) org>
    Sent: Sunday, November 05, 2006 4:49 PM
    Subject: Re: gnumach ChangeLog i386/i386/gdt.h i386/i386/pcb
    [gnumach-1-branch]

    Roland McGrath, le Sun 05 Nov 2006 13:41:43 -0800, a :
    >- else if (thread == current_thread()) {
    >- struct x86_desc template = {0, 0, 0, ACC_P, 0, 0 ,0};
    >+ else {
    >+ struct real_descriptor template = {0, 0, 0, ACC_P, 0, 0
    >,0};
    >>

    >This can't be right (changing the if).
    >

    Uh, didn't notice that. Barry, do you remember why you dropped the if?

    Samuel

    The only thing I intended to change there was x_86_desc -real_descriptor
    so I don't know what happened to the if. Very strange.

    Barry

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

Re: gnumach ChangeLog i386/i386/gdt.h i386/i386/pcb...


max 4000 letters.
Your nickname that display:
In order to stop the spam: 5 + 5 =
QUESTION ON "Unix"

EMSDN.COM