Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1704564ybh; Tue, 14 Jul 2020 05:17:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2xm2XIDwZ4ztBaCVLlysLOmpa6k4onXd2/DG91hJk65HlbG+aSiRkr2LE+03BUnneQ66N X-Received: by 2002:a17:906:5595:: with SMTP id y21mr4299743ejp.61.1594729073109; Tue, 14 Jul 2020 05:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594729073; cv=none; d=google.com; s=arc-20160816; b=gsXVG4mw1wgEBvW7DJ/6NK7OvLjKt1FUspyvUbT75XquS1MZEy8Z5w2bwa8tkYqQxW dC//J7k690CRnp17oGBsIVknwXUNABdQgQ/H7KMq7Xnu++TS/+UJ5r6DYH2Ss5lrnZly YKzBPZIOFNzWVhMPGgHyurF3GMCg7w+O+ilCLM/PDCFRtpye0Xox8bhZeMnUF1uzndau HzRGtG7C206jOMGNGwB/nAP8Pb9C0i4I8ic48sP36FCL1owuXSkQTBedA8Q9ZUUKxXkr Vwug8yXZIdW0KujFCmqEBIhWzJPW6B2v9IAu3YoKEYFuX/d3mRlcnNVSco4RMGTZ+UWB MyAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pFRhz1or39M3at/pc9QfjnxK/j3QNZq0YUmzU3TMx4Q=; b=hxFWqi7+wZ/ocKgHOMCiuvG2pcb9qexUex87aaRnMkMcGgSdBZiVR+IiOZWNK1/zeN AO/WC1XfavfFIjngwyKc/XU90GDX4zjS1ZnGM+hX1lrWDoz8NV9B7+8rIFbdIQyKxCcL vvnE8Ttgm2y7H2duuoJuS402Da3qtlxSPI5NMOc8BSQmY8uwTJWi64qPDM6brmL1WoYb KTnoR3WASAMapaG/67a0sLJvMUAuB3noXZ75D7dsYMMq3Cb3sQGHve95vmphTdwfVnpF Rjoh8+DLzzX5MILQuH+pzdfx3M1vVtJIUe1daZXx4zKgwE4rPQBvvL+3+0Co2hYxGnBk 4lKA== 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=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si10935048edy.584.2020.07.14.05.17.29; Tue, 14 Jul 2020 05:17:53 -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=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728825AbgGNMQE (ORCPT + 99 others); Tue, 14 Jul 2020 08:16:04 -0400 Received: from 8bytes.org ([81.169.241.247]:53184 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbgGNMKu (ORCPT ); Tue, 14 Jul 2020 08:10:50 -0400 Received: from cap.home.8bytes.org (p5b006776.dip0.t-ipconnect.de [91.0.103.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by theia.8bytes.org (Postfix) with ESMTPSA id 9CA87B2D; Tue, 14 Jul 2020 14:10:47 +0200 (CEST) From: Joerg Roedel To: x86@kernel.org Cc: Joerg Roedel , Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH v4 27/75] x86/idt: Move IDT to data segment Date: Tue, 14 Jul 2020 14:08:29 +0200 Message-Id: <20200714120917.11253-28-joro@8bytes.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714120917.11253-1-joro@8bytes.org> References: <20200714120917.11253-1-joro@8bytes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 0db21206f2f3..b920f2352df5 100644 --- a/arch/x86/kernel/idt.c +++ b/arch/x86/kernel/idt.c @@ -158,7 +158,7 @@ static const __initconst struct idt_data apic_idts[] = { }; /* Must be page-aligned because the real IDT is used in the cpu entry area */ -static gate_desc idt_table[IDT_ENTRIES] __page_aligned_bss; +static gate_desc idt_table[IDT_ENTRIES] __page_aligned_data; struct desc_ptr idt_descr __ro_after_init = { .size = IDT_TABLE_SIZE - 1, -- 2.27.0