From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B254AC4167B for ; Thu, 17 Nov 2022 17:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240311AbiKQRB5 (ORCPT ); Thu, 17 Nov 2022 12:01:57 -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-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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-pci@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.