Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1444997pxj; Sat, 15 May 2021 15:21:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwL7O73q8HmW4dKu1Prv4veapCh1TUz+Id5AzldGt3ks+Nk7jH0ud36lQfHFt/i+v8Pgf5 X-Received: by 2002:a17:907:2136:: with SMTP id qo22mr12364348ejb.246.1621117293014; Sat, 15 May 2021 15:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621117293; cv=none; d=google.com; s=arc-20160816; b=Ev5HZ//7I0mBwbkfpvqHVjqRtuyCVt3MRilYqvrZRH6b7cUi/ngNHlIvKIEHATMyH5 zcAOZIIt8SCB75AUGcGLhlxSdwakrRqaulMd3Y/jx1FITHe6nJiKjl6xwxvWWvCiI4Ty wspcWk3un+QADcv7nnp7UTzZDL5IcebESxc9PiqITVz8oCEHHXX772d4yKzAxr7476UP L6IkgAJjekTnYIfUl8nez67eZ3+fNX6P99K+OIQV+Y64uWgxxtYjGiXc0E4sNAFeDcB3 Y6WExGMuxKQmqsSah2vuBMpLiVCmVq42W7E5Yb/bDvBXQPTWU60FI05nOssWeH3ZKkE+ K8yA== 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 :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=BvJ78nsarkHz7R9emKq+eXCk/Z6regIjZD5eBZDv3CY=; b=rAUhnVXl/uuFa8RsXy/hVmYtfzSOE6//DSEMB9IGsHKH2ibiBzD235WWv7boCuXDSf c7GroUtUmmsLTOAjXfcB2ijMtOKUKtZiiUmrXdR5hTlpWdY7v592/QgdrMAtDFe0jsp2 Yc2lSG1xB+kfeN2YChd91bZA72C4nFxns8UM+8L+7faJfdd6sTCJD8ALHp0I1vyhzrzx hMG0rNgm4sZVIUGCyhzdvBfH+cwZ6y+gPDgMj+KcP0IdvYvciozoOLaTbe3R94LR/hye 517C6AphLYlTt69jBKfE8mtGQjkAQpFb1aMv0TUFigsEkQPONLg4bdrHZy783c9AJrQI LABg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZQxYSeTY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz8si9844822ejc.547.2021.05.15.15.21.10; Sat, 15 May 2021 15:21:33 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZQxYSeTY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232606AbhEOPbn (ORCPT + 99 others); Sat, 15 May 2021 11:31:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:33114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232483AbhEOPbf (ORCPT ); Sat, 15 May 2021 11:31:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 136E1611C9; Sat, 15 May 2021 15:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621092622; bh=GvpOdLUN0BGGVqLx+hc71U4t5c+VkOe8e4mFWqfjXQ8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ZQxYSeTYPcDcDgDbt7aoO9YAZtoRFRxwwL5RnbAwsSYdvG83qx0XtFKiFvsxB9pXi utt2eD4j8xvKeNhtxF6CE17aBwwLrtRaY3KGjOmkJpzcqVlASBSDGfPNjhGwu1lsag yy2EWc3hhODxf797rScxP+9IkifgA+u9LC0VplxgUImQyvKp/KbCfWr9+KCOIbg1Qv 0j+tFIeLesu6Oiw25XC+ziv8t35QnUL+pizzCSYiWehiRgnIUm+Hk/Fl8pUV9Y8Ctf RLXoBEBGjeAMGvLAYF6acv3XA5zkwDZRUDr4lYcVN0Lp/jkSm4yn180OXPP3vScs+8 7l7yV4cC6HjdA== Subject: Re: [PATCH v2 6/9] x86/kexec: set_[gi]dt() -> native_[gi]dt_invalidate() in machine_kexec_*.c To: "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: Linux Kernel Mailing List References: <20210515014400.2999028-1-hpa@zytor.com> <20210515014400.2999028-7-hpa@zytor.com> From: Andy Lutomirski Message-ID: Date: Sat, 15 May 2021 08:30:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210515014400.2999028-7-hpa@zytor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/14/21 6:43 PM, H. Peter Anvin wrote: > From: "H. Peter Anvin (Intel)" > > These files contain private set_gdt() functions which are only used to > invalid the gdt; machine_kexec_64.c also contains a set_idt() > function to invalidate the idt. > > phys_to_virt(0) *really* doesn't make any sense for creating an > invalid GDT. A NULL pointer (virtual 0) makes a lot more sense; > although neither will allow any actual memory reference, a NULL > pointer stands out more. > > Replace these calls with native_[gi]dt_invalidate(). > > Signed-off-by: H. Peter Anvin (Intel) Acked-by: Andy Lutomirski