Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6276402rwl; Tue, 4 Apr 2023 10:06:07 -0700 (PDT) X-Google-Smtp-Source: AKy350b38lCN/cLDXAkZijRl9eCXafjNUJeo5k1me/BNbKiL1+GGqGM4T4WooYl4LDwioY6I7K+c X-Received: by 2002:a17:902:f90d:b0:1a1:ca37:5257 with SMTP id kw13-20020a170902f90d00b001a1ca375257mr3113845plb.7.1680627966874; Tue, 04 Apr 2023 10:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680627966; cv=none; d=google.com; s=arc-20160816; b=fGSTbMwpj1Fm8pwLrh26xN2Of6B4Vf5QvPRrYeeHyW1cIrKhBx9bLh7sInbdjcrcoa ff0u/SwGuY9KY3YY2FTafuB9o0lsYfP9bTIiCoXZviFeQA2AbNTO7OqnAtU10NxMikGb 8xSkbsqrP6ulsXmSvzT+jgy0uEMsxYfVj8rN4oyBCDCSN21VUD5YAN/pwSLOgMB8ADBI irEV1rOWxf8a7ewmEryBkX3AfCgOXvKEm4WD/LetVHICUThz9WEKksDgfa0zVmhO787o DUYkCziyko2sBKOeWR8gAj0e6BwwaimvaeaJa+mxw7NUpAlGIRSZSGB5Fo/j5v2mJIaA R1Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=eekB3bYoQqC3IJ2D872oRGGQeEcgPYH1G+tXq6FWN2A=; b=L9ypxFeTogIhT6nkEI3ER5S0usKWaIBQkWiKem+c+6oi7vPRCOndu5Zc2jjSMxYBP/ AxKUGH3qhnf35rG0DShlsVsrcRkUNjMjxZ/wQTQzQtCTEodpKlgtAx1FQ+eX94JtCCT/ nQLX7J6fiA6b4plrnenJkaZ66Fz4KgPz0KxHWY1joXXQJZCcGzCHT+ZkEZLxJM4x4jBE dnK95am5dWAIKWFy3XclLJPEraRnltNXvJyko0F4J1Sz3vvF/UxZaSDjOdS90V1kUH8h DINMwWIRDm18W6duQbaRnR17TRJgrctPsy7PyY+r9jIZB7DJEmt6VYXFIG64jFmfms9r VwsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=YiOICRBk; 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=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a1709026b4c00b0019b521f4b07si10342515plt.52.2023.04.04.10.05.46; Tue, 04 Apr 2023 10:06:06 -0700 (PDT) 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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=YiOICRBk; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235197AbjDDRAV (ORCPT + 99 others); Tue, 4 Apr 2023 13:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235713AbjDDRAR (ORCPT ); Tue, 4 Apr 2023 13:00:17 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 82602D1; Tue, 4 Apr 2023 10:00:16 -0700 (PDT) Received: from [192.168.0.5] (unknown [71.212.161.12]) by linux.microsoft.com (Postfix) with ESMTPSA id D7FD0210DD99; Tue, 4 Apr 2023 10:00:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D7FD0210DD99 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680627616; bh=eekB3bYoQqC3IJ2D872oRGGQeEcgPYH1G+tXq6FWN2A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=YiOICRBkseLaRSK7TUNqQ3yPBKOdljXbZ7yV6NAxoxVfjIQCj+2tXmsKJfwu3IdVm 1t9Wrg4ZUWgjCSBOwaYFCgWNCg/8PIs+KLf6LzqKOEftMR1tXfA6Cmrz15ZiTYO+bQ vtH5IFH06p9aMbbPlxhyxxeVNbTTLbPZ0LkBVVmI= Message-ID: <2543a6aa-adc0-b471-6281-38130b4d6a08@linux.microsoft.com> Date: Tue, 4 Apr 2023 10:00:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] PCI: hv: Use nested hypercall for retargeting interrupts Content-Language: en-US To: Jinank Jain , jinankjain@microsoft.com, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com Cc: linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230404113546.856813-1-jinankjain@linux.microsoft.com> From: Nuno Das Neves In-Reply-To: <20230404113546.856813-1-jinankjain@linux.microsoft.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-19.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Reviewed-by: Nuno Das Neves On 4/4/2023 4:35 AM, Jinank Jain wrote: > In case of nested MSHV, retargeting interrupt hypercall should be sent > to L0 hypervisor instead of L1 hypervisor. > > Signed-off-by: Jinank Jain > --- > drivers/pci/controller/pci-hyperv.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c > index f33370b75628..2123f632ecf7 100644 > --- a/drivers/pci/controller/pci-hyperv.c > +++ b/drivers/pci/controller/pci-hyperv.c > @@ -704,8 +704,14 @@ static void hv_arch_irq_unmask(struct irq_data *data) > } > } > > - res = hv_do_hypercall(HVCALL_RETARGET_INTERRUPT | (var_size << 17), > - params, NULL); > + if (hv_nested) > + res = hv_do_nested_hypercall(HVCALL_RETARGET_INTERRUPT | > + (var_size << 17), > + params, NULL); > + else > + res = hv_do_hypercall(HVCALL_RETARGET_INTERRUPT | > + (var_size << 17), > + params, NULL); > > exit_unlock: > spin_unlock_irqrestore(&hbus->retarget_msi_interrupt_lock, flags);