Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5980127ybv; Wed, 12 Feb 2020 03:55:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxZG+xtRz2gNUGBUbOAhAzsdnMMMlR745FHhJ3kao+dg0oVi9AexR6+gK54HuEMSkR6Qio1 X-Received: by 2002:a9d:7a56:: with SMTP id z22mr8502564otm.201.1581508553644; Wed, 12 Feb 2020 03:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581508553; cv=none; d=google.com; s=arc-20160816; b=cG9v2Ko17a2veTgOVWw85c/05NET4FEauNGymnY9vao/p3grClWnB3gyIQ6K9JOokm 0KTcxOWRK5VlJo6Q/5aunR0nmU5T+LeMqFTPzKxgkVHzJTPA5LhcrBIY17HGMYAZfu2N T/CVOBvmfUdpaVfF0kdVgKyrw8EeAuz4DKozcnnQtGEMtf7o21QArKdPXMxtm+s+ykbl IZTLxw/uPBoCGpHyOeuIvQMGIKa4iwyHlHiWoTaqmybn/WuGJnxF/2QXdHE7FN1L7XSe nPVUxg9io9QiNrhsebGFancgHc7Orc9W2c3+HgwmiU25wt0+AShxUtMcg/p2TdyY8g8X j1Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZnINmOIPzdpP3ZnIALrOBbWfxN1WxRz50zJi1GZaqMI=; b=d73fVnV7dMFeVzW5M5gakUJO2ibLmJrYpxubRjZAosml/W7QEvgFywgGteb+FT/ewv nqWRP/pKrvitbV7n+4M8Fyoud4/waiEI/TShUGG8S1Bu2IS8CSrw9D4ISHApSWFs2alZ 07+qAmQYR6gkCN1JCWfIxLZS6a2p4YT22KClAeNQGUISUHKO8M7tlPzjysFpb6xsqFel 9qi8U5zSoAX4Yhj+ZX15QIUImiYSkBoYPBbHBBYXslrRgSxS/5mKYIW/6Z+Xkvq7qPd1 IVwAPL0fF8JtAeE9Up+McQbjQNge/QEhMoh2Gf46ndYGIvG9ilmNBGXMoho+uRonHraN thSA== 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 l17si103157otk.218.2020.02.12.03.55.41; Wed, 12 Feb 2020 03:55:53 -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 S1728323AbgBLLz1 (ORCPT + 99 others); Wed, 12 Feb 2020 06:55:27 -0500 Received: from 8bytes.org ([81.169.241.247]:53756 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbgBLLz1 (ORCPT ); Wed, 12 Feb 2020 06:55:27 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id AF9E120E; Wed, 12 Feb 2020 12:55:25 +0100 (CET) Date: Wed, 12 Feb 2020 12:55:16 +0100 From: Joerg Roedel To: Andy Lutomirski Cc: X86 ML , "H. Peter Anvin" , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , LKML , kvm list , Linux Virtualization , Joerg Roedel Subject: Re: [PATCH 23/62] x86/idt: Move IDT to data segment Message-ID: <20200212115516.GE20066@8bytes.org> References: <20200211135256.24617-1-joro@8bytes.org> <20200211135256.24617-24-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 02:41:25PM -0800, Andy Lutomirski wrote: > On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel wrote: > > > > 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. > > Ugh. At the very least this needs a comment in the code. Yes, right, added a comment for that. > I had a patch to fix the kernel ELF loader to clear BSS, which would > fix this problem once and for all, but it didn't work due to the messy > way that the decompressor handles memory. I never got around to > fixing this, sadly. Aren't there other ways of booting (Xen-PV?) which don't use the kernel ELF loader? Regards, Joerg