Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030261AbVKHE3Y (ORCPT ); Mon, 7 Nov 2005 23:29:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030276AbVKHE3Y (ORCPT ); Mon, 7 Nov 2005 23:29:24 -0500 Received: from mailout1.vmware.com ([65.113.40.130]:64530 "EHLO mailout1.vmware.com") by vger.kernel.org with ESMTP id S1030261AbVKHE3X (ORCPT ); Mon, 7 Nov 2005 23:29:23 -0500 Date: Mon, 7 Nov 2005 20:29:21 -0800 Message-Id: <200511080429.jA84TLhD009896@zach-dev.vmware.com> Subject: [PATCH 10/21] i386 Use protected segment for 16bit stack From: Zachary Amsden To: Andrew Morton , Chris Wright , Linus Torvalds , Linux Kernel Mailing List , Virtualization Mailing List , "H. Peter Anvin" , Zwane Mwaikambo , Martin Bligh , Pratap Subrahmanyam , Christopher Li , "Eric W. Biederman" , Ingo Molnar , Zachary Amsden , Zachary Amsden X-OriginalArrivalTime: 08 Nov 2005 04:29:21.0790 (UTC) FILETIME=[FDC831E0:01C5E41C] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 27 Use prepare_protected_segment macro to set up the 16-bit stack. Whee!! This code is almost readable now. Signed-off-by: Zachary Amsden Index: linux-2.6.14-zach-work/arch/i386/kernel/cpu/common.c =================================================================== --- linux-2.6.14-zach-work.orig/arch/i386/kernel/cpu/common.c 2005-11-04 16:54:45.000000000 -0800 +++ linux-2.6.14-zach-work/arch/i386/kernel/cpu/common.c 2005-11-05 00:28:08.000000000 -0800 @@ -607,10 +607,8 @@ void __devinit cpu_init(void) set_base(gdt[GDT_ENTRY_BAD_BIOS_CACHE], __va(BAD_BIOS_AREA)); /* Set up GDT entry for 16bit stack */ - *(__u64 *)(&gdt[GDT_ENTRY_ESPFIX_SS]) |= - ((((__u64)stk16_off) << 16) & 0x000000ffffff0000ULL) | - ((((__u64)stk16_off) << 32) & 0xff00000000000000ULL) | - (CPU_16BIT_STACK_SIZE - 1); + prepare_protected_segment(cpu, GDT_ENTRY_ESPFIX_SS, (void *) stk16_off, + CPU_16BIT_STACK_SIZE); cpu_gdt_descr[cpu].size = GDT_SIZE - 1; cpu_gdt_descr[cpu].address = (unsigned long)gdt; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/