Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp900630lqc; Fri, 8 Mar 2024 15:41:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCuDhh2C1+nLB75cSwe1X47eL3Ljx1bvb4sorGS3hwmc/5wG0s5lCOaHLyKrHg+uLpaCmIKbOH5Ltu8uC0AMZEqVc2c+pMZ7wxM1RJZg== X-Google-Smtp-Source: AGHT+IE7BpwsVI2d4ynxIDIb/SaPDICpj6HeiBuXuJJDJ++oG1GPQg20ZCXen2lxaFHn11YGL9Cx X-Received: by 2002:aa7:888a:0:b0:6e5:e8ee:38f2 with SMTP id z10-20020aa7888a000000b006e5e8ee38f2mr636387pfe.23.1709941268446; Fri, 08 Mar 2024 15:41:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709941268; cv=pass; d=google.com; s=arc-20160816; b=oVk7GWyt2KgIF41JgKmkieJXMqC4UwE4hygQ+3wJNEurF8u3fE7hclQEi7htcTdA0m nVcosYZIGOMhIhrLvPYT5Yy6tJGp5H4X9CYDi8tWkuDZLHZyIm/yXrGaW1BWgr9e46JB 6x4rAp5U/rwh/wAqhRIMoUnOymfxJRL6z5LCMu/cbseEDGJEHXNkiZetcRUgt9cb3GcQ 3jDXpbkrQ/c2ey+jvw03eSr/16mXJFBtIs3BwphvCGLTii5P2PqBzumixEfF3Bv4vfEI u/BKwhmu44kCwW5w5N/wycRsS64C+xYjx59q7Olj1VOIlzlHcG+tdGuOOsHb2FzaXL6s hyeA== 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; bh=zlfQth9DPWSsn+arH/qgpKnNXviHjH835S37nR4dhGE=; fh=44KS869CB3HwPk0q/UD6PJJGClT7k3MD3VQZEOEnP94=; b=UelEZA2ndTG1c+zTiaUM2nQYGEcqC7nAVWLZ1qLqVnIQcvi+E2aGs1yV56KlunRZ++ MI8XM5Pe3Zhc5Vh1YSomo7H7dQz3oDZAgJBYrDmyuTCwHbZHJp2NoJsntQAXoqabbdd+ tAYeRX6+JftBfoj/qIYVRX3/wZqcn7Pi33fPnhxcNhICh7b9r+GycMRp6wt0YojL0SBK 3Bo14CJECrPEmSzd8EaxzpWD8kiH29F1SHs5hmI64zFn+tohtivs6IvBbVzyjXb2l0sr QXj2yk05J+/qu/44KEa9AWpBoxuqGE6uT1I/+gQm73AY7LlFNSfXH+cGYuurawr7kvmF OypQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-97692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y39-20020a056a00182700b006e66f850a22si449066pfa.248.2024.03.08.15.41.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 15:41:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-97692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2158928279E for ; Fri, 8 Mar 2024 23:41:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A0263BBF7; Fri, 8 Mar 2024 23:41:03 +0000 (UTC) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E10C6AC0; Fri, 8 Mar 2024 23:41:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709941263; cv=none; b=td8aX7/O67XxDrIWk53+N08SfsbKloJMGX9oWJjOG5hUTRORFaiQAwTFeuiHqtgvTMi46Dr3DQPJeWwIojlVO+Ud+L9mLDZpxDdyWeV8GbQiYesTpSbWQXs8XR7hNS436xOXRxYAFwldlcLmMK4jriw2SSdYbQTRDiR3fLi/ciM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709941263; c=relaxed/simple; bh=D6gzLwzqOzpvQah9QvGx9R5y4EQMAGBwu9cG1sS5btg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CKF9i3rWMskSAhvI+5ig/WwRwoz6vUJQx15/heQFGcwPXKR4mqmoxFQsLuKSTNvT/hVga7z8Rr+WmdXQFnSfy4vfnANEc7F5Ntro5PYqlDQZbf7YOXhJg30wFlsWvfWPg0eX7vI/PGvG76R2axJCWZiA+GmBIT1gixpYPIUoJYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1dd6198c4e2so15266025ad.2; Fri, 08 Mar 2024 15:41:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709941261; x=1710546061; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zlfQth9DPWSsn+arH/qgpKnNXviHjH835S37nR4dhGE=; b=qn0wtM+rZHuWuZMSgEwae6WWIAEE55KsBd3N5ktRmEI24FCsI9ylv8/kHTBAQbOP87 5uwW9fZJ2S5mzc8bQykQemgHsxzPfsEv7vgl2SICGQnSMgSOLbqTra/YptyIcqwVL3TL /bdDffnA4e6BTiXp83GTosITESl4EwRzTKCizs4YvoomhkXj/YMPje9e4Ug+Osi0v9O9 GMXSAan2ZObnoKN8/14kDuy0J1uQkej8+TLUYrTouOfxZiSuA0TqAyzQfUbYRReHgCC6 Bky7GsVdrZnSYS/iad92Blp58ZiWORpzCZfa91UxB1T/zTqwHmVCUvcQjUm/a4XPx5MJ qFuw== X-Forwarded-Encrypted: i=1; AJvYcCUNRBouqO/+QvXz1dYBaCaP0OYzhpWM4342E4zoNDkJEuEgYxAn7yyLGmd+35sxP54U/qPUQQnH7ABAxHnnTxWfXA3bm5899CrWgodxicJxwgr0bGvoCJtQhktgyJHppWxNAeFcQq4I6Bfu X-Gm-Message-State: AOJu0YzRv1FVw6JnWlzMcWx8I8aErDJz5k0ib+ruvmzvNFantsyOvlRD QVjC2jpdMwANAotaRFfZt5zXo5VPy+QxHyUU3S3BvwiX0A24Pmw2 X-Received: by 2002:a17:902:cf11:b0:1dc:d642:aaf0 with SMTP id i17-20020a170902cf1100b001dcd642aaf0mr249479plg.6.1709941260826; Fri, 08 Mar 2024 15:41:00 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001db55b5d68bsm188703plg.69.2024.03.08.15.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 15:41:00 -0800 (PST) Date: Fri, 8 Mar 2024 23:40:55 +0000 From: Wei Liu To: Saurabh Singh Sengar Cc: Wei Liu , kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, dwmw@amazon.co.uk, peterz@infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, ssengar@microsoft.com, mhklinux@outlook.com Subject: Re: [PATCH v3] x86/hyperv: Use per cpu initial stack for vtl context Message-ID: References: <1709452896-13342-1-git-send-email-ssengar@linux.microsoft.com> <20240304070817.GA501@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> 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: On Tue, Mar 05, 2024 at 12:26:50AM +0000, Wei Liu wrote: > On Sun, Mar 03, 2024 at 11:08:17PM -0800, Saurabh Singh Sengar wrote: > > On Mon, Mar 04, 2024 at 06:24:27AM +0000, Wei Liu wrote: > > > On Sun, Mar 03, 2024 at 12:01:36AM -0800, Saurabh Sengar wrote: > > > > Currently, the secondary CPUs in Hyper-V VTL context lack support for > > > > parallel startup. Therefore, relying on the single initial_stack fetched > > > > from the current task structure suffices for all vCPUs. > > > > > > > > However, common initial_stack risks stack corruption when parallel startup > > > > is enabled. In order to facilitate parallel startup, use the initial_stack > > > > from the per CPU idle thread instead of the current task. > > > > > > > > Fixes: 18415f33e2ac ("cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE") > > > > > > I don't think this patch is buggy. Instead, it exposes an assumption in > > > the VTL code. So this either should be dropped or point to the patch > > > which introduces the assumption. > > > > > > Let me know what you would prefer. > > > > The VTL code will crash if this fix is not present post above mentioned patch: > > 18415f33e2ac ("cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE"). > > So I would prefer a fixes which added the assumption in VTL: > > > > Fixes: 3be1bc2fe9d2 ("x86/hyperv: VTL support for Hyper-V") > > > > Please let me know if you need V4 for it. > > No need to repost. I can change the commit message. Applied to hyperv-next with the new Fixes tag. Thanks.