From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A44058BE0 for ; Thu, 17 Nov 2022 17:01:12 +0000 (UTC) Received: by mail-wr1-f54.google.com with SMTP id j15so4311554wrq.3 for ; Thu, 17 Nov 2022 09:01:12 -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=VEuio2vnBKB4TFUbExZ17Exk1+iWTaVQevLqWHZx0rhOMHCev0KZePupb4EKIAuxi2 ZlVzJWEzyJqZgVBBhbtn5Tu919V7b8eVXZ42QXP7KWAB8gNgEL2Yv31cMZv2wmqxo4V4 QAO1hUeHfmHfpp+KM7nl9QGpTFqimC3LlQRxh3FvOP1bobmWTg6QYiD90jKf26RttU3P iuF2iYrXcA1GKdn3O99ZUKFjlSwKdeck0HzY7yVqP41m9l8RBqRMO+MtaSn7DCRWpq7h RZIMOjzMqV1hu8H73722EYoS6j6rlsUjSOVDjrctCfOi6xrO+X2GTwa4hWNfl/UsUKOV mfkA== X-Gm-Message-State: ANoB5pkcn8yl1ILSxp7mCX/kcFcxQseCCYI4PxAPXsrIXKtd13mznHSe id9KurJCA7ncEMqvOQctusk= X-Google-Smtp-Source: AA0mqf7E6EBcNgl7/0rKpmjSNjeqcv15ZypUN6Bh7EtNRf6vRUVAjnCbO/f4FevAbKhhgNYSiA+ZCw== 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> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.