From patchwork Thu May 30 20:55:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1107922 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45FKc36BJcz9sB8; Fri, 31 May 2019 06:55:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hWS5Q-0007XD-Av; Thu, 30 May 2019 20:55:44 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hWS5O-0007Wo-If for kernel-team@lists.ubuntu.com; Thu, 30 May 2019 20:55:42 +0000 Received: from mail-qk1-f200.google.com ([209.85.222.200]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hWS5O-0003uo-5j for kernel-team@lists.ubuntu.com; Thu, 30 May 2019 20:55:42 +0000 Received: by mail-qk1-f200.google.com with SMTP id u128so6011677qka.2 for ; Thu, 30 May 2019 13:55:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dlhAvorvFMt7cYXsJhQcy7K4Wb3I7BlRZmkyODqiMJ8=; b=GgwvY6ubtupfKNFpydy2ZSyepV27R3EUIU8ivA3uuwvuSy1xLp+QGi810iHC3jigrl GhkEXXgpnkaaZvALcnLcwiglD9il2ijVKtZvgWLuIU1XgWXYVwL2fCCVaO9INCxTKnTJ qnnEWFRwOkNUc8/sN4NBy5rSGshVM/H6v0Z8Kvaq1QR+1RqLwspeMp/UpvZgHHWpznfG khW0/+XGa3J+De/jjyQdEtF8eUUPRVFs0mAnE6sDAuJ3IsqWh+7IrWBr9sXDrXv8kYRG c/lIL5l9HBnML6Ebo+tUwpY1SpnSpOe7l6J9UUYZRN9PZqgc9JUs8wAa04eYwEGBT8SW gAoQ== X-Gm-Message-State: APjAAAV6m55DZsAExcgYZWCWcaLNRUcRlPOtvwklkbKVDA2aU3Mg0Jhp 26ty6d5mTCn4+4RKYil8FqbubLxVkLqJ+5Zfd2Emcu8au0H49U0uFp9yzAOZUxWj5kG4j9GtKWR /Et5q+gC5t8EpoY1Auc9zQ1GxbSfjdXFBNNWLWozd X-Received: by 2002:ac8:eca:: with SMTP id w10mr901721qti.81.1559249740874; Thu, 30 May 2019 13:55:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMMHv7YpLi3FLkZ66O4K0lI4JdPW03W2CwxWE+/Y91GQs13UYUdPljAD+Wj40exHz7NFZdfA== X-Received: by 2002:ac8:eca:: with SMTP id w10mr901695qti.81.1559249740462; Thu, 30 May 2019 13:55:40 -0700 (PDT) Received: from gallifrey.lan ([2804:14c:4e3:4a76:e1a0:5724:a353:2a54]) by smtp.gmail.com with ESMTPSA id l94sm1902177qte.48.2019.05.30.13.55.38 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 30 May 2019 13:55:39 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [c/azure][PATCH 1/5] PCI: hv: Replace hv_vp_set with hv_vpset Date: Thu, 30 May 2019 17:55:30 -0300 Message-Id: <20190530205534.11825-2-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190530205534.11825-1-marcelo.cerri@canonical.com> References: <20190530205534.11825-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Maya Nakamura BugLink: http://bugs.launchpad.net/bugs/1826447 Remove a duplicate definition of VP set (hv_vp_set) and use the common definition (hv_vpset) that is used in other places. Change the order of the members in struct hv_pcibus_device so that the declaration of retarget_msi_interrupt_params is the last member. Struct hv_vpset, which contains a flexible array, is nested two levels deep in struct hv_pcibus_device via retarget_msi_interrupt_params. Add a comment that retarget_msi_interrupt_params should be the last member of struct hv_pcibus_device. Signed-off-by: Maya Nakamura Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley Reviewed-by: Vitaly Kuznetsov Tested-by: Vitaly Kuznetsov (cherry picked from commit 9bc1174280ddf7693e8c29a8f1743809e987ac37) Signed-off-by: Marcelo Henrique Cerri --- drivers/pci/controller/pci-hyperv.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index cf6ef9b1b3f3..94baa4a8852c 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -393,12 +393,6 @@ struct hv_interrupt_entry { #define HV_VP_SET_BANK_COUNT_MAX 5 /* current implementation limit */ -struct hv_vp_set { - u64 format; /* 0 (HvGenericSetSparse4k) */ - u64 valid_banks; - u64 masks[HV_VP_SET_BANK_COUNT_MAX]; -}; - /* * flags for hv_device_interrupt_target.flags */ @@ -410,7 +404,7 @@ struct hv_device_interrupt_target { u32 flags; union { u64 vp_mask; - struct hv_vp_set vp_set; + struct hv_vpset vp_set; }; }; @@ -460,12 +454,16 @@ struct hv_pcibus_device { struct msi_controller msi_chip; struct irq_domain *irq_domain; - /* hypercall arg, must not cross page boundary */ - struct retarget_msi_interrupt retarget_msi_interrupt_params; - spinlock_t retarget_msi_interrupt_lock; struct workqueue_struct *wq; + + /* hypercall arg, must not cross page boundary */ + struct retarget_msi_interrupt retarget_msi_interrupt_params; + + /* + * Don't put anything here: retarget_msi_interrupt_params must be last + */ }; /* @@ -955,12 +953,13 @@ static void hv_irq_unmask(struct irq_data *data) */ params->int_target.flags |= HV_DEVICE_INTERRUPT_TARGET_PROCESSOR_SET; - params->int_target.vp_set.valid_banks = + params->int_target.vp_set.valid_bank_mask = (1ull << HV_VP_SET_BANK_COUNT_MAX) - 1; /* * var-sized hypercall, var-size starts after vp_mask (thus - * vp_set.format does not count, but vp_set.valid_banks does). + * vp_set.format does not count, but vp_set.valid_bank_mask + * does). */ var_size = 1 + HV_VP_SET_BANK_COUNT_MAX; @@ -974,7 +973,7 @@ static void hv_irq_unmask(struct irq_data *data) goto exit_unlock; } - params->int_target.vp_set.masks[cpu_vmbus / 64] |= + params->int_target.vp_set.bank_contents[cpu_vmbus / 64] |= (1ULL << (cpu_vmbus & 63)); } } else {