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 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49DC6C27C53 for ; Wed, 12 Jun 2024 10:41:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.739166.1146123 (Exim 4.92) (envelope-from ) id 1sHLQF-0004z2-5Y; Wed, 12 Jun 2024 10:41:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 739166.1146123; Wed, 12 Jun 2024 10:41:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sHLQF-0004yv-2s; Wed, 12 Jun 2024 10:41:43 +0000 Received: by outflank-mailman (input) for mailman id 739166; Wed, 12 Jun 2024 10:41:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sHLQD-0004yn-T7 for xen-devel@lists.xenproject.org; Wed, 12 Jun 2024 10:41:41 +0000 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [2607:f8b0:4864:20::f35]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 597832fc-28a8-11ef-b4bb-af5377834399; Wed, 12 Jun 2024 12:41:39 +0200 (CEST) Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-6b064c4857dso22538616d6.2 for ; Wed, 12 Jun 2024 03:41:39 -0700 (PDT) Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b0869d137csm22361186d6.64.2024.06.12.03.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 03:41:38 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 597832fc-28a8-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1718188899; x=1718793699; darn=lists.xenproject.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=sxBUTZtUrBR9oLNSLJrCyYDuywgJfnwRaLYKvWAuEUA=; b=W+wk6baIIVT5ckkxoMuu1EOvWtVfjJe3LsMAL/nncasZ6WifLWiXSR2z4+lntkwPrI L+HZbsL9TycmEjamhNWA9v7KdX5do7xrEoI52Wt3C6YB2ayjTYlobNBkW4omSjgdyb4+ yjdjF/Zy4VD8wkpNkE7hIISLSoUJHEqfZRm4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718188899; x=1718793699; h=in-reply-to:content-transfer-encoding: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=sxBUTZtUrBR9oLNSLJrCyYDuywgJfnwRaLYKvWAuEUA=; b=k7Ryy7tQSWAdoWuiiCuKxbXRMDvI+1S1cGexZFoF0GbstbqNkK8wGkMcFSbwV1mn3T OAPGAbBPNJ0Rt3shao7Lf8uhEx6KXJy9yWgRma/++QF0z7YwkG98OujPhy3N+26AdqmS CtQ8E7STYhU2bi5ZIvcspwY7zUrY3JUNpoUBzP+HUDkZmSaCgtDu5TL7ntDFK2XNAY9S Y+QJ/aRf//FFzM2k5pQ7OrnRU6/iMF9carZwP8Yz/dLhvQd19CTphnYb64+MJaRzP7a+ WSz0cb8p/zKh+uXB2c5UTAOfkoCn/5chvrmkhPI/hWOto13pXfeooiMrhn8m0aB1SRGO KPfg== X-Forwarded-Encrypted: i=1; AJvYcCXaBAwEqfPUnaLJgjzC0PpaqtD/P2Mf3y6BZfwUfuEq/MKQadBeSCHztvGZCqqkvvB2O9DGmxrVErNN/mW6OLVANjzEBLVyPTUPMwLmC+c= X-Gm-Message-State: AOJu0YygYhL3hEKyZbjfXw6wJ4nceXYzokhqcft5mtjlepMGvXMn5Cd7 zeLpxSokkgHI+OwiaimLybBfpHlutr2EjQCciXyTTKIfmMhdrh9SJt5nuWW+XdMVvHPBeZJYd0a Z X-Google-Smtp-Source: AGHT+IFH+t+/Ba3CG1G2Do5S9eB+BcBKKgtyDOH6DpWOJq6+Js8xCX7B/WFzB3D7f5R2edoJtATA2Q== X-Received: by 2002:a05:6214:5990:b0:6b0:7db4:42b9 with SMTP id 6a1803df08f44-6b1a7ad485amr11868286d6.65.1718188898788; Wed, 12 Jun 2024 03:41:38 -0700 (PDT) Date: Wed, 12 Jun 2024 12:41:36 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Jan Beulich Cc: Andrew Cooper , xen-devel@lists.xenproject.org Subject: Re: [PATCH v2 5/7] x86/irq: deal with old_cpu_mask for interrupts in movement in fixup_irqs() Message-ID: References: <20240610142043.11924-1-roger.pau@citrix.com> <20240610142043.11924-6-roger.pau@citrix.com> <66fc06cc-f1f6-4f12-83d4-a3b9788bffba@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jun 12, 2024 at 11:04:26AM +0200, Jan Beulich wrote: > On 12.06.2024 10:47, Roger Pau Monné wrote: > > On Tue, Jun 11, 2024 at 02:45:09PM +0200, Jan Beulich wrote: > >> On 10.06.2024 16:20, Roger Pau Monne wrote: > >>> Given the current logic it's possible for ->arch.old_cpu_mask to get out of > >>> sync: if a CPU set in old_cpu_mask is offlined and then onlined > >>> again without old_cpu_mask having been updated the data in the mask will no > >>> longer be accurate, as when brought back online the CPU will no longer have > >>> old_vector configured to handle the old interrupt source. > >>> > >>> If there's an interrupt movement in progress, and the to be offlined CPU (which > >>> is the call context) is in the old_cpu_mask clear it and update the mask, so it > >>> doesn't contain stale data. > >> > >> This imo is too __cpu_disable()-centric. In the code you cover the > >> smp_send_stop() case afaict, where it's all _other_ CPUs which are being > >> offlined. As we're not meaning to bring CPUs online again in that case, > >> dealing with the situation likely isn't needed. Yet the description should > >> imo at least make clear that the case was considered. > > > > What about adding the following paragraph: > > Sounds good, just maybe one small adjustment: > > > Note that when the system is going down fixup_irqs() will be called by > > smp_send_stop() from CPU 0 with a mask with only CPU 0 on it, > > effectively asking to move all interrupts to the current caller (CPU > > 0) which is the only CPU online. In that case we don't care to > > "... the only CPU to remain online." Right, that's better. Thanks, Roger.