Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1098164rdh; Fri, 27 Oct 2023 04:58:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgK3Dj62UOo4NsbdHJb+zIJXShpbECs3PR6DsLU3l/tc8ARqVOR3/My/AhDz5gAhMBZSmr X-Received: by 2002:a25:a449:0:b0:da0:50e6:12c5 with SMTP id f67-20020a25a449000000b00da050e612c5mr2222487ybi.62.1698407914203; Fri, 27 Oct 2023 04:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698407914; cv=none; d=google.com; s=arc-20160816; b=uG6TjrHPDd2kfVJvGP74mpakIYd8L50+zyLS92uIISnt2jxOGeD4KQBtcqgaZI1u9X eNWoNnCQtu5O2ZM25/Y4qaqB7fZqiK+Bb0At4OyWO6bnzK6MegQRO1u3O256UhOEb8Ah kg7DxLLwBR/S/qwOfcJXHy2hjYrnnoROY/j5uqCkjTptjCYn8COiBBSJ+NLRrLHMaE5O wEejfISn0HPRa3ouW+rgn/SBpcA1qHMUHsqaaAiBz4zGpKA1KedE1Dv1hlpbcssWOB4S Fay7IH7s0lN3HrAXQTli3g2NM9hJc1Gn/ybPZ/afY8P/gYB6sPjqKwfX3o4js8WqBYy5 U9TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lDP0yWmAk/0sL2ue8mfK9RYfgbvvB2zK2UmbMY5012I=; fh=ONZhk0XUIArGH668+kFPNDkXpQavASqLFoOqiIqXy68=; b=BEgM9ldXu1hfZidTEXC92F32C89SDNKuLGPgTbeM65KyrxaYvvRJkVMkw6B8UUVN1X 4fM6Men1aZR7KeZvH+tTNE/4k4n54TXrxmB7ft85GL9mz6HF9pbEkxNSH19s/ldYqn91 fTtsiPCFSCXKCvRFGJNjfw7wSR6RzD7XmuWDGdfymSih3d1cpBFf+5jXlIKeesszXCdi S/5Bp6M8yeqAa2ZnJgml8lIy39lYnpEk/gXUmEvvdEnOZ0yZqstBtNNNw8id0REOvxM2 x2c0B5T0vbh7gJoXV0W2uVml7fFJoR9/ZzEerkB9B+MKZL7piIecL/X/IodW9pO7yM+w V4Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NdYlF1bL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id n79-20020a25da52000000b00d7ba886c1a5si2587664ybf.459.2023.10.27.04.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 04:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NdYlF1bL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8DB4D845368F; Fri, 27 Oct 2023 04:58:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345688AbjJ0L6Y (ORCPT + 99 others); Fri, 27 Oct 2023 07:58:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345539AbjJ0L6W (ORCPT ); Fri, 27 Oct 2023 07:58:22 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE303C4 for ; Fri, 27 Oct 2023 04:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698407900; x=1729943900; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=FMgGs7keUPnSe1O0ZLkjvny+7wogrNAYRVjIflUV0NE=; b=NdYlF1bLXGTH5yhd0r6nbLo1bPyJF49sCJN6vBYBdPiXiw8yQJ7ZeFx2 tifSu5qwM+Cb2LdWlPkbskueumMXlMyUL9LD0w3Na++RnpKlDNJ6YbZ1x AfpK/ys3ZdQtHiLbW+q1Dvc0ArJpR/ecssWsQdxPOA4kJJgfpGNwbn8vt v6skck+Hcxdr4fbyl4kuxAmIS7Z6POC2Hv6D1z5pZcKxdLC0f5XXyq43t gaEYOgwTKR7gmoM2yd11J/yQR97q70PenzUeD3oqjeDrcRYniq1xszDY9 nePLBS9dWzwwu2QOjcLEQLhPCemM/eIP8pIZc1INBVcJSU1AWKqHcFKdl g==; X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="474001326" X-IronPort-AV: E=Sophos;i="6.03,256,1694761200"; d="scan'208";a="474001326" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 04:58:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,256,1694761200"; d="scan'208";a="7634420" Received: from nirmoyda-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.251.213.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 04:58:04 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 98EBE10A210; Fri, 27 Oct 2023 14:58:13 +0300 (+03) Date: Fri, 27 Oct 2023 14:58:13 +0300 From: "kirill.shutemov@linux.intel.com" To: "Huang, Kai" Cc: "tglx@linutronix.de" , "mingo@redhat.com" , "x86@kernel.org" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "Edgecombe, Rick P" , "Reshetova, Elena" , "Nakajima, Jun" , "rafael@kernel.org" , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Hunter, Adrian" , "thomas.lendacky@amd.com" , "ashish.kalra@amd.com" , "kexec@lists.infradead.org" , "Christopherson,, Sean" , "bhe@redhat.com" , "linux-coco@lists.linux.dev" Subject: Re: [PATCHv2 13/13] x86/acpi: Add support for CPU offlining for ACPI MADT wakeup method Message-ID: <20231027115813.imxsyq2ehl664nnw@box.shutemov.name> References: <20231020151242.1814-1-kirill.shutemov@linux.intel.com> <20231020151242.1814-14-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 27 Oct 2023 04:58:31 -0700 (PDT) On Tue, Oct 24, 2023 at 10:11:58AM +0000, Huang, Kai wrote: > > > --- /dev/null > > +++ b/arch/x86/kernel/acpi/madt.S > > I think the name 'madt.S' is too generic. How about something be more specific > such as madt_reset.S, or madt_playdead.S, etc? Okay, madt_playdead.S sounds good. > > @@ -11,6 +16,150 @@ static u64 acpi_mp_wake_mailbox_paddr; > > /* Virtual address of the Multiprocessor Wakeup Structure mailbox */ > > static struct acpi_madt_multiproc_wakeup_mailbox *acpi_mp_wake_mailbox; > > > > +u64 acpi_mp_pgd; > > +u64 acpi_mp_reset_vector_paddr; > > + > > +void asm_acpi_mp_play_dead(void); > > + > > +static void __init *alloc_pgt_page(void *context) > > +{ > > + return memblock_alloc(PAGE_SIZE, PAGE_SIZE); > > +} > > + > > +/* > > + * Make sure asm_acpi_mp_play_dead() is present in the identity mapping at > > + * the same place as in the kernel page tables. The function switches to > > + * the identity mapping? > > > > This function itself doesn't switch to the identity mapping. It just creates > the kernel mapping for asm_acpi_mp_play_dead() in the identify mapping page > table. By "The function" I meant asm_acpi_mp_play_dead(). Yeah, it is not clear. Will so s/The function/asm_acpi_mp_play_dead()/ > > - cpu_hotplug_disable_offlining(); > > + if (mp_wake->version >= ACPI_MADT_MP_WAKEUP_VERSION_V1 && > > + mp_wake->header.length >= ACPI_MADT_MP_WAKEUP_SIZE_V1) { > > + acpi_mp_setup_reset(mp_wake->reset_vector); > > It's better to fallback to "disable offline" if this function fails. > Okay, will warn to disable offlining. -- Kiryl Shutsemau / Kirill A. Shutemov