Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA782C63697 for ; Thu, 19 Nov 2020 16:04:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3E25B22253 for ; Thu, 19 Nov 2020 16:04:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kauqrQB8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E25B22253 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.31062.61275 (Exim 4.92) (envelope-from ) id 1kfmQQ-0007Px-K5; Thu, 19 Nov 2020 16:04:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 31062.61275; Thu, 19 Nov 2020 16:04:46 +0000 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" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kfmQQ-0007Pq-Gy; Thu, 19 Nov 2020 16:04:46 +0000 Received: by outflank-mailman (input) for mailman id 31062; Thu, 19 Nov 2020 16:04:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kfmQP-0007Ph-BG for xen-devel@lists.xenproject.org; Thu, 19 Nov 2020 16:04:45 +0000 Received: from mail-wm1-x32b.google.com (unknown [2a00:1450:4864:20::32b]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d1cbf80b-d145-42c8-9268-81ee5ffa0c9a; Thu, 19 Nov 2020 16:04:44 +0000 (UTC) Received: by mail-wm1-x32b.google.com with SMTP id 10so7696591wml.2 for ; Thu, 19 Nov 2020 08:04:44 -0800 (PST) Received: from CBGR90WXYV0 (host109-146-187-185.range109-146.btcentralplus.com. [109.146.187.185]) by smtp.gmail.com with ESMTPSA id h2sm436496wme.45.2020.11.19.08.04.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2020 08:04:43 -0800 (PST) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kfmQP-0007Ph-BG for xen-devel@lists.xenproject.org; Thu, 19 Nov 2020 16:04:45 +0000 X-Inumbo-ID: d1cbf80b-d145-42c8-9268-81ee5ffa0c9a Received: from mail-wm1-x32b.google.com (unknown [2a00:1450:4864:20::32b]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d1cbf80b-d145-42c8-9268-81ee5ffa0c9a; Thu, 19 Nov 2020 16:04:44 +0000 (UTC) Received: by mail-wm1-x32b.google.com with SMTP id 10so7696591wml.2 for ; Thu, 19 Nov 2020 08:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:content-language :thread-index; bh=On7WtObYfJqkmBWHnyAjoLI3cKLxtSNPjmpL50xHFRI=; b=kauqrQB8AIZxEhk7ED7FpTkba7nnvpn22yiOG+FuxlbGs5Xill+1mzqnPLtUFRInGa gdQLnsXvSCKHv8p0qvZ4HrdNyv51EQN/GQQywYmWORxv2em0jjMhfJic4D33Xo7dP38a v2RKod8xRVTLzOkGeHu05uZ9jrmrxlxXS/m0cOkg8K/rtloF/IRBVIPbXJLFt1cO8kwB 0jK1vCR7kbJthfgixI/oV1r4E4QDNPo0NTr1Ynt/XUXOskFTIJnlqhTOns0BtDExGIOG lsbzAyVgkXdz+FLYXS3EhopTCD8BX/kanR0zFubQJ+JDgddfxG4bkkGnZPRLsNXkCS60 YWJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to :subject:date:message-id:mime-version:content-transfer-encoding :content-language:thread-index; bh=On7WtObYfJqkmBWHnyAjoLI3cKLxtSNPjmpL50xHFRI=; b=CTpR3W9AA4CqP3+rw6VMR9K0a35CWS+Q6B1ucHnX3uMHlPxFHv4+kDLFsSa/hndMe3 Dkj+lFwlzwUyM7cf3oVkOpdlLQH+b71E7OkBC9btQVgLEDkAa1LRkDIV82l0HWIeoK35 UeNx93W8QSD7j8dWllIcYvlrckau2FBA2MSScA4spLuzO3+/ch34njTsmN4HZxjhiLMu lR8mAx7p+h2as6F/lr3dOa2eynfnjU+Swn0HWeJX+Gq7PB26msVLAcx/50GnSwHQLe3d eGengBmxCtxYa0AGmU74tA5Z9o0l84WtYcPJAyOSp0ATlegj0UCm9DijSK/J/5IbNenK Wl7w== X-Gm-Message-State: AOAM530Sl0MmCjTx0TTqiKG1yFOHKLSpQBqEO0Dj2U88cv9THiWrGldL +Q9K1L3j8rNvGSuI0LRo964= X-Google-Smtp-Source: ABdhPJw6pLgZpb7nxKHqbHv0bFqQp2GJDXX10ie1Fge14RL1t+c7xcjbV32a+1pbg3EF/DE+wNZS9g== X-Received: by 2002:a1c:3d02:: with SMTP id k2mr5463382wma.183.1605801883717; Thu, 19 Nov 2020 08:04:43 -0800 (PST) Received: from CBGR90WXYV0 (host109-146-187-185.range109-146.btcentralplus.com. [109.146.187.185]) by smtp.gmail.com with ESMTPSA id h2sm436496wme.45.2020.11.19.08.04.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2020 08:04:43 -0800 (PST) From: Paul Durrant X-Google-Original-From: "Paul Durrant" Reply-To: To: "'Jan Beulich'" Cc: "'Paul Durrant'" , "'Wei Liu'" , "'Andrew Cooper'" , =?UTF-8?Q?'Roger_Pau_Monn=C3=A9'?= , References: <20201111200721.30551-1-paul@xen.org> <20201111200721.30551-5-paul@xen.org> <0e05cc16-c7b9-34a1-8862-a4e7d581189f@suse.com> In-Reply-To: <0e05cc16-c7b9-34a1-8862-a4e7d581189f@suse.com> Subject: RE: [PATCH 04/10] viridian: use hypercall_vpmask in hvcall_ipi() Date: Thu, 19 Nov 2020 16:04:42 -0000 Message-ID: <00ca01d6be8d$b17884a0$14698de0$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: AQIKCyTUSJ7jm2WJ2nMqsy5EhijKogGYy4h+AwWv/32pRBDUgA== > -----Original Message----- > From: Jan Beulich > Sent: 12 November 2020 08:50 > To: Paul Durrant > Cc: Paul Durrant ; Wei Liu ; Andrew = Cooper > ; Roger Pau Monn=C3=A9 = ; xen-devel@lists.xenproject.org > Subject: Re: [PATCH 04/10] viridian: use hypercall_vpmask in = hvcall_ipi() >=20 > On 11.11.2020 21:07, Paul Durrant wrote: > > --- a/xen/arch/x86/hvm/viridian/viridian.c > > +++ b/xen/arch/x86/hvm/viridian/viridian.c > > @@ -533,6 +533,21 @@ static bool vpmask_test(struct hypercall_vpmask = *vpmask, unsigned int vp) > > return test_bit(vp, vpmask->mask); > > } > > > > +static unsigned int vpmask_first(struct hypercall_vpmask *vpmask) > > +{ > > + return find_first_bit(vpmask->mask, HVM_MAX_VCPUS); > > +} > > + > > +static unsigned int vpmask_next(struct hypercall_vpmask *vpmask, = unsigned int vp) > > +{ > > + return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1); >=20 > Perhaps again assert on vp's range? >=20 Ok. > > +} > > + > > +#define for_each_vp(vpmask, vp) \ > > + for ((vp) =3D vpmask_first(vpmask); \ > > + (vp) < HVM_MAX_VCPUS; \ > > + (vp) =3D vpmask_next(vpmask, vp)) >=20 > Nit again: Missing blanks here and ... Oh yes. >=20 > > @@ -669,17 +693,20 @@ static int hvcall_ipi(union hypercall_input = *input, > > if ( vector < 0x10 || vector > 0xff ) > > return -EINVAL; > > > > - for_each_vcpu ( currd, v ) > > + vpmask_empty(vpmask); > > + for (vp =3D 0; vp < 64; vp++) >=20 > ... here. I also wonder if the literal 64 couldn't be expressed in > some suitable way. >=20 Ok. I'll see if I can suitably macrotize it. Paul > Jan