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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 77AC7C433ED for ; Thu, 22 Apr 2021 23:04:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4177B61435 for ; Thu, 22 Apr 2021 23:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239810AbhDVXFW (ORCPT ); Thu, 22 Apr 2021 19:05:22 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:41892 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235977AbhDVXFV (ORCPT ); Thu, 22 Apr 2021 19:05:21 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1619132684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gmWfpHHm6cCJRWuBjc3qinDwjlizXKq6+kayraWbwzk=; b=u7DIZvQt3uBYW9xnsSRC5u6ucwyNmzVQVJ7zW+7gh6jQh02qfS6V8cuX1kc377eLvW8S4E nXrQTLsJHm6YZFRfJedaf9sfWLRGe5sezvH5OWi/sF5ZiM5HTpaP3U22dxqoxnaR0eqrkV Yfk1BQeDrEaiM5BqnE8/6sMARd2xsyNtJC+U7XPgh2/MDfxocAX1n1wpAeVauXkm1SwJ4W whDWA+t79DaozNP/cwekYHFmzad79+JHM+PSX3/7XaCJ33IYMcM3JObc+1KidGXMH6pBZf nJyLOwbVHBx4D67q8JBIEaMXlEvzqBIhLOFcDbAmnWU6BXvBMFqX7ip9jT8dtw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1619132684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gmWfpHHm6cCJRWuBjc3qinDwjlizXKq6+kayraWbwzk=; b=mWbTZ8BFGmarxsE8A5/Mg5XaXKLWxcKz2JQn4G443yHiqp0HyE6Xr5lUhliJYfHClKBhO1 SNkU0q080HEYd5AA== To: Kuppuswamy Sathyanarayanan , Rafael J Wysocki , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra Cc: Len Brown , Robert Moore , Erik Kaneda , linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org, x86@kernel.org, Kuppuswamy Sathyanarayanan , Sean Christopherson , Andi Kleen Subject: Re: [PATCH 3/3] x86/acpi, x86/boot: Add multiprocessor wake-up support In-Reply-To: <20210422192442.706906-4-sathyanarayanan.kuppuswamy@linux.intel.com> References: <20210422192442.706906-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210422192442.706906-4-sathyanarayanan.kuppuswamy@linux.intel.com> Date: Fri, 23 Apr 2021 01:04:44 +0200 Message-ID: <87lf99x6nn.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kuppuswamy! On Thu, Apr 22 2021 at 12:24, Kuppuswamy Sathyanarayanan wrote: > +static int acpi_wakeup_cpu(int apicid, unsigned long start_ip) > +{ > + acpi_mp_wake_mailbox_init(); > + > + if (!acpi_mp_wake_mailbox) > + return -EINVAL; > + > + WRITE_ONCE(acpi_mp_wake_mailbox->apic_id, apicid); > + WRITE_ONCE(acpi_mp_wake_mailbox->wakeup_vector, start_ip); > + WRITE_ONCE(acpi_mp_wake_mailbox->command, ACPI_MP_WAKE_COMMAND_WAKEUP); What's the point of using WRITE_ONCE() here? Where is the required READ_ONCE() counterpart and the required documentation in form of a comment? > +static int __init acpi_parse_mp_wake(union acpi_subtable_headers *header, > + const unsigned long end) > +{ ... > + acpi_wake_cpu_handler_update(acpi_wakeup_cpu); ... > +++ b/arch/x86/kernel/apic/probe_32.c > @@ -207,3 +207,11 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) > } > return 0; > } > + > +void __init acpi_wake_cpu_handler_update(wakeup_cpu_handler handler) > +{ > + struct apic **drv; > + > + for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) > + (*drv)->wakeup_secondary_cpu = handler; > +} > diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c > index c46720f185c0..986dbb68d3c4 100644 > --- a/arch/x86/kernel/apic/probe_64.c > +++ b/arch/x86/kernel/apic/probe_64.c > @@ -50,3 +50,11 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) > } > return 0; > } > + > +void __init acpi_wake_cpu_handler_update(wakeup_cpu_handler handler) > +{ > + struct apic **drv; > + > + for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) > + (*drv)->wakeup_secondary_cpu = handler; > +} What's the reason for having two verbatim copies of the same function which has no dependency on CONFIG_*_32/64 at all? Thanks, tglx