Message ID | 20230404102716.1795-16-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2955123vqo; Tue, 4 Apr 2023 04:37:28 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDKGHYdI5L1If3qbBeXkLP0OlHuwnV+9Xzlro2swAp/LsWCNhjwTg6K8cfcd+gJ8vc1eCQ X-Received: by 2002:a17:906:b0da:b0:92e:efa:b9b4 with SMTP id bk26-20020a170906b0da00b0092e0efab9b4mr1888567ejb.22.1680608248429; Tue, 04 Apr 2023 04:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680608248; cv=none; d=google.com; s=arc-20160816; b=y9+PRJlojUWmtAFJYG19MPnSUHHspCcyZzTcDq2tm2XdGx8UPIGtB4wRFW9OIhuTM5 O1a9YyuFC2RevvJLveFgLbejBJ05HBtgkmULLD5IaJ4ohuAQDExUfYyTLUB5uoLpL1bF +qznWyt6G6i77q1B8pYbO6XTgqCdtZhCO/Ga46TutImMvJZXL7ksv3l5CrGy6khHZGnF NmJwbypL4HABZ1CRiZhZoiR0u8g1ij4J1z1558ARU9jH5IyFYZM49QOWiY1+nh8cZSez IJ2X/NP97otQQeEdTmJUaK5Kge52pRRPYNyM5z/aM0xx1koH6Op48jMwg0Kkxq5QgBC9 rKdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N4FXxoAND7jQBjEqpShHPjc4hHLflyZ6xveUxpk88v4=; b=G5KvLzTSdl0vAXrTZ4k/CkP7mGsy+NcPctVPh4AIjyOfE4O2hAFWNRj3zKOdnja1tl h8OCgJeTDGo8Ta9IwN9pdpG/dxI97aTKz9k2MwCcizhqReUyYe83aRIsBgM4N4EXXKbE 8Uw5+cSpbbx0cES0XjLmSO9HU9NGgbLeJIpemfz0/9JaXQstXF9R7bOmz4IUoQWGWZMz ftWPQUdVDUT2bjrvB0QLf2zXAhm3v+nRA+2Pb5HwL2J23vELH3rZeiuEXCc+Bu1MVwA6 JHLRHUt89pXgTCs87c4Hq/qwERTqOcaV4prfw404Sne2SL6efEmSOOjiEMUrfbWv8uDP E18g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l8AHjYMO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cd18-20020a170906b35200b00939ad825dd8si9638122ejb.837.2023.04.04.04.37.03; Tue, 04 Apr 2023 04:37:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l8AHjYMO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234793AbjDDKzM (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Tue, 4 Apr 2023 06:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234622AbjDDKyL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Apr 2023 06:54:11 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB27F1737; Tue, 4 Apr 2023 03:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680605607; x=1712141607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=voFQVjFSRNzDP3of726cqSfwzN6e3VmowuyZWcsyuKM=; b=l8AHjYMO0iAGTYDkqN2IJc4ddHIP1EKjU30cdLHXSx12cfANBJU1ZyS7 6YE6Z6qZ5aA4IKTzkgxoudhiratEZTipWdPLKlF22itKp8XNw/lhPHWOA AV/mCZx3C6YMIdsdGKSdzzhAWNFahFvAR7zAleyT2KI6D1EnpAnKveU/1 0cjelyjp0jAT1UkKl1PhGkKf8pPm5mIapzdcEuCYkEvpMgszAZIOLijFQ UfJupVfjyeCTIcE8A6RAPxLMFDfGmV6fZBic5KcnBbtJW73vCq/s+gU/f d9x6fExxnYoVzIuW9RkWj2zsJr/DBLAs5b7dlpXnhzGomKD9F5Xp7GlJw g==; X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="330734073" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="330734073" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 03:53:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="775597823" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="775597823" Received: from unknown (HELO fred..) ([172.25.112.68]) by FMSMGA003.fm.intel.com with ESMTP; 04 Apr 2023 03:53:03 -0700 From: Xin Li <xin3.li@intel.com> To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, andrew.cooper3@citrix.com, seanjc@google.com, pbonzini@redhat.com, ravi.v.shankar@intel.com, jiangshanlai@gmail.com, shan.kang@intel.com Subject: [PATCH v7 15/33] x86/fred: reserve space for the FRED stack frame Date: Tue, 4 Apr 2023 03:26:58 -0700 Message-Id: <20230404102716.1795-16-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230404102716.1795-1-xin3.li@intel.com> References: <20230404102716.1795-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762245474890118078?= X-GMAIL-MSGID: =?utf-8?q?1762245474890118078?= |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
April 4, 2023, 10:26 a.m. UTC
From: "H. Peter Anvin (Intel)" <hpa@zytor.com> When using FRED, reserve space at the top of the stack frame, just like i386 does. A future version of FRED might have dynamic frame sizes, though, in which case it might be necessary to make TOP_OF_KERNEL_STACK_PADDING a variable instead of a constant. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Tested-by: Shan Kang <shan.kang@intel.com> Signed-off-by: Xin Li <xin3.li@intel.com> --- arch/x86/include/asm/thread_info.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index f1cccba52eb9..998483078d5f 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -31,7 +31,9 @@ * In vm86 mode, the hardware frame is much longer still, so add 16 * bytes to make room for the real-mode segments. * - * x86_64 has a fixed-length stack frame. + * x86-64 has a fixed-length stack frame, but it depends on whether + * or not FRED is enabled. Future versions of FRED might make this + * dynamic, but for now it is always 2 words longer. */ #ifdef CONFIG_X86_32 # ifdef CONFIG_VM86 @@ -39,8 +41,12 @@ # else # define TOP_OF_KERNEL_STACK_PADDING 8 # endif -#else -# define TOP_OF_KERNEL_STACK_PADDING 0 +#else /* x86-64 */ +# ifdef CONFIG_X86_FRED +# define TOP_OF_KERNEL_STACK_PADDING (2*8) +# else +# define TOP_OF_KERNEL_STACK_PADDING 0 +# endif #endif /*