Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1650307rdb; Thu, 25 Jan 2024 01:57:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJjUjD1yh875MswkM45xLqdkNhVxUT+2kre23z7PwEoikWjSn7pLlZXqEC+SPDDAUKze17 X-Received: by 2002:a0c:b415:0:b0:681:9a39:c572 with SMTP id u21-20020a0cb415000000b006819a39c572mr1582682qve.1.1706176648745; Thu, 25 Jan 2024 01:57:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706176648; cv=pass; d=google.com; s=arc-20160816; b=NvMe5NxQUH9cPx1XsgMYrh+Imxc4q53W98t6Ewc+JGLexXQDMpcIPA78dYqEbhHTgX J7awFkLujOlH1FX/1jSc/yCkHfXFb3vJH2Kxrb2b0c6cdXr6Qvtx3u9eVbGCA47Ox48H 1Pd7W1RTPaupenoybifmgI1PaLZbfNEHVjpteddd7OzRBaxxzoOf6Xlt9/4GYVL77iyn 9Xy67/YJWyhxked8mHCzpdkiayWc/V0UMVEfgYb6r8qRKTm7gGPC2Z12qQvudo6Rv6Yp 73qC+lOSSX59GMdLb2viEyw/0Q7WwOFL11knzks9JWUjSaqRPF8ytEG0N7I7GDA7syks LCcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RlsbOVbIYjCog15Er4r+a4YUIEwoU9F3FBncrxtC2bU=; fh=kxOp6iCI89HA/UGEHZfqa7DCcDpg9X+mQ9laE2YYYR8=; b=X3tAdP5BaJQOQ3mQ/DueGDshu17uFaaDtFzOK1xeuVY1FrXLH2VLVZHkTtWZT7KtMN EEUB2z++53MAE4Cz2f21sQqX7PKhSoSv9BlkaGJxstQF5dUnpQ4YxUwb5XFo2r0frHeq rrVAZ+kLWQb+knI2ZYeGFJTj6GzdYrY4pa/YBIgC4gN68sZIGd52WE1kWsDK8f9Id2PB dK2ZHbKaB1WjqjJv2Me/60ngk5MrG9NZ3hHG9fRJ0JIf3ZdE5hvPFGWpHmJyIi/e8FFD pWoOybIVY82G2D7oZ3US087u3yBSULUOsl0DkfmbQ4IAxnF399HvsyIQ2RfZI7R/1pzx fqRw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OSdk7Bne; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-38346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x11-20020a0ce24b000000b0067a29f9abdasi12380435qvl.438.2024.01.25.01.57.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 01:57:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OSdk7Bne; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-38346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3BCC61C23469 for ; Thu, 25 Jan 2024 09:57:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D25FD1C6AF; Thu, 25 Jan 2024 09:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OSdk7Bne" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3D221C696 for ; Thu, 25 Jan 2024 09:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706176641; cv=none; b=X9vHjZb2edKoWhan72q5Re10SOc9d04ZWeyZSeWfFIVASkzwbrkLWp535x5vz342o0CG99iyl3RF9EIOzafo94/NQk/fQVIpicQxUPH6knhf9HssuAlVHR5qpDMoMHNahg7V0fJCoCBdvTDaHkwi4PDZn7DxF1ZcB8YMQVjM5ms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706176641; c=relaxed/simple; bh=GCTjaxAzQpiJeogtIM7YnckgDznFssj6Z9QaoT8dp7E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ce+C7WMCNXZ+DnYg+DCY62SmL034EqAtOlD6cmNg0u7VJb9xQSrY6HwEQOtPd7+RRwOq+mZR5Vwt8v3Yx+uJjhvzz2bBssiHnfyTUYKYn47HbwqtjT9IeoxPQWtt0QLeYJPB7zAbc0IPP+FYMiEIu/wai1ZLq/1DzdPlXBZUJvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OSdk7Bne; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706176640; x=1737712640; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=GCTjaxAzQpiJeogtIM7YnckgDznFssj6Z9QaoT8dp7E=; b=OSdk7BnecvXacXgED+3Z0PWZ8dipZUgvljSL1NiyIC9TI7jXpJF5zqZ8 +y0OD3gmcFXSbqFci6tlgVQSt7/rWDoDdhPziwK+paeNqz1INQX82ordE 08xHV6RyBMnecOpFlL/EYjQA6HhdPelFt5DYizmlqz0scsw/nlkTOCbuA CKd9Uf1nxWT2e3QmtCuln0TYMJriIHivsk/Ndasz/eRt+SRRakGGndpDx o74iVdj70PfqPBwWjU78z0LoiPIOo1xPDjj5i4wdnmlHI+bgFA1/Iq2mD 52s12wLAJdNYAHc6GgxaoCrAWDY1n0RcKXFzIzROt2SU6BgUDuqmb0U4I g==; X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="8771467" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="8771467" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 01:57:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="28427016" Received: from tassilo.jf.intel.com (HELO tassilo) ([10.54.38.190]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 01:57:19 -0800 Date: Thu, 25 Jan 2024 01:57:18 -0800 From: Andi Kleen To: "Kirill A. Shutemov" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Kai Huang , Sean Christopherson Subject: Re: [PATCHv3, RESEND] x86/trampoline: Bypass compat mode in trampoline_start64() if not needed Message-ID: References: <20240124131510.496803-1-kirill.shutemov@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240124131510.496803-1-kirill.shutemov@linux.intel.com> > + /* Paging mode is correct proceed in 64-bit mode */ > + > + LOCK_AND_LOAD_REALMODE_ESP lock_rip=1 > + > + movw $__KERNEL_DS, %dx > + movl %edx, %ss > + addl $pa_real_mode_base, %esp > + movl %edx, %ds > + movl %edx, %es > + movl %edx, %fs > + movl %edx, %gs > + > + movl $pa_trampoline_pgd, %eax > + movq %rax, %cr3 > + > + jmpq *tr_start(%rip) Still think we should add a far jump here so that we run on a defined code segment. It probably doesn't matter since there are likely no IRETs before reloading anyways, but it seems cleaner. -Andi