From patchwork Wed Aug 9 20:36:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 133532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:9d8d:b0:139:fa0d:b2d with SMTP id d13csp152029rwo; Wed, 9 Aug 2023 14:22:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDhD9E/7wcYqd91XW+KwXE1ot7DQHx303SOYeE/vp1ylO8L/YbSoaeFmPWIyJLuUupn6/H X-Received: by 2002:a05:6a20:ce84:b0:11f:6dc:4f38 with SMTP id if4-20020a056a20ce8400b0011f06dc4f38mr418118pzb.55.1691616169137; Wed, 09 Aug 2023 14:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691616169; cv=none; d=google.com; s=arc-20160816; b=ARqDqCbp+XxmTldBcsJlvsDgcuKoJsRg2BgntTc+7vAL33jXsEFHmBRar74gz8zb3d traw0bGyQrF+ciyA33+YfctkL+zW9ne5OFQZyVDez5GyIXCE+anMKSTczpHrWJpo7773 i9OvMuAzCM98PykCOx0wxyfbwqEiprNd+cV45VDvMHeGWbvqWBZE2bWeky71d81lwoza VEbJ3ZvwvO35AZdBY8t5aMRmSU50vt6qgXQ+xWTbzeN7PUW53MfZGxHqUZLhOyudNf8h HHQQPCy7f37HvCXQSKKbCde+cC/TnrsrvGyq04DgNi0y7aSWYZx1Sh67wOB3dpta5u7I soFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=BKgymA0Nyj04yj+S/5v9Z2cdQX5tomjetwTLfJopQm0=; fh=jBwjuriIPWA1lnCf5oMMiNAPpgGE0iGPmBzZMsd85oQ=; b=z1USlLi1hANaDH8k6DcM0dUiWuzLgprEPHCWpGxTJ8bJ+Wqkl5FtnBKbbtizcfW8Jt gEyy/IxVlWvLX8hCVUDxHGQIP3s6J2ThIeeyxcCb0NqV1OzY5vH0/KeMITKzMS09bNtu z0mdPsUStpGVbgqSqPB5G951V8xk8LeO9SAzgNpt7Oyq+v4CgJspHYIaUG6xeftbQrMZ x0MArka1WmEQnrk6rQpGmOv1PAg85FW66dPFQVNrUEHTGXEhaEniYgcvX74qMWPl1PUq gxG0qbZls7Lp+H/8KtqVnR7ok9H14fS1KUo43GpGCKsZi9NYNG0ZALtFrgYiKxR0+S3X 88yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ogkd9tFf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ea26-20020a056a004c1a00b006875d7c82d5si76268pfb.188.2023.08.09.14.22.36; Wed, 09 Aug 2023 14:22:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ogkd9tFf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234543AbjHIUgR (ORCPT + 99 others); Wed, 9 Aug 2023 16:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234528AbjHIUgI (ORCPT ); Wed, 9 Aug 2023 16:36:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 135792111; Wed, 9 Aug 2023 13:36:08 -0700 (PDT) Date: Wed, 09 Aug 2023 20:36:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691613366; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKgymA0Nyj04yj+S/5v9Z2cdQX5tomjetwTLfJopQm0=; b=ogkd9tFf7INt7FItVYdJ4dXgsQYy3Sip3yTNrcgGstUjGUQ/rdRVS9xrG5defcFNyWEmN4 r8c3wttb4zXGDrRuZ2aNZHROrK5z3NuSefM/nRacbkcbAIIFwVEHlnQqfuxlnws++yR7l8 dvtrD/OCbIIIqW/IA/i3SJKKNvscbZsoXRX0hDVfyjIOPFiVzzZDhXMp4/RztvH/8FD+hj 6fyhBqh2YqLhTMCvJXI7sdqETr9xREJ9j/Vjy2ImeyVVVoD3YaRAJrSLYVXvFPvx+EsDh3 2SzoNyOLPZ8BMMx0Ectckx51KHIKutvbXzrp0bOSLgy8M6lfSxtsXoank2Pgpg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691613366; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKgymA0Nyj04yj+S/5v9Z2cdQX5tomjetwTLfJopQm0=; b=nnPNM5ZpS6foRg3rdgujadq2Jz5nEiJRTnuTM6xs5w8X4DgW7YpRAUSn5IxmFoUj2V+VRF Msndf+er6fNayODA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/apic: Convert other overrides to apic_update_callback() Cc: Thomas Gleixner , Dave Hansen , "Peter Zijlstra (Intel)" , Michael Kelley , Sohil Mehta , Juergen Gross , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169161336618.27769.10942135525224144038.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773788116267349996 X-GMAIL-MSGID: 1773788116267349996 The following commit has been merged into the x86/apic branch of tip: Commit-ID: d6f361ea706710f8d582bb176793b779a3b8b2ca Gitweb: https://git.kernel.org/tip/d6f361ea706710f8d582bb176793b779a3b8b2ca Author: Thomas Gleixner AuthorDate: Tue, 08 Aug 2023 15:04:20 -07:00 Committer: Dave Hansen CommitterDate: Wed, 09 Aug 2023 12:00:46 -07:00 x86/apic: Convert other overrides to apic_update_callback() Convert all places which just assign a new function directly to the apic callback to use apic_update_callback() which prepares for using static calls. Mark snp_set_wakeup_secondary_cpu() and kvm_setup_pv_ipi() __init, as they are only invoked from init code and otherwise trigger a section mismatch as they are now invoking a __init function. Signed-off-by: Thomas Gleixner Signed-off-by: Dave Hansen Acked-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Sohil Mehta Tested-by: Juergen Gross # Xen PV (dom0 and unpriv. guest) --- arch/x86/hyperv/hv_apic.c | 20 ++++++++++---------- arch/x86/kernel/kvm.c | 6 +++--- arch/x86/kernel/sev.c | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c index bfb02f6..72d9931 100644 --- a/arch/x86/hyperv/hv_apic.c +++ b/arch/x86/hyperv/hv_apic.c @@ -288,12 +288,12 @@ void __init hv_apic_init(void) */ orig_apic = *apic; - apic->send_IPI = hv_send_ipi; - apic->send_IPI_mask = hv_send_ipi_mask; - apic->send_IPI_mask_allbutself = hv_send_ipi_mask_allbutself; - apic->send_IPI_allbutself = hv_send_ipi_allbutself; - apic->send_IPI_all = hv_send_ipi_all; - apic->send_IPI_self = hv_send_ipi_self; + apic_update_callback(send_IPI, hv_send_ipi); + apic_update_callback(send_IPI_mask, hv_send_ipi_mask); + apic_update_callback(send_IPI_mask_allbutself, hv_send_ipi_mask_allbutself); + apic_update_callback(send_IPI_allbutself, hv_send_ipi_allbutself); + apic_update_callback(send_IPI_all, hv_send_ipi_all); + apic_update_callback(send_IPI_self, hv_send_ipi_self); } if (ms_hyperv.hints & HV_X64_APIC_ACCESS_RECOMMENDED) { @@ -312,10 +312,10 @@ void __init hv_apic_init(void) */ apic_update_callback(eoi, hv_apic_eoi_write); if (!x2apic_enabled()) { - apic->read = hv_apic_read; - apic->write = hv_apic_write; - apic->icr_write = hv_apic_icr_write; - apic->icr_read = hv_apic_icr_read; + apic_update_callback(read, hv_apic_read); + apic_update_callback(write, hv_apic_write); + apic_update_callback(icr_write, hv_apic_icr_write); + apic_update_callback(icr_read, hv_apic_icr_read); } } } diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index c86cedb..6a36db4 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -622,10 +622,10 @@ late_initcall(setup_efi_kvm_sev_migration); /* * Set the IPI entry points */ -static void kvm_setup_pv_ipi(void) +static __init void kvm_setup_pv_ipi(void) { - apic->send_IPI_mask = kvm_send_ipi_mask; - apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself; + apic_update_callback(send_IPI_mask, kvm_send_ipi_mask); + apic_update_callback(send_IPI_mask_allbutself, kvm_send_ipi_mask_allbutself); pr_info("setup PV IPIs\n"); } diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c index 1ee7bed..a2b50ae 100644 --- a/arch/x86/kernel/sev.c +++ b/arch/x86/kernel/sev.c @@ -1089,7 +1089,7 @@ static int wakeup_cpu_via_vmgexit(int apic_id, unsigned long start_ip) return ret; } -void snp_set_wakeup_secondary_cpu(void) +void __init snp_set_wakeup_secondary_cpu(void) { if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP)) return; @@ -1099,7 +1099,7 @@ void snp_set_wakeup_secondary_cpu(void) * required method to start APs under SNP. If the hypervisor does * not support AP creation, then no APs will be started. */ - apic->wakeup_secondary_cpu = wakeup_cpu_via_vmgexit; + apic_update_callback(wakeup_secondary_cpu, wakeup_cpu_via_vmgexit); } int __init sev_es_setup_ap_jump_table(struct real_mode_header *rmh)