From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E56F1C2BA83 for ; Wed, 12 Feb 2020 16:28:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5B9620724 for ; Wed, 12 Feb 2020 16:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728544AbgBLQ2Z (ORCPT ); Wed, 12 Feb 2020 11:28:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:42408 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728226AbgBLQ2Z (ORCPT ); Wed, 12 Feb 2020 11:28:25 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A042FB071; Wed, 12 Feb 2020 16:28:23 +0000 (UTC) Subject: Re: [PATCH 23/62] x86/idt: Move IDT to data segment To: Andy Lutomirski , Joerg Roedel Cc: Andy Lutomirski , X86 ML , "H. Peter Anvin" , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Kees Cook , LKML , kvm list , Linux Virtualization , Joerg Roedel References: <20200212115516.GE20066@8bytes.org> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <879ace44-cee3-98aa-0dff-549b69355096@suse.com> Date: Wed, 12 Feb 2020 17:28:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 12.02.20 17:23, Andy Lutomirski wrote: > > >> On Feb 12, 2020, at 3:55 AM, Joerg Roedel wrote: >> >> 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? > > Dunno. I would hope the any sane loader would clear BSS before executing anything. This isn’t currently the case, though. Oh well. Xen-PV is clearing BSS as the very first action. Juergen