Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2329123rwb; Thu, 17 Nov 2022 09:19:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7URd/mxu4z5E/VOStfSepWnz2rWOOZYL/wUrQztdONuoVCgOr3zsD6kPVynjz0vs69I0OP X-Received: by 2002:a05:6402:48d:b0:461:c3d9:c6a3 with SMTP id k13-20020a056402048d00b00461c3d9c6a3mr3009293edv.154.1668705541062; Thu, 17 Nov 2022 09:19:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668705541; cv=none; d=google.com; s=arc-20160816; b=phxlwGIgixBkmbFkb20PDvmvri7valZPMwtqjyqDCoUqZVXPgMLaCcDKEfVPEitVKo 47h8S4AFI+bPk1P6U2iR23C8Llu6AXLqmnUrKat0Z5ttNJpOyNhV8/dladzW1gX13Ptn x1zJ8iWvQJSyW0snTtusWcQHiTQbEUUi2ahQdb851DlsiwA8x3gBcqDb0lxoWvXVGtYR N3WovwCiBbGrICj2kHKOZOqMrrp4U2qKuMzkR0nSyuBVW0He1VYxDPndSQjrwp7wBF1k VDb/wus2RRZiPVgsGfOVYjTWc70oMD15+w/yuK8VVpeXRpaafO8VTvqg8pAzGAS1rrAy l64Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=TCtKsbdbGCL0+efRLWW3g52mJNVL+7oDz6rW5IEN9zQ=; b=eOPhTYpaL38xZ641BwIxgEfiEyTU/3Pi5U+x190qAnWussq4QE/8d2h3KiGWnc8BuO H/milDeBg1gNPqMQxSp1U7qE3+VbX3rB386T/A6mGhKtEIbfm83iaK1e9Rjz+z8q3/33 0t+bLYNnpxx8dTL0Vuxv5wbd2yAHOWr8WG9OsXwcWklx7VkH7ePiQNi45Yz1Iz+tzWNa fiTpIMbtY6OYLfGXLvL0NJfQFHa+VeU8RgdMNDhbP+SF3hCE0xFL6NLEHQaqq4+kyz11 eGb8qnBAWyvq5/jUxCsMkXrgOxIV2BkrMcjVDWvDA9tGlW+BXhGTP3/3z2OpXh/pAwIX NYVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv11-20020a17090760cb00b0078de51e658esi1044129ejc.208.2022.11.17.09.18.37; Thu, 17 Nov 2022 09:19:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S240365AbiKQRCD (ORCPT + 92 others); Thu, 17 Nov 2022 12:02:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240452AbiKQRBe (ORCPT ); Thu, 17 Nov 2022 12:01:34 -0500 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BEFA76160; Thu, 17 Nov 2022 09:01:16 -0800 (PST) Received: by mail-wr1-f50.google.com with SMTP id y16so4829605wrt.12; Thu, 17 Nov 2022 09:01:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to: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=TCtKsbdbGCL0+efRLWW3g52mJNVL+7oDz6rW5IEN9zQ=; b=FVWcwWwIlSooynuz4s9nJ0yRdsAIXNlvau1VbDoEGl6z0ynrsuZdPrmvC7PFaNOOVE ftLVTJFxpEDHGFUK6peRxtUT9HXYjYNGDFdCf29HC7DM7o41Dpxe06aGa9ZlRkUsF+GV BknVoWh2hilFO5oDxUH6yaj1mDtROK4EZ5AgVbEOW2cj24u/3V2sMIBuLQU+EtNdzekH mrKaAenbTBgcsGBvDHX8RJFbNAltNxsVRQMjv1mEcq54M/DhCcxTTOu0xpsuE0NmsbAJ IuTC/8P8lAFhcwrcHPEkPqYUwVJyWjMqgfgCNrzCO38cyBLXJnpVEPQMal7bF0eQ4Z7O PnYA== X-Gm-Message-State: ANoB5pndIEjBoLtvnyb9t8f5NKFC/KBEWONktrwtt9kPu727Tc6Liepm FtZiv0WtswZzYwry/hn18pI= X-Received: by 2002:a05:6000:61a:b0:236:8a38:66f1 with SMTP id bn26-20020a056000061a00b002368a3866f1mr2043698wrb.327.1668704470746; Thu, 17 Nov 2022 09:01:10 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id r4-20020a05600c35c400b003c6b874a0dfsm2164698wmq.14.2022.11.17.09.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 09:01:10 -0800 (PST) Date: Thu, 17 Nov 2022 17:01:03 +0000 From: Wei Liu To: "Michael Kelley (LINUX)" Cc: Wei Liu , "hpa@zytor.com" , KY Srinivasan , Haiyang Zhang , Dexuan Cui , "luto@kernel.org" , "peterz@infradead.org" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "lpieralisi@kernel.org" , "robh@kernel.org" , "kw@linux.com" , "bhelgaas@google.com" , "arnd@arndb.de" , "hch@infradead.org" , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , "thomas.lendacky@amd.com" , "brijesh.singh@amd.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , Tianyu Lan , "kirill.shutemov@linux.intel.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "ak@linux.intel.com" , "isaku.yamahata@intel.com" , "Williams, Dan J" , "jane.chu@oracle.com" , "seanjc@google.com" , "tony.luck@intel.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-arch@vger.kernel.org" , "iommu@lists.linux.dev" Subject: Re: [Patch v3 13/14] PCI: hv: Add hypercalls to read/write MMIO space Message-ID: References: <1668624097-14884-1-git-send-email-mikelley@microsoft.com> <1668624097-14884-14-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 04:14:44PM +0000, Michael Kelley (LINUX) wrote: > From: Wei Liu Sent: Thursday, November 17, 2022 7:17 AM > > > > On Wed, Nov 16, 2022 at 10:41:36AM -0800, Michael Kelley wrote: > > [...] > > > > > > +static void hv_pci_read_mmio(struct device *dev, phys_addr_t gpa, int size, u32 > > *val) > > > +{ > > > + struct hv_mmio_read_input *in; > > > + struct hv_mmio_read_output *out; > > > + u64 ret; > > > + > > > + /* > > > + * Must be called with interrupts disabled so it is safe > > > + * to use the per-cpu input argument page. Use it for > > > + * both input and output. > > > + */ > > > > Perhaps adding something along this line? > > > > WARN_ON(!irqs_disabled()); > > > > I can fold this in if you agree. > > These two new functions are only called within this module from code > that already has interrupts disabled (as added in Patch 14 of the series), > so I didn't do the extra check. But I'm OK with adding it. These functions > make a hypercall, so the additional check doesn't have enough perf > impact to matter. Okay, not adding them is fine too. Thanks, Wei.