Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3067393pxj; Mon, 10 May 2021 17:57:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzpKEYh1Onq66GXlC9huWrgJSvELW3gLoaeGWOmxey6nlce11zzGd5A4G5klnoyQO+bs9F X-Received: by 2002:a5d:8787:: with SMTP id f7mr20536594ion.108.1620694626784; Mon, 10 May 2021 17:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620694626; cv=none; d=google.com; s=arc-20160816; b=0zou8V5BuGAVFfvbmeCUiSEXx7gAl0O7f6f7ioR1PyLkLTDBMur7qwTlnrsUpuTPjd qFYqhRfSXdg3LaBKtQlbqwK/JM95OQwY+iGSjTnmmriJUf+HUtcdg2oiix3wlz6FL7Jr 3Qd4xFqYcgxi5rUepWOOSG7PSxDFQjbt2KgwwoKtwFjSB7Y1ZDrupkxss+VATs4mjoQz iTx3u5nBGbo44qyHdao8/1912MBlRYogR9LEzbwSs5W+Wh7NZEollfB2VkeP6/NlrhHk 2Z17atF0rorWvg2vu66OznXID+hjdbQ4UYnDcqBtYmIrcjY3pYswLUemRT5g5Ta79noS ATvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=Ckez2BGMzJzZas4BtzTmwHHAtQVyx9WKBJPNFkDqe7s=; b=jZ2RBXg4tVlsXf9C6DWFZ1gQHIL4ZZschw1yrCGbCk6ZVZRlaoGqwGZGIFOqZN94w0 8d3B0vaZI1r/g41Gm/2RV/6Qeje7Aex7+1z4u0tzJLJ/qZQNJz+fIiBv6mChY3XlhLSn V+VhegvAPDOJpKQMstATJXRlhu/5gfeiwAfcDtZ7plTQd91ygTgymgtLquAjaxwqhdR1 TVlK9aH3gvQEMIVUxaR+/eUJWVuEYUouUQtDZOPXdLp9ffZGAFybHrX5+Jy0zhGHoV2h Cn2wNTYV4TNsS9RjTz2ufkYDQYH6pjovbNxm9WVLAiw6zuzqOlimKsfwkn3xRFk/T9RU Y2Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2021042801 header.b=ZvYTfn+Z; 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=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si11442466ilj.61.2021.05.10.17.56.54; Mon, 10 May 2021 17:57:06 -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=@zytor.com header.s=2021042801 header.b=ZvYTfn+Z; 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=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbhEKA5T (ORCPT + 99 others); Mon, 10 May 2021 20:57:19 -0400 Received: from terminus.zytor.com ([198.137.202.136]:55531 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbhEKA5H (ORCPT ); Mon, 10 May 2021 20:57:07 -0400 Received: from tazenda.hos.anvin.org ([IPv6:2601:646:8602:8be0:7285:c2ff:fefb:fd4]) (authenticated bits=0) by mail.zytor.com (8.16.1/8.15.2) with ESMTPSA id 14B0tdw82504247 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 10 May 2021 17:55:50 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 14B0tdw82504247 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2021042801; t=1620694550; bh=Ckez2BGMzJzZas4BtzTmwHHAtQVyx9WKBJPNFkDqe7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZvYTfn+Z+HFq5K73Xl2pnagqYNqyGtsV93J2gw/htJbn48qvClETPS+XNwLEuoUIX XYhtPKcUZbfFUf/M9odQrc5rEVH2ayq5HMY0K7JlRVyxiGKhjfbQCf3UN3xbA1hKA3 mzOjYR7EwXkWWApAVBKxFzmWTSXpTpevlwVFkDVCshUGl9gLjAMWUZwncdquYmjNN6 2iDJBmGoiXd4v4cJhJfHfuNhEhMyw1bN+N8AfYQktZ3nAi/xNOaywFMJFCCAty7WV+ dlhjRON0mh5mG7d9mUqqTQknbPfZZO/6njD/6mC5Qyl//IMvWAup7R58VDyNaermT6 pUrbQ8XZg/6pA== From: "H. Peter Anvin" To: Ingo Molnar , Thomas Gleixner , Borislav Petkov , Andy Lutomirski Cc: Steve Wahl , Mike Travis , Dimitri Sivanich , Russ Anderson , Linux Kernel Mailing List , "H. Peter Anvin (Intel)" Subject: [PATCH 3/6] x86/idt: remove address argument to idt_invalidate() Date: Mon, 10 May 2021 17:55:28 -0700 Message-Id: <20210511005531.1065536-4-hpa@zytor.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210511005531.1065536-1-hpa@zytor.com> References: <20210511005531.1065536-1-hpa@zytor.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "H. Peter Anvin (Intel)" There is no reason to specify any specific address to idt_invalidate(). It looks mostly like an artifact of unifying code done differently by accident. Signed-off-by: H. Peter Anvin (Intel) --- arch/x86/include/asm/desc.h | 2 +- arch/x86/kernel/idt.c | 5 ++--- arch/x86/kernel/machine_kexec_32.c | 4 ++-- arch/x86/kernel/reboot.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index 476082a83d1c..b8429ae50b71 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -427,6 +427,6 @@ static inline void idt_setup_early_pf(void) { } static inline void idt_setup_ist_traps(void) { } #endif -extern void idt_invalidate(void *addr); +extern void idt_invalidate(void); #endif /* _ASM_X86_DESC_H */ diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c index d552f177eca0..17f824462f5e 100644 --- a/arch/x86/kernel/idt.c +++ b/arch/x86/kernel/idt.c @@ -331,11 +331,10 @@ void __init idt_setup_early_handler(void) /** * idt_invalidate - Invalidate interrupt descriptor table - * @addr: The virtual address of the 'invalid' IDT */ -void idt_invalidate(void *addr) +void idt_invalidate(void) { - struct desc_ptr idt = { .address = (unsigned long) addr, .size = 0 }; + struct desc_ptr idt = { .address = 0, .size = 0 }; load_idt(&idt); } diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index 64b00b0d7fe8..6ba90f47d8c3 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c @@ -232,8 +232,8 @@ void machine_kexec(struct kimage *image) * The gdt & idt are now invalid. * If you want to load them you must set up your own idt & gdt. */ - idt_invalidate(phys_to_virt(0)); - set_gdt(phys_to_virt(0), 0); + idt_invalidate(); + set_gdt(0, 0); /* now call it */ image->start = relocate_kernel_ptr((unsigned long)image->head, diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index b29657b76e3f..ebfb91108232 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -669,7 +669,7 @@ static void native_machine_emergency_restart(void) break; case BOOT_TRIPLE: - idt_invalidate(NULL); + idt_invalidate(); __asm__ __volatile__("int3"); /* We're probably dead after this, but... */ -- 2.31.1