Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1282873pxb; Fri, 20 Aug 2021 02:05:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzXBUQ5pRfQ7CJ3W3WojRe+eApS5tiLSsZAmyBj+8bwdV36J06dChBcLPW0+MhKb0FIz1k X-Received: by 2002:a92:190f:: with SMTP id 15mr12510581ilz.45.1629450305615; Fri, 20 Aug 2021 02:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629450305; cv=none; d=google.com; s=arc-20160816; b=Ws/9J9IyCXQnhKixv2oWUdoRQQFdWyONGwJfhVKvpcTG3dt4soNzi9rfm3EMOxRgyP 3FuYcWHxeBFWzIVVe4wbG5wE3MIwvOv5jtMuq1+ZrolzKMrhombmK8UBsJ7nzwA5Dx6l qU+AjsqnfHOBGixFcoUFz4ZWErJqHcjzTCKO83lXsHk8Zlj+MSeIUz4sZHf67YBhp3xi OJS+dQNLvNubMDX2BHLRf0qovCCPTW5DMo8t5WXM+6TmZmyOIHhyL053F+FDoO4oVPH4 etg6RnoxG3HoMAUHsvWUbuGIO7OGC1ZuqD4fLVZ5bO4SmrIi6ZWPL1hk7yGp8MwJFnTB SvNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=fT6zVm/L8VnNLDg+Tjntq7rPsuoZ8WAbpQTcmOdkv78=; b=Z0zxMu5LQ6XuM5JAEDLd+Imz1+nvlAq2SsCP6HJeMInqrr3h2QWbVIKILmUTisufg3 V3t1mgKkfV3PyI7GYSA91JoyvDGnpdv+No1tbqN3j/yktjjqll6amO9Q9lQicMg0F4RK MsEacCvxjFKHgfDYwsQRNwpxcQkZ/hdS6iISXPac14NhQLLDrWtr/MuH2cRVmyrr6wWe Q5EJm6BHFTqRyWesLVw9mhfmfa+PluUSCq+0aV/A+d48QE9ASvzf3UZPQy8IJqNlGvfV le+6GtAIUeEejstCtQt1l2PhoaJEClI10gSSFc/+jxWPOEBLZZy7tjR/gfZdeBA+3Fv2 0Vfg== 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=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si5408240jaq.11.2021.08.20.02.04.54; Fri, 20 Aug 2021 02:05:05 -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=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232380AbhHTJD2 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 20 Aug 2021 05:03:28 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:53534 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233576AbhHTJD1 (ORCPT ); Fri, 20 Aug 2021 05:03:27 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-211-zYbF-yKXOiadlD96bB7S2A-1; Fri, 20 Aug 2021 10:02:47 +0100 X-MC-Unique: zYbF-yKXOiadlD96bB7S2A-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 20 Aug 2021 10:02:46 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.023; Fri, 20 Aug 2021 10:02:46 +0100 From: David Laight To: 'Joerg Roedel' CC: "x86@kernel.org" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "hpa@zytor.com" , Joerg Roedel , Kees Cook , Andy Lutomirski , Uros Bizjak , Arvind Sankar , Ard Biesheuvel , "linux-kernel@vger.kernel.org" , Fabio Aiuto , "stable@vger.kernel.org" Subject: RE: [PATCH] x86/efi: Restore Firmware IDT in before ExitBootServices() Thread-Topic: [PATCH] x86/efi: Restore Firmware IDT in before ExitBootServices() Thread-Index: AQHXlZXa+jtHdymQB0W1fhKjcUB7Wqt8EPPg///0gwCAABNdkA== Date: Fri, 20 Aug 2021 09:02:46 +0000 Message-ID: References: <20210820073429.19457-1-joro@8bytes.org> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: 'Joerg Roedel' > Sent: 20 August 2021 09:52 > > On Fri, Aug 20, 2021 at 08:43:47AM +0000, David Laight wrote: > > Hmmm... > > If Linux needs its own IDT then temporarily substituting the old IDT > > prior to a UEFI call will cause 'grief' if a 'Linux' interrupt > > happens during the UEFI call. > > This is neede only during very early boot before Linux called > ExitBootServices(). Nothing that causes IRQs is set up by Linux yet. Of > course the Firmware could have set something up, but Linux runs with > IRQs disabled when on its own IDT at that stage. So allocate and initialise the Linux IDT - so entries can be added. But don't execute 'lidt' until later on. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)