From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753927AbdKMRBa (ORCPT ); Mon, 13 Nov 2017 12:01:30 -0500 Received: from mga07.intel.com ([134.134.136.100]:3584 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753664AbdKMRB3 (ORCPT ); Mon, 13 Nov 2017 12:01:29 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,389,1505804400"; d="scan'208";a="173018313" Subject: Re: [RFC 4/7] x86/asm: Fix assumptions that the HW TSS is at the beginning of cpu_tss To: Andy Lutomirski , X86 ML References: <03fb20a8639aeecfeda3ba18a520ce646267eb9a.1510371795.git.luto@kernel.org> Cc: Borislav Petkov , "linux-kernel@vger.kernel.org" , Brian Gerst , Linus Torvalds From: Dave Hansen Message-ID: <2fdf9cf9-ec48-e63f-2ec8-44160c206c9a@intel.com> Date: Mon, 13 Nov 2017 09:01:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <03fb20a8639aeecfeda3ba18a520ce646267eb9a.1510371795.git.luto@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/2017 08:05 PM, Andy Lutomirski wrote: > -struct tss_struct doublefault_tss __cacheline_aligned = { > - .x86_tss = { > - .sp0 = STACK_START, > - .ss0 = __KERNEL_DS, > - .ldt = 0, ... > +struct x86_hw_tss doublefault_tss __cacheline_aligned = { > + .sp0 = STACK_START, > + .ss0 = __KERNEL_DS, > + .ldt = 0, > + .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, FWIW, I really like the trend of renaming the hardware structures in such a way that it's clear that they *are* hardware structures. It might also be nice to reference the relevant SDM sections on the topic, or even to include a comment along the lines of how it get used. This chunk from the SDM is particularly relevant: "The TSS holds information important to 64-bit mode and that is not directly related to the task-switch mechanism."