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 32FBFC2BA15 for ; Mon, 17 Jun 2024 13:19:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.742272.1149028 (Exim 4.92) (envelope-from ) id 1sJCG2-0000ay-Ef; Mon, 17 Jun 2024 13:18:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 742272.1149028; Mon, 17 Jun 2024 13:18:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sJCG2-0000ar-C3; Mon, 17 Jun 2024 13:18:50 +0000 Received: by outflank-mailman (input) for mailman id 742272; Mon, 17 Jun 2024 13:18:48 +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 1sJCG0-0000al-Gl for xen-devel@lists.xenproject.org; Mon, 17 Jun 2024 13:18:48 +0000 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [2a00:1450:4864:20::535]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 1fa33631-2cac-11ef-b4bb-af5377834399; Mon, 17 Jun 2024 15:18:45 +0200 (CEST) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-57c7681ccf3so5059607a12.2 for ; Mon, 17 Jun 2024 06:18:45 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb72da156sm6378848a12.22.2024.06.17.06.18.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jun 2024 06:18:44 -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: 1fa33631-2cac-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1718630324; x=1719235124; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=Ty2WRfswxNJCcX/10HNUqpmpOI5m+4BDAmERYC3WGCU=; b=CEQS1FlF/u0z3N66zq5YL6OCJ5pKA6hkFqP/9uYBgSRl5ryR/zEqLaT0LeQkIdOETV 1Y+fbUFHg9iWVlAVTTzx6GuhoRJbEXVMguUy+HesPE7pOUwJoDOkjQBAVJPRRSXKcru/ NERBdIwF4qTUu6rnFPdD6Le6aaocDAIe7i2MOVMAaqpj+OSi4Ugeuv2iyI0Sasx759Sk Txg1CdEooIpj6ZtFqrE2GcKJ1FeGj2CVO5FhGB8YuJQbxS18OFgCB77muPiOQUG8R+We Gbs758eKaFs2ODwienDJhl6DYUNEt8waaSfcZWfAQs7U3zxYBH4nH45QISMQGbOveLZZ 4QvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718630324; x=1719235124; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ty2WRfswxNJCcX/10HNUqpmpOI5m+4BDAmERYC3WGCU=; b=bJQI1/fvlcYHLUYCq1R2Y1+gmF4h9gIKgZPvsKag1xW2tbfZ+6pAMN8KOXmDi6vO9M lA5ond5piPsvvNJ0gtUfGh0PtsE9J8wxfmnlMXJsbON02vgCsRKtc73gRYdx7MJqLZm4 tSkv0weEQigyiKFDe+Jvmtikaz42UXKsBUepdJcE+hcQqNhj1WJNGJcYwbaN/NAh1UtW lhL6TUMxGp4UV5zS1dcOxGSkP24kzcXB1hnhK/SYA/8+yQFVx6LZQVO+eNgXd6LpRh8W aOvg44hiZQIX8BrdAPaxzhuyXlR2jFvOGuCCpLzj+8jBJl1lCgMVtFFITGiY7BlCspvT SFdA== X-Forwarded-Encrypted: i=1; AJvYcCUHk58529zAJei/oXocRl/oI8T0I6eReMSZUu17t6jdWrW/y3hSgwoHQA1coi528uxB7shCC/jW71IUGaxk6RRndaAz+ynadPLavJEpXOE= X-Gm-Message-State: AOJu0YzOya9G1opM5ahwIyggAZrdZ9LxDodslmHhieVVQhGGnl+rhgUn m9o+02PIT7xE+mtfowFEvVNmynCgjn0kR7eVlnt1QoRupqDuJdio8bT6xfG07w== X-Google-Smtp-Source: AGHT+IF30vTGhiqW3bTL2c40ag/cE69HhbA370NHPjO2R6HRjbdIPGak5cF7P/8SiPIk2z/Y0MLo/Q== X-Received: by 2002:a50:9348:0:b0:57c:73a7:da08 with SMTP id 4fb4d7f45d1cf-57cbd67e4ebmr6648911a12.21.1718630324406; Mon, 17 Jun 2024 06:18:44 -0700 (PDT) Message-ID: Date: Mon, 17 Jun 2024 15:18:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 for-4.19 1/3] x86/irq: deal with old_cpu_mask for interrupts in movement in fixup_irqs() To: Roger Pau Monne Cc: Andrew Cooper , xen-devel@lists.xenproject.org, Oleksii Kurochko References: <20240613165617.42538-1-roger.pau@citrix.com> <20240613165617.42538-2-roger.pau@citrix.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylM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lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <20240613165617.42538-2-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 13.06.2024 18:56, 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. Perhaps a comma before "clear" might further help reading. Happy to add while committing. > 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 to remain online. In that case we don't care to migrate interrupts that > are in the process of being moved, as it's likely we won't be able to move all > interrupts to CPU 0 due to vector shortage anyway. > > Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich