Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758735AbcDHRMk (ORCPT ); Fri, 8 Apr 2016 13:12:40 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33244 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138AbcDHRMi (ORCPT ); Fri, 8 Apr 2016 13:12:38 -0400 Subject: Re: [Xen-devel] Does __KERNEL_DS serve a purpose? To: Andy Lutomirski , Andrew Cooper References: <5707654F.1060407@citrix.com> Cc: Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , kvm list , xen-devel From: Paolo Bonzini Message-ID: <5707E681.7040202@redhat.com> Date: Fri, 8 Apr 2016 19:12:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 517 Lines: 16 On 08/04/2016 18:00, Andy Lutomirski wrote: > But %ss can be loaded with 0 on 64-bit kernels. (I assume that > loading 0 into %ss sets SS.DPL to 0 if done at CPL0, but I'm vague on > this, since it only really matters to hypervisor code AFAIK.) It's even simpler, unless CPL=0 SS cannot be loaded with 0 while in a 64-bit code segment (SS can never be loaded with 0 if you're not in a 64-bit code segment). Thus indeed SS=0 implies SS.DPL=0 on 64-bit kernels. Paolo > 32-bit kernels need __KERNEL_DS, I think.