Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4939256ybv; Tue, 11 Feb 2020 06:15:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxTFFYCNMzL6yUYM9Y4JUkf5nwISugLgQtPvpn/KLSCXAhL8VwaTtYDtgVfochK1Z8jYd9v X-Received: by 2002:a9d:12cf:: with SMTP id g73mr5073578otg.329.1581430510489; Tue, 11 Feb 2020 06:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581430510; cv=none; d=google.com; s=arc-20160816; b=pRPRgBCZlCJ+5cTSVRj69a5NWWweZ0015L2iKbXlVviSfyNrtP72EYFQQZPGMBPCFf M+OAcLMp142udqseFP8pOgOGiWGxtak4AUW9tpJOxaX3j8vGbekrtRcfVcCYQvplNXho 3H2rnhFzjhFo0P/q2SfaHdQYKG1fgSpN27ZmC9RAHocVFjsMuHtp4sXDYlQZhmOj/KGn GtVd6sFHrAWi0U4VDwA7+yNHiNTeDhBVEibXXffitBAicIqdN1Dd2v5HknfRhcLay8In L0BKbTLyunIAkNq1Nrq2E0ddRDvoeyJyVLg7JjvMWFzQQVY7Wm3GVfiBXZUokSNLb5O9 Nksw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=0DQxzn93jBB9SAPSsA8lVTa+UieSqWuMPqoDNDyvYuo=; b=TT4uATqUo23mAjuxK/Y6WS+CBvHe/MmR/FSbO2H0Jk63UhK4sLQnM2qXGRkvVft/UQ UWzMkTIrDlGucI8n71ZRnnRKq4zvUM91k6p8TSiPBPCWslZ4IonBKqzGfiG3cF0GQAQe DLYJnx72o76tuQ/kd6Z7xZNNiBAC6U7efLAhwTQmgzsoSS99Wexsn6vZ/xOgUDYZl8Go nMtEQ9efs7zVTkjU8VASh8UBzUmcSKvIXAZkYMxP8OVZVyJNoUnkNcDCTewbCskQvyGZ WB4XewHHs0li33bDn63aMUYi3MFZBtRAcoVsB3zhNSjjndu7xXn54Sk9ZWFDpA1K6Uw5 xcGw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si2001510otq.238.2020.02.11.06.14.50; Tue, 11 Feb 2020 06:15:10 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730048AbgBKN57 (ORCPT + 99 others); Tue, 11 Feb 2020 08:57:59 -0500 Received: from 8bytes.org ([81.169.241.247]:52240 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729511AbgBKNxW (ORCPT ); Tue, 11 Feb 2020 08:53:22 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 5B8FCE1A; Tue, 11 Feb 2020 14:53:11 +0100 (CET) From: Joerg Roedel To: x86@kernel.org Cc: hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Joerg Roedel , Joerg Roedel Subject: [PATCH 23/62] x86/idt: Move IDT to data segment Date: Tue, 11 Feb 2020 14:52:17 +0100 Message-Id: <20200211135256.24617-24-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200211135256.24617-1-joro@8bytes.org> References: <20200211135256.24617-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel With SEV-ES, exception handling is needed very early, even before the kernel has cleared the bss segment. In order to prevent clearing the currently used IDT, move the IDT to the data segment. Signed-off-by: Joerg Roedel --- arch/x86/kernel/idt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c index 87ef69a72c52..7f81c1294847 100644 --- a/arch/x86/kernel/idt.c +++ b/arch/x86/kernel/idt.c @@ -166,7 +166,7 @@ static const __initconst struct idt_data dbg_idts[] = { #endif /* Must be page-aligned because the real IDT is used in a fixmap. */ -gate_desc idt_table[IDT_ENTRIES] __page_aligned_bss; +gate_desc idt_table[IDT_ENTRIES] __page_aligned_data; struct desc_ptr idt_descr __ro_after_init = { .size = (IDT_ENTRIES * 2 * sizeof(unsigned long)) - 1, -- 2.17.1