From patchwork Thu Feb 18 10:07:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 8348241 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CF7D89F399 for ; Thu, 18 Feb 2016 10:10:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2FB7620320 for ; Thu, 18 Feb 2016 10:10:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81E75202FE for ; Thu, 18 Feb 2016 10:10:24 +0000 (UTC) Received: from localhost ([::1]:39415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWLXT-0001O4-Qr for patchwork-qemu-devel@patchwork.kernel.org; Thu, 18 Feb 2016 05:10:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWLVF-0006OE-0R for qemu-devel@nongnu.org; Thu, 18 Feb 2016 05:08:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWLVD-0001QX-Dx for qemu-devel@nongnu.org; Thu, 18 Feb 2016 05:08:04 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:38654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWLVD-0001QA-7A for qemu-devel@nongnu.org; Thu, 18 Feb 2016 05:08:03 -0500 Received: by mail-wm0-x22b.google.com with SMTP id a4so17406195wme.1 for ; Thu, 18 Feb 2016 02:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravellosystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qHtlNxISLuEeHyKJXNemzLcM7+YRa4x5kzPbs584c80=; b=R9jmdR4yfcYg7WX+KIGKZmzu4DzMT9WaYnuwXOyDF6iH0FErgtvo5YVfHpbz1RxMwx JBilhvs/EHbqC60Kbcto2wOStdotcaEPVndRmwXjXxuS6XVwtLgQFvBTi7Zd1EaeJK75 wCgvMtRXTGlQthUFOgGQSnuxrhHvBTxy4WCGIe3jU+mnSH1IJmu3J2d2tdRvUgOEDdF4 bwOvdLAM/+ym/Fe8iV/3UFvkFR/MUafE8a7H5dDow/DQyuiMMLBuQbnMCpmrwaT79Wwo Ge6JcArcemTaqgyncknfn9oN9sXyyI21u/iv/kVrYbaxiKi+WBT31PppqZ1WaodreI+/ a8Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qHtlNxISLuEeHyKJXNemzLcM7+YRa4x5kzPbs584c80=; b=k0vFNimnYjQcPSBlUqjWi2qCAcXmgBZdWXUbXjJSo+DTeNIzFKNsEUk9e1lIqX4Z/E GOUraGwM2Gcvo9vTfAQelOIVZHK2wVOETkltd15yA38J2AzSTUcUVYwnq7vF/+Mdba4h AU5t3joZqP6vnEfABlmfhAu//jYpCIGOdRFE6eMAczqHibFiuD/W5zML3UeYJwylYb3G JmDERM8R9tBHtodd6ZCRR09Nc2EreuMLQVT2+N3pb7+Gedm+ZvfxaJwQYIwCBck6JHtv GJsk6flfDMefrvHopAHWDzyZOS5LLBFHc3ws9+UBPWkzoJ/TW3amT84U2iutZHQEX71J 9zOg== X-Gm-Message-State: AG10YOQQojrRJI5rsejNcRQALkYAr5maplZxgfH+rXEnJLlAlgKrOuWy5eAdsdBwWXUzRSKZ X-Received: by 10.28.172.132 with SMTP id v126mr2507667wme.28.1455790082636; Thu, 18 Feb 2016 02:08:02 -0800 (PST) Received: from bark.daynix ([5.102.236.99]) by smtp.gmail.com with ESMTPSA id x65sm2214799wmg.4.2016.02.18.02.08.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 02:08:01 -0800 (PST) From: Leonid Bloch To: qemu-devel@nongnu.org Date: Thu, 18 Feb 2016 12:07:25 +0200 Message-Id: <1455790054-1952-5-git-send-email-leonid.bloch@ravellosystems.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455790054-1952-1-git-send-email-leonid.bloch@ravellosystems.com> References: <1455790054-1952-1-git-send-email-leonid.bloch@ravellosystems.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b Cc: Dmitry Fleytman , Jason Wang , Leonid Bloch , Shmulik Ladkani , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH 04/13] pcie: Introduce function for DSN capability creation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Fleytman Signed-off-by: Dmitry Fleytman Signed-off-by: Leonid Bloch --- hw/pci/pcie.c | 7 +++++++ include/hw/pci/pcie.h | 1 + include/hw/pci/pcie_regs.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index be3a318..f7ac7d4 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -690,3 +690,10 @@ void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn) offset, PCI_ARI_SIZEOF); pci_set_long(dev->config + offset + PCI_ARI_CAP, (nextfn & 0xff) << 8); } + +void pcie_dsn_init(PCIDevice *dev, uint16_t offset, uint64_t val) +{ + pcie_add_capability(dev, PCI_EXT_CAP_ID_DSN, PCI_DSN_VER, + offset, PCI_EXT_CAP_DSN_SIZEOF); + pci_set_quad(dev->config + offset + PCI_DSN_CAP, val); +} diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index cbbf0c5..83a325c 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -119,6 +119,7 @@ void pcie_add_capability(PCIDevice *dev, uint16_t offset, uint16_t size); void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn); +void pcie_dsn_init(PCIDevice *dev, uint16_t offset, uint64_t val); extern const VMStateDescription vmstate_pcie_device; diff --git a/include/hw/pci/pcie_regs.h b/include/hw/pci/pcie_regs.h index a95522a..a891a45 100644 --- a/include/hw/pci/pcie_regs.h +++ b/include/hw/pci/pcie_regs.h @@ -79,6 +79,10 @@ #define PCI_ARI_VER 1 #define PCI_ARI_SIZEOF 8 +/* DSN */ +#define PCI_DSN_VER 1 +#define PCI_DSN_CAP 0x04 + /* AER */ #define PCI_ERR_VER 2 #define PCI_ERR_SIZEOF 0x48