Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1954026ybi; Thu, 18 Jul 2019 00:59:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVINqy3fKYvOxGNJgjz+kvrqvLLWRGqmDSMaeYaS8Vt/PVjqPHRUwX+2sEqUuuXTKeFSP8 X-Received: by 2002:a63:4e58:: with SMTP id o24mr45376818pgl.366.1563436765849; Thu, 18 Jul 2019 00:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563436765; cv=none; d=google.com; s=arc-20160816; b=e/bFkLNEkvhTPi+yPVejmX4vynwGkLxvtVwUdMjjJfrlRy2LuiiL6u/PSMmldA4OPU RGz85qSt5QC8Cck9ngfb4j/uOAE1YmCYtPm5J1MiCRTb+BD+4vIT8kgyD/iMBGru1qyg A60fLRXgWXHuslPmttL/B1HkM75wJfPPDpEoBSZQkmIJ+ie9Bie5vr9MV5Cx3nbpt7t4 e7J9QzbZ6Q3QsR9YzaxBbtRkpUOsDhSNEpmIExxiH5KfCEaUI6XK0c7DZWPZLyxviABf Goh88Pt2CrKblZ9CAp61xDg7vd4WnJ8zqXCihZkXawRhKa0BRuM/6OvpVym0CFfPF9vi 6rgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=hosDLmncHf2v/zioECvbk2ujDvP2wzVOzeyixhcoU5o=; b=r7lQwHOJMsReA58E5neDbEvRuzWCnKmE4iJrccQhcsYRb8tE75cfuqRkfxb8hdImhe bxvUup1MPylfepdjELVSEFa9Zpcp9Ge+fZX84Jj81y9s3H7SWm/BaJpkVhNHMVQf36k9 c+iVTxLiUZ+inygupUf0krS7x/4EPYxCp4djAbXc3Wax8k3Km0F/2fAMvohYqwyqAsK3 4kLca4wyUtU8sXzzTElfGvaDdFYgHo23olgMndk+XiI04+2rWdOS2zeL9K0wANhVKgHY SHbXw8x8tLK3/2ZTak2j5SFK7bY/k3jvq6PubLULa71AYvyqfy/Hig0O82H9JIU8ufXM JuBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21si1251060pgv.266.2019.07.18.00.59.10; Thu, 18 Jul 2019 00:59:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389357AbfGRH5b (ORCPT + 99 others); Thu, 18 Jul 2019 03:57:31 -0400 Received: from mga12.intel.com ([192.55.52.136]:15259 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbfGRH5a (ORCPT ); Thu, 18 Jul 2019 03:57:30 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jul 2019 00:57:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,276,1559545200"; d="scan'208";a="158713064" Received: from gvt-optiplex-7060.bj.intel.com ([10.238.158.89]) by orsmga007.jf.intel.com with ESMTP; 18 Jul 2019 00:57:27 -0700 From: Kechen Lu To: intel-gvt-dev@lists.freedesktop.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tina Zhang , kraxel@redhat.com, zhenyuw@linux.intel.com, zhiyuan.lv@intel.com, zhi.a.wang@intel.com, kevin.tian@intel.com, hang.yuan@intel.com, alex.williamson@redhat.com, Eric Auger Subject: [RFC PATCH v4 1/6] vfio: Define device specific irq type capability Date: Thu, 18 Jul 2019 23:56:35 +0800 Message-Id: <20190718155640.25928-2-kechen.lu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190718155640.25928-1-kechen.lu@intel.com> References: <20190718155640.25928-1-kechen.lu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tina Zhang Cap the number of irqs with fixed indexes and use capability chains to chain device specific irqs. Signed-off-by: Tina Zhang Signed-off-by: Eric Auger --- include/uapi/linux/vfio.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 8f10748dac79..be6adab4f759 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h @@ -448,11 +448,27 @@ struct vfio_irq_info { #define VFIO_IRQ_INFO_MASKABLE (1 << 1) #define VFIO_IRQ_INFO_AUTOMASKED (1 << 2) #define VFIO_IRQ_INFO_NORESIZE (1 << 3) +#define VFIO_IRQ_INFO_FLAG_CAPS (1 << 4) /* Info supports caps */ __u32 index; /* IRQ index */ __u32 count; /* Number of IRQs within this index */ + __u32 cap_offset; /* Offset within info struct of first cap */ }; #define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9) +/* + * The irq type capability allows irqs unique to a specific device or + * class of devices to be exposed. + * + * The structures below define version 1 of this capability. + */ +#define VFIO_IRQ_INFO_CAP_TYPE 3 + +struct vfio_irq_info_cap_type { + struct vfio_info_cap_header header; + __u32 type; /* global per bus driver */ + __u32 subtype; /* type specific */ +}; + /** * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set) * @@ -554,7 +570,8 @@ enum { VFIO_PCI_MSIX_IRQ_INDEX, VFIO_PCI_ERR_IRQ_INDEX, VFIO_PCI_REQ_IRQ_INDEX, - VFIO_PCI_NUM_IRQS + VFIO_PCI_NUM_IRQS = 5 /* Fixed user ABI, IRQ indexes >=5 use */ + /* device specific cap to define content */ }; /* -- 2.17.1