Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3426722pxb; Sun, 26 Sep 2021 15:07:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZPruMooM3TE4wFh05E+sjgdcxiJ6SFv2ckmy7Ua6ZVWwoxdIjivyLWwm0gLhyJHCp9uQ3 X-Received: by 2002:a17:906:3b5b:: with SMTP id h27mr6778534ejf.182.1632694079184; Sun, 26 Sep 2021 15:07:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632694079; cv=none; d=google.com; s=arc-20160816; b=QJSk3zFa9dodBOHy7FU4Wi/VloFHvMdz6dinozD6jVKreAC4AOnzPAn/ZmEC8aYIIt c3SbWVOPQgmrQ57AgRj21VuCDd1XsWoHenIXtjv6Ep07d3o5AgqGwgk1P3ds1NYpbIDf SuU2Nix+3uH3dYSW5mBv626WMi78sXgJcheSAlGwM6O1XkNaSbsgt+sm+/l4grOBLHW2 qEv+amhhjMBZn+NFRpfbGh5PCqPcrCmvg/D9zayroEiY9u67sexRQsMiFRyYLTA7L1LH FjpYb4Bn0ZV87ZzRzRhd8RvUxp8N11/zojQ+RKebIbanQECycZHjqJLLBFubkxSTGI+o o8HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=gqxOiBdeytJus8bgCkvYKAJdNenVvStYS90LIV9ToYo=; b=ypEZ7awt2y14aNggh1HwNBga7x77a8/eRXGbHmwgBgwLvZJjEqG1fahrDhWN/FYSSP edFIrwZRoKPb+dxM8dDHXQ8+nqe/S6qkpI5I8eyU4xVXiIRBIIByKWmmKMI60msyLQFJ 6Q8PMBQpgbqKfj1Cs0McQLHTgVfvewNcBAcWZUqcgt4jd1e49fCz5IpwJaPkwIMgfv4J /IAKLF6SCrEmFvTM4yC/4ZLhvVGZsSB04TmSBL4DGA0i20H4V9ospOYZYb0A9rODC5sL lc9OQXxnSw6m99ylhu6AcIctezy4lgE53eciPDhCsOAuvM7dpXyUamsrwlanOrJRzLaf v2Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=mHbgZaHC; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp19si9960922ejc.630.2021.09.26.15.07.35; Sun, 26 Sep 2021 15:07:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=mHbgZaHC; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbhIZWEt (ORCPT + 99 others); Sun, 26 Sep 2021 18:04:49 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:53244 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbhIZWEt (ORCPT ); Sun, 26 Sep 2021 18:04:49 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1632693791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gqxOiBdeytJus8bgCkvYKAJdNenVvStYS90LIV9ToYo=; b=mHbgZaHCFWguQUU2p3BhLzogeqBKGmGRJzL5LVzhKotqeX8nCOftDep14zyQ+435VDspQr 48GpqkVqZbL45MgkbEPv/f+/7ez57UX2t09qxikdPrSCzHeYBvXMJ7g7jmDAiy03AkV9tk eWyAOapaqDi6OI1LDI5NVI73QhbcLjMZlcVmgmsH1dWW/2lEEpS1kijSd2SGbkMyCnanIn aVyPq93oWGl7mgk0Xgk/IyIy1qWKk+DW4G+klYdjtYEoQDZYhNVxco4N1qNgjvsCRX0Uyi LGHm6jBXpIfVYmLjzbMl9b2HHwqQhTZ3dvheeIKyrhT64t7fhT/Zrq+nPD6kQQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1632693791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gqxOiBdeytJus8bgCkvYKAJdNenVvStYS90LIV9ToYo=; b=VTzuQu3ZVYeFvsvV5Qn+Ze7rFe6iRArxJQtvvVM6OsFvgBucarYK1V3EeRSmq1/XfKE5TL NvzIOerREB5D9jCg== To: Wei Liu , Linux on Hyper-V List Cc: Michael Kelley , kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, sthemmin@microsoft.com, Wei Liu , Linus Torvalds , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v2 2/2] x86/hyperv: remove on-stack cpumask from hv_send_ipi_mask_allbutself In-Reply-To: <20210910185714.299411-3-wei.liu@kernel.org> References: <20210910185714.299411-1-wei.liu@kernel.org> <20210910185714.299411-3-wei.liu@kernel.org> Date: Mon, 27 Sep 2021 00:03:10 +0200 Message-ID: <87ee9batb5.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wei! On Fri, Sep 10 2021 at 18:57, Wei Liu wrote: > -static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector) > +static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector, > + bool exclude_self) > { > struct hv_send_ipi_ex **arg; > struct hv_send_ipi_ex *ipi_arg; > @@ -123,7 +124,10 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector) > > if (!cpumask_equal(mask, cpu_present_mask)) { Not part of that patch, but is checking cpu_present_mask correct here? If so then this really lacks a comment for the casual reader. > ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K; > - nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask); > + if (exclude_self) > + nr_bank = cpumask_to_vpset_noself(&(ipi_arg->vp_set), mask); > + else > + nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask); > } But, what happens in the case that mask == cpu_present_mask and exclude_self == true? AFAICT it ends up sending the IPI to all CPUs including self: if (!nr_bank) ipi_arg->vp_set.format = HV_GENERIC_SET_ALL; Not entirely correct, right? Thanks, tglx