Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp444673lqp; Mon, 10 Jun 2024 08:42:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgYs0QVHzdP+MDQeoded1KLVxJ9BGSng5Fpoe7MdU3YEq82oyf9uk9CtJte9k9080m5EdUmLTMn8MrrQP7lX9VTb/h/v/hQtOW39IOiA== X-Google-Smtp-Source: AGHT+IGi5P9CbUAauA+nv0yalQcjxz9Yf22hHfIvgbHUbwZcocjWQ+EdSD8OJCFp7kUVmpyXjNHd X-Received: by 2002:a05:651c:4d2:b0:2eb:d924:4413 with SMTP id 38308e7fff4ca-2ebd92446camr74857941fa.10.1718034171646; Mon, 10 Jun 2024 08:42:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718034171; cv=pass; d=google.com; s=arc-20160816; b=wiap/cbY4lqKA4W7T7VVHLqNc42YU5blbC+FzGEUa0je4nt7+MJL+WzTaKMVgBocTE 2DXLXl3PXhsK+Zy4lutaRqQu9cxsxbiR4Nhz3zPK5h6y4/K/K83yGFzZNo79vY1TnVCE oTAUe3j+QvvQ/T0r3j+jUp24z343O26GQsoCixwHnKfbhkxv0AXMKiJJXEPNwHHh7id5 bIyQ+vkoKuFkBYfVa6md9jn0FRqFaBc5G/ILp6TDD2BQtQpqgko1SCO745VcBq5i/YYU DzpToe9THRXDLhaLywbfOPC0D9yl5zaqMAWFmIA+1qwd4sB2hdOmhBy5Pp5XlEX+2LhV 7yzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7i0rVMa1P9pUy+aSSh8OlgfbfSJUPO9gLhMR75k/k8c=; fh=7HB6he9WSlpUGy7mSiZZe/5kzLKHnHSnusDpqQ0dkoY=; b=Qv/yoivw6Mk00FzJrxcdA/mFkGnCdM4eIknHaLk5ZXpgyKQUpKFB5isv/DO05/bp1W 4grluPE+iV+AUMeQ1RTcyWl6txsoWYnK6BPYMso1XoDZiC/jTRTg1QRgQTFYf6mMK8h9 gw8LwdVMs1okgJdcgJD2QV/4O4RuRWedl4AJAJmvgzp4ny8LF2kBlq7cIeDxk/2aTXoL Up9p54sBaUCneGSTXmS34w8MZ+7CUjXslXN1F/+uzTEFVD137ZYeG1UC1DbRYIvM/U0x AJXU/f8ISO/jhu0P7TRXDYWvDtLfZZVg3eHxTZchT0QQzvUxKfxrRTVL6UhtTxnIeG1Y 9xcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Mth3Ocsv; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c8c403219si530588a12.320.2024.06.10.08.42.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 08:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Mth3Ocsv; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A41E11F24E40 for ; Mon, 10 Jun 2024 14:03:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0102313FD84; Mon, 10 Jun 2024 14:02:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Mth3Ocsv" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 822BD12FF65; Mon, 10 Jun 2024 14:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028125; cv=none; b=CumOXARXhz/G6SmpQQSTJsnVX5XgBuwkN9j3n6GSsC/OVown/cBPFARrhvMZJ/pX7Eor7Q9eciVAmnyEwrKjA/ftZBZ1sFZdJ2azbYPH8Cb05BVjG8+JM4ADAiPEgcr5j+D1EcX2fJm006MfbdphnPACG7wEQnhyBdd2SNNNikc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028125; c=relaxed/simple; bh=g0xcEy+pFWVYmhSOSWpyQFktSP+xBDDKruU8/KgTUqM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n2QGWzE0YjIM8o63k8ueyac+Mx3gcnMxSs3NvRvOQPcczZ6Z7ziuvxOiLkRGdRBvoSw06bRNdBCyUyyNkXmPxCaupvc3aOZT8LVP5L6Vuvha6p+horEhPXNhlzTJy0iWRg5xSuNnvkScisKJKU5FmF00VEsJChfiHa5kVoiKCB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Mth3Ocsv; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718028124; x=1749564124; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=g0xcEy+pFWVYmhSOSWpyQFktSP+xBDDKruU8/KgTUqM=; b=Mth3Ocsvhu3cmKQBj+MdtjQbQKvti1mOMmDkKNADJKQSP5S5DeG2opnG YHUvha0DjoCC+3l3WPWv0XUpbtD7ufyaePRV66z6JRq2QHXgKoK4EDBvT P/Bh01fNQ+h5fCjmoIdrhH8XTkzy5pafz5S6DG3ubzgP/XLr8fj42Hr2r 4tT5aBquczFL/XtaFbB/rsYIa59nNDOY6jP5CvqSaeFsCr5S39I5k0bt3 NrF6Ap7un0meM2FjMhUyJKp9sHnnTZloaztO+b3wviWq3/TWgWsgxrCet 3eg0XcukgARNYaGYNNZpUcNVNo/Qb6QJR4/DX8WDiEadxxhmjU2waU1Yt g==; X-CSE-ConnectionGUID: Y+ZhnCu7S7eMHancxKuZuA== X-CSE-MsgGUID: NIqTQJHaSze8kv3JqESw/Q== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="11998244" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="11998244" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 07:02:03 -0700 X-CSE-ConnectionGUID: 9ErXJ/nuQHmHPs8IKgjiRA== X-CSE-MsgGUID: OUlS4SOxTGyzDSRbYOqyxA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="39736967" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 10 Jun 2024 07:01:57 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id AC1CC20B; Mon, 10 Jun 2024 17:01:55 +0300 (EEST) Date: Mon, 10 Jun 2024 17:01:55 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Kuppuswamy Sathyanarayanan , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , "Kalra, Ashish" , Sean Christopherson , "Huang, Kai" , Ard Biesheuvel , Baoquan He , "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , kexec@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-acpi@vger.kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Tao Liu Subject: Re: [PATCHv11 18/19] x86/acpi: Add support for CPU offlining for ACPI MADT wakeup method Message-ID: References: <20240528095522.509667-1-kirill.shutemov@linux.intel.com> <20240528095522.509667-19-kirill.shutemov@linux.intel.com> <20240603083930.GNZl2BQk2lQ8WtcE4o@fat_crate.local> <20240610134020.GCZmcCRFxuObyv1W_d@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240610134020.GCZmcCRFxuObyv1W_d@fat_crate.local> On Mon, Jun 10, 2024 at 03:40:20PM +0200, Borislav Petkov wrote: > On Fri, Jun 07, 2024 at 06:14:28PM +0300, Kirill A. Shutemov wrote: > > I was able to address this issue by switching cpa_lock to a mutex. > > However, this solution will only work if the callers for set_memory > > interfaces are not called from an atomic context. I need to verify if > > this is the case. > > Dunno, I'd be nervous about this. Althouth from looking at > > ad5ca55f6bdb ("x86, cpa: srlz cpa(), global flush tlb after splitting big page and before doing cpa") > > I don't see how "So that we don't allow any other cpu" can't be done > with a mutex. Perhaps the set_memory* interfaces should be usable in as > many contexts as possible. > > Have you run this with lockdep enabled? Yes, it booted to the shell just fine. However, that doesn't prove anything. The set_memory_* function has many obscured cases. > > - The function __flush_tlb_all() in kernel_(un)map_pages_in_pgd() must be > > called with preemption disabled. Once again, I am unsure why this has > > not caused issues in the EFI case. > > It could be because EFI does all that setup on the BSP only before the > others have arrived but I don't remember anymore... It is more than > a decade ago when I did this... Are you okay with this? Disabling preemption looks strange, but I don't see a better option. -- Kiryl Shutsemau / Kirill A. Shutemov