Received: by 10.223.164.202 with SMTP id h10csp3450879wrb; Sat, 25 Nov 2017 08:56:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMbP/scyzKQimO3ntx7bcEzGoZjvZTND/PAKgFXC8XXgJB3vX30z6Oyh4hW1IA+yvac/vcIm X-Received: by 10.98.34.199 with SMTP id p68mr30651503pfj.241.1511628966980; Sat, 25 Nov 2017 08:56:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511628966; cv=none; d=google.com; s=arc-20160816; b=IiD6NtWcmjG8XfUZsa2E5bObrKhRwlKfqxOUPwGbrkIzpgUwqlwRK1KJn1IEk4jPwX qMZ/0sLhUQ+K2UKH9bs2cFjua5piTeZ/ssC06Dmsrr3FVJBqoBV2x9FuvIGhgRcgJ2vN 618NGrTal/CgZSNP4Cw131c0UXaqcIJ6G3mTP8KZwon9khJEkjYPmUVrcSrOrviUd0ZB f2Deu8DKDei/LKvv6kFft4Caplc80MF/LEmuXQkvEENXRVo72cyuQdPpHWEURRG/WvLZ yDC+VO4rStoGjwGFxomzNrTV4O/mzYwsqTB0ao9wDlEYQZajXBfY5NTfeeem8oLiAOD5 EOZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=dCdx1HAhArBdfx5pSyYEWWYcbszce/DJBBs0fW9k0Pc=; b=YygPcppRH1cSLz7RExVHDR+YOQ0LtH8TIj2X92uf78dXhx6PGSdapMNugQwNYFZloP g0Al9CFLEgyqMntWwR5DqNJXtoAk+eug0Gmn1bHNXleeJpsldz0XxsfCR+e66RoA/WXA j2+Ee/J4EHMh+TVEm8axRPvCQVaOLd8OUytcC3kwNgk8swcvl8abmwOxYqdF6z/24r40 cxjzRT9ZDqjKOew/YT/NbmbDW3Mi+55/kKOFn3BBvTY04fXfzGrolvMjFFe5XwUhJJQc 33XaG5dojKMFbNihfB7TiLo2caCPMnHaiV5ieaOJ0JjNMfjHpRxFyCy5z3PNempXnOpm xpBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=k9Dn/6f9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si16873888pgo.89.2017.11.25.08.55.54; Sat, 25 Nov 2017 08:56:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=k9Dn/6f9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbdKYQzS (ORCPT + 81 others); Sat, 25 Nov 2017 11:55:18 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:39933 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbdKYQzR (ORCPT ); Sat, 25 Nov 2017 11:55:17 -0500 Received: by mail-io0-f194.google.com with SMTP id x63so32193941ioe.6 for ; Sat, 25 Nov 2017 08:55:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dCdx1HAhArBdfx5pSyYEWWYcbszce/DJBBs0fW9k0Pc=; b=k9Dn/6f9vOtlSuOXZDMSzh7rliPyWHUicxrihMM4lR1TqeiIA6201NXWBMqFEdJGkL Lz5GnufcC+bv2Bb3dllS6z+QqGBOfIUzZJvGQ4UwEWj5ece2uRHLqgVpput0n7T4M3We 4VYT7fdb2R1vBgO6JmtRxKrzJwsfP1gz4PqQgeVfOM55U7wD11ug0eps06Zya54mO+vg 77MmR2zvf17fh8Riht96z5ZE2GfYLMDzvcnUUB/b3JjZ351S0BvbmFtsJhb0Dsob1DJ0 nOZJj2Sd4VBYA7I8pGLI41OIo68wEfe7aQTjm2QSsOP8AAppl2hml1mpiHFQUwjIHdeD G2XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dCdx1HAhArBdfx5pSyYEWWYcbszce/DJBBs0fW9k0Pc=; b=bm9KAjmcffrLVIDXUxonWGGEEd6Qt0Ec9YGBDX6fQ+tJMXroCcpInQ0X3fGpj+zLcT o/iwShmoR6/GOlnyv4LKxFO1d/7K0n2pAnagnRAL6/FTdz9/is6yh8hsZy4To9UHLPPG EksEwdSjWc5IqtlEicgeAWHNwOrTgtlPPdZaJF71Uc053adIkFqZlpshG/Ma4EjTs156 E6QQ2Q/RJPhWqU1Z2i2zFVgjCXhefK/Z+0liMJT2CJhQXdG4icmZH5XAuzlJhj2/v613 xFzlnBL0S0eqd1PczMNj5H/y3KIwktAf2e+QkPW4ny1EA2mS9L8igaivzpenngSXcrfi yhFg== X-Gm-Message-State: AJaThX5da+HLzbEpD17mPA6xOkzFCsFBSZC/SJOeLZJk5wef8+bfxdTp Isl12OoloaZIVXCtDtbyzt01Kzy3R8U= X-Received: by 10.107.202.130 with SMTP id a124mr6891275iog.293.1511628916723; Sat, 25 Nov 2017 08:55:16 -0800 (PST) Received: from [192.168.1.143] (c-67-166-60-92.hsd1.co.comcast.net. [67.166.60.92]) by smtp.gmail.com with ESMTPSA id p134sm7931020iop.75.2017.11.25.08.55.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Nov 2017 08:55:16 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 20/43] x86/entry: Clean up SYSENTER_stack code From: Andy Lutomirski X-Mailer: iPhone Mail (15B150) In-Reply-To: Date: Sat, 25 Nov 2017 09:55:15 -0700 Cc: Borislav Petkov , Ingo Molnar , linux-kernel@vger.kernel.org, Dave Hansen , "H . Peter Anvin" , Peter Zijlstra , Linus Torvalds Content-Transfer-Encoding: quoted-printable Message-Id: References: <20171124172411.19476-1-mingo@kernel.org> <20171124172411.19476-21-mingo@kernel.org> <20171125163956.nrxpobf5xetnavo6@pd.tnic> To: Thomas Gleixner Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 25, 2017, at 9:50 AM, Thomas Gleixner wrote: >=20 > On Sat, 25 Nov 2017, Borislav Petkov wrote: >>> - >>> + wrmsr(MSR_IA32_SYSENTER_ESP, (unsigned long)(cpu_SYSENTER_stack(cpu= ) + 1), 0); >>> wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long)entry_SYSENTER_32, 0); >>=20 >> Right, so we have now two TSS thingies, AFAICT: >>=20 >> tss =3D &per_cpu(cpu_tss, cpu); >>=20 >> which is cpu_tss and then indirectly, we have also: >>=20 >> &get_cpu_entry_area((cpu))->tss >>=20 >> And those are two different things in my guest here: >>=20 >> [ 0.044002] tss: 0xf5747000 >> [ 0.044706] entry area tss: 0xffef1000 >>=20 >> What is the logic here? We carry two TSSs per CPU - one which is RO >> for the entry area and the other is the actual cpu_tss thing? Or am I >> misreading it? >=20 > entry area tss is a alias mapping of cpu_tss >=20 > + set_percpu_fixmap_pages(get_cpu_entry_area_index(cpu, tss), > + &per_cpu(cpu_tss, cpu), > + sizeof(struct tss_struct) / PAGE_SIZE, > + PAGE_KERNEL); >=20 Exactly. And, in the patch I haven't emailed, the alias is RO on x86_64. Maybe I should rename cpu_tss to cpu_tss_rw in that patch. > Thanks, >=20 > tglx From 1585057542896844318@xxx Sat Nov 25 16:51:08 +0000 2017 X-GM-THRID: 1584969159232229446 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread