Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5380835ybv; Tue, 11 Feb 2020 14:43:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwiM2Y1EJxM+EwhiZlGfWDsaSrcbqZtELysQsNr0lXEqQkxgegX+lX+phFFfiJZ9Dju+jI7 X-Received: by 2002:a9d:4d17:: with SMTP id n23mr7077366otf.85.1581461008753; Tue, 11 Feb 2020 14:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581461008; cv=none; d=google.com; s=arc-20160816; b=EIhsL0Xv93H15YSzymz1SnrDADuCIa2wRt4TW2lG/J3oFgrT3XshnkWWHEFJ4ZuARF ugGI8OtoT/ZVVriEhzn+xoi0eo7XomEVA/4RNR9H2etE7ubDx/mk+y3Mz9Os6ZPWZMkZ 2iULosaDDoIQ3HgvnULuyTj7APjlwyNE+AGpjh/dQG7pbUW0L75jQYEn8UjH61hxXQLb 9F3JOUUhQRY/7GmzpLUJLQux1esY6DNlQjWjLVv0ZtnLU7hxT/O8sgtbCveKB4h9oo6l pLzuX2xuHVg8UrwC8F5Dt5N8xtopXpq+CYrIsGRBONeuGpi7RbNgBDXJZbkCHcLZw0wc WXCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hTz4tw1t227/f1mna2RiFG90aC2alxM2LDhNYwfsDVs=; b=zJ91Z3beuPLwf/g8fSCxMoOiH+A96uBSlRXSC6n8BVeOMkmYd80Gd+NNwU8n4DiY14 EymTQ4FM8y9la3ki4dfNMPPOBOufPLq1KhV7VT0tpzdJkHtbgvAKAoIOU9awu+dnSKXi HIHFcoQJ+c3k3x7TIiSLygh74EzZnDj2AaQK7TyT8gdvtmiYBBIf1Us9fiBVJsVhvtew FbV0E9PrsWEhXrsIja33BHHDrpJPQQ2JwoebR6DxnLZljoOe9UILBagAbYqsZ0iIU37r jVo9jPo8pv2iscx27wgECTseZeVh5L7YmdVuM6i363tGgT1f3aOHfCHbatapYH4GmoKn xAgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A9SjsBEn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si2287759oie.56.2020.02.11.14.43.15; Tue, 11 Feb 2020 14:43:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b=A9SjsBEn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727581AbgBKWlk (ORCPT + 99 others); Tue, 11 Feb 2020 17:41:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:59160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727330AbgBKWlj (ORCPT ); Tue, 11 Feb 2020 17:41:39 -0500 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CF53C215A4 for ; Tue, 11 Feb 2020 22:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581460899; bh=po7kqC7Pvn8ouUFSjitvJdsV90ZhZQbIOK4MtOWD+4c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=A9SjsBEnM3jsARVQH6Vr8mTRFYVGhigujF6r85gkGJDQV5NSgyXGAldP+bLnXh/9J 3m3NtP+kcfOzMI6mAYyqirz9/jX0YVwfQ8kfmP5qG/FH5JKPQCzOSv87B8D9c6/iCa ssCsOD+3rbZeEUyj8gwWEpLOQGnncSrhXwJy9lZ0= Received: by mail-wr1-f47.google.com with SMTP id z3so14608478wru.3 for ; Tue, 11 Feb 2020 14:41:38 -0800 (PST) X-Gm-Message-State: APjAAAX8x7oWabU+hM97mFj015xh8NrMtWgAyllnH3lxqTvOKGxzzDqE Pm7sLLM0/UfPOMXN6MoNzsG6hLKt85vA9I2xlB8kvQ== X-Received: by 2002:a5d:5305:: with SMTP id e5mr11103645wrv.18.1581460897210; Tue, 11 Feb 2020 14:41:37 -0800 (PST) MIME-Version: 1.0 References: <20200211135256.24617-1-joro@8bytes.org> <20200211135256.24617-24-joro@8bytes.org> In-Reply-To: <20200211135256.24617-24-joro@8bytes.org> From: Andy Lutomirski Date: Tue, 11 Feb 2020 14:41:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 23/62] x86/idt: Move IDT to data segment To: Joerg Roedel Cc: X86 ML , "H. Peter Anvin" , Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , LKML , kvm list , Linux Virtualization , Joerg Roedel Content-Type: text/plain; charset="UTF-8" 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 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. 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.