Received: by 2002:a17:90a:3541:0:0:0:0 with SMTP id q59csp66079pjb; Mon, 8 Jun 2020 14:55:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFAjivlytSRhrRa8b0gq9EyEWnL3BazwXVwEu0Anh8X1kK/34f19qhtgqICwwUA26a9/Na X-Received: by 2002:a17:907:10d1:: with SMTP id rv17mr22413693ejb.51.1591653315627; Mon, 08 Jun 2020 14:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591653315; cv=none; d=google.com; s=arc-20160816; b=B+BVJ5jLAnnXKDN8utE/awLwXIJkA2rSSBmrIVLZTEDadG6CVOHZq1sBtz/v0sMWFr QOKtrwZsM1O5sPgXEbi1y2qTFh5Xe2uM3hI6g/LjF75zIsrQiLp85DmQql6PXrYDrDhB 2qC4jil81d0Pl9exd2j0SqIjL6EVls72kjdC3zvo68aa10HhLXuJ9YbIWrgBa4OO3+lf XH5zMl0rPfJgfidszJFl7iUhNhN04+dJD+G5ULMrE0H/gtV2bkQRlPT4VdVgCEMqtRkz EFsE9Cpw5N60VNan+JsGx5xNOLShLVUYTGTpZ3B9tk0FyOWyafm8cZDNY2fLlB5qJfUb J46Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=BUqLFYJOkXfXzoxKMB1GiXKLdS0hpQt+jYa/xF7i+l4=; b=fkDtPkLRTpvI9Y9rfPuDo6In/Kny5MVRToJHIWlp/QOUqm02v5qGrB7DoFNyyft5M8 KlqBuy896ljcN8uPePMb5BRj7Sl8uAdj2PclR4BYGHgoxKcunPJyNamiEUEp37ctot2Z EZlQ2D9SqdXzH6vV3w/WdQscYlse5yUz52fNKmTIR6nVKXnaCHwk1BRzBBvj24o48ogE VxDYAB+NdJz4QfJ+c+THefqUt57KBKNVjSAQvW8GFNtRDiYxuXUS9ffIKMggXZSutWck xek/KV3GMl65srCTAinJ44m5o9yMYg7RMphbH6NMdyamORtUpVP8lZ68YOQ6SzpLfruC vx6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu20si9339274ejb.13.2020.06.08.14.54.51; Mon, 08 Jun 2020 14:55:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbgFHVxB (ORCPT + 99 others); Mon, 8 Jun 2020 17:53:01 -0400 Received: from mga06.intel.com ([134.134.136.31]:47521 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbgFHVxB (ORCPT ); Mon, 8 Jun 2020 17:53:01 -0400 IronPort-SDR: 64ruKFBk/CltDJ3xLHq5R978XiZ3yU0lJ9iBgE1pv1C0KJnMXtNMsCqvCQDNCwl7NysnTnuJza R/YzNN+hfCKg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2020 14:53:00 -0700 IronPort-SDR: INttxgPbkxeUDgWEefG3ii9OGOMcjk3i2XPkXbPEOauIdyqQMO+JUxP+8sWUYPDayfiXeSyGVe PT3NKC5+w9NQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,489,1583222400"; d="scan'208";a="306073139" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga008.jf.intel.com with ESMTP; 08 Jun 2020 14:53:00 -0700 Date: Mon, 8 Jun 2020 14:53:15 -0700 From: Ricardo Neri To: Brendan Shanks Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, ebiederm@xmission.com, andi@notmuch.email, Babu.Moger@amd.com Subject: Re: [PATCH v2] x86/umip: Add emulation/spoofing for SLDT and STR instructions Message-ID: <20200608215315.GB23567@ranerica-svr.sc.intel.com> References: <20200608181454.14210-1-bshanks@codeweavers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200608181454.14210-1-bshanks@codeweavers.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 08, 2020 at 11:14:54AM -0700, Brendan Shanks wrote: > Add emulation/spoofing of SLDT and STR for both 32- and 64-bit > processes. > > Wine users have found a small number of Windows apps using SLDT that > were crashing when run on UMIP-enabled systems. > > Reported-by: Andreas Rammhold > Originally-by: Ricardo Neri > Signed-off-by: Brendan Shanks > --- > > v2: Return (GDT_ENTRY_LDT * 8) for SLDT when an LDT is set. > > arch/x86/kernel/umip.c | 34 +++++++++++++++++++++++++--------- > 1 file changed, 25 insertions(+), 9 deletions(-) > > diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c > index 8d5cbe1bbb3b..a85f0b0ec2b9 100644 > --- a/arch/x86/kernel/umip.c > +++ b/arch/x86/kernel/umip.c > @@ -64,6 +64,8 @@ > #define UMIP_DUMMY_GDT_BASE 0xfffffffffffe0000ULL > #define UMIP_DUMMY_IDT_BASE 0xffffffffffff0000ULL > > +#define UMIP_DUMMY_TASK_REGISTER_SELECTOR 0x40 One more thing. How was this value selected? Would it be possible to use GDT_ENTRY_TSS*8? Linux already uses this value. Thanks and BR, Ricardo