Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2985635ybt; Mon, 29 Jun 2020 12:09:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLCipbqh1xWeJ+G16YTg2HOn41bTblctmJp6szn6KeofLW7KUfKDHxr0yFxDhZJonDCWNd X-Received: by 2002:aa7:da4c:: with SMTP id w12mr7563286eds.122.1593457758460; Mon, 29 Jun 2020 12:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593457758; cv=none; d=google.com; s=arc-20160816; b=durYJR6hfuofKSaiyDvmFxZIt4dRU8e+HciS7uMOItvDMMIxbaJVcF53b2G7rpuKn7 pBfYb0EsCeqWkOfGjB0yGU0p95aYQx9U6EA5cihuQGGY8Oum9zXQLDDQ7eV9NDx+L6l/ mgXEbEyMxayxrL77rTu+2SMSj2THOF6AWUT5o+ttEkqojUJFgPPruvtzinHu8cIE3SQS lKZArkCy4BJH/ADvrVYnwIhDYuMEefeS6gdwEPsdnScHQQ/Dck8APKEQNvwYOa8T8HwW EjMMn3svQ0kt6quEY9G2ylJH/BQuJB51UkP16YICGl5D5kiClylZDw/k3hlySieaZfmz 7WhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9kB1Yqxehc4mOOV+E+s8ly+87mL5I0qDl2+46tT33LU=; b=NsSCkUdnRdH1HAaduZp7c/gq52ls9/Hq3NBEo+NpcCAk+bHUubO3/VII99S5RI8OR/ 21T4Re+YX1rRnbBc+TBaQLRL3jL4QbhOpITPWnCYdHvGTyAtNovUj9w/xHqWA+ewJBt5 YRCdwxsngkI/XzER8ug7O3FUottCzkQRXc2E7GXxRJic2Q4Jb6WjnSsMqWwjhq3TOooC XVzxIz7ii0reneardz1gz7hCEHacnPlht4K9HZCmjgL6yZKyfJTaj0WDUMZOXBpRLe2o QEz5H064xA/Rjo7AIHEQjy1OKERx4aeiooHP3GWAYBOByYkwWrQwNqDleAteFgzBC7Gx OLKw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si234418edp.138.2020.06.29.12.08.54; Mon, 29 Jun 2020 12:09:18 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730806AbgF2TGu (ORCPT + 99 others); Mon, 29 Jun 2020 15:06:50 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39070 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728941AbgF2TGs (ORCPT ); Mon, 29 Jun 2020 15:06:48 -0400 Received: by mail-wr1-f68.google.com with SMTP id q5so17657430wru.6; Mon, 29 Jun 2020 12:06:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9kB1Yqxehc4mOOV+E+s8ly+87mL5I0qDl2+46tT33LU=; b=FEd80YYsVCJ6pf74frJNQnajWBRVFV0QMHP/qy3W0W9HXQvypW8nvMlgqUbUnomnHi O8YsWoOkY/0gsW1wuFENzG/2p0MVio6drckkCAWQhUX6YDslI8N05qYfTEXdmhP050ez bhhL/WcbK3Get7wdtSpsPanlCdnMclxEMNQpfZM5K1TVukzTINfUA72OwM6DkmfPxH9t /nSv3f411beyEx6DfQgAOSHjXwM11BzG+OadcwuOj4GrnqcsG3ZF6B8VfA3RAP+dKogT E1J4xLWzGLTYfhBLP5IHDZsHCJwR02k3Inzl4qa08HVYqt+obUA97UjS6qAGnkjPz7dV 9u+w== X-Gm-Message-State: AOAM532gqGscXvj6dC9M5WbWWjQSodQTDCt6C2jhKsLmH65iLW6oWn1k /XtV0uL03teTbKbOIBhaR8A= X-Received: by 2002:adf:de12:: with SMTP id b18mr19710508wrm.390.1593457606425; Mon, 29 Jun 2020 12:06:46 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id e17sm728179wrr.88.2020.06.29.12.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 12:06:45 -0700 (PDT) Date: Mon, 29 Jun 2020 19:06:44 +0000 From: Wei Liu To: Andres Beltran Cc: Wei Liu , Andres Beltran , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Michael Kelley , "parri.andrea@gmail.com" Subject: Re: [PATCH 1/3] Drivers: hv: vmbus: Add vmbus_requestor data structure for VMBus hardening Message-ID: <20200629190644.hlem6jskyx26csaj@liuwe-devbox-debian-v2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 06:19:46PM +0000, Andres Beltran wrote: [...] > > > EXPORT_SYMBOL_GPL(vmbus_recvpacket_raw); > > > + > > > +/* > > > + * vmbus_next_request_id - Returns a new request id. It is also > > > + * the index at which the guest memory address is stored. > > > + * Uses a spin lock to avoid race conditions. > > > + * @rqstor: Pointer to the requestor struct > > > + * @rqst_add: Guest memory address to be stored in the array > > > + */ > > > +u64 vmbus_next_request_id(struct vmbus_requestor *rqstor, u64 rqst_addr) > > > +{ > > > + unsigned long flags; > > > + u64 current_id; > > > + > > > + spin_lock_irqsave(&rqstor->req_lock, flags); > > > > Do you really need the irqsave variant here? I.e. is there really a > > chance this code is reachable from an interrupt handler? > > Other VMBus drivers will also need to use this functionality, and > some of them will be called with interrupts disabled. So, I think > we should keep the irqsave variant here. > Okay. This makes sense. Wei.