From patchwork Mon Jul 25 09:32:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 72696 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1048695qga; Mon, 25 Jul 2016 02:35:16 -0700 (PDT) X-Received: by 10.98.0.83 with SMTP id 80mr493784pfa.78.1469439316691; Mon, 25 Jul 2016 02:35:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y186si32782716pfb.59.2016.07.25.02.35.16; Mon, 25 Jul 2016 02:35:16 -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; dkim=pass header.i=@amdcloud.onmicrosoft.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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753184AbcGYJfM (ORCPT + 29 others); Mon, 25 Jul 2016 05:35:12 -0400 Received: from mail-sn1nam01on0076.outbound.protection.outlook.com ([104.47.32.76]:16256 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752708AbcGYJdo (ORCPT ); Mon, 25 Jul 2016 05:33:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NNSLZroV7F6mPlyQlm5nZc5rmjMKV8CtEOYY8z8ks3w=; b=1HAxegkcE0l/OeGgYxi/UkpbcJmCiJHhsAXIgQFu5XkTrNKLZXpqJLZYx6diaj5vDum7JiSDZyWsyIMd++zycVagfU5n/b4VsgINOrXFmY2vIqINxTUosNlA/hN5Qwdnp0MEHJW2mBhnnmQ3PGpOghs5i40jf5dShPi0kFq9aEs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; Received: from localhost.localdomain (114.109.128.54) by BLUPR12MB0434.namprd12.prod.outlook.com (10.162.92.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 25 Jul 2016 09:33:12 +0000 From: Suravee Suthikulpanit To: , , , CC: , , , Suravee Suthikulpanit , Suravee Suthikulpanit Subject: [PART2 PATCH v5 09/12] iommu/amd: Enable vAPIC interrupt remapping mode by default Date: Mon, 25 Jul 2016 04:32:08 -0500 Message-ID: <1469439131-11308-10-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469439131-11308-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1469439131-11308-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [114.109.128.54] X-ClientProxiedBy: SG2PR06CA0066.apcprd06.prod.outlook.com (10.167.73.162) To BLUPR12MB0434.namprd12.prod.outlook.com (10.162.92.14) X-MS-Office365-Filtering-Correlation-Id: ee81601b-3afd-455b-1ae7-08d3b46eb749 X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 2:Cz+cFzQ3Czp8VTkganYN9WjxTJzl+Zm9MFbWMx6Zh/ziv3dO23a0iZ8zldIi9UxQo6+O4dAtVCBoHHTW6i/cwx/V7+ZSS9MkQhaFuXxfCk/B03miekJhULIvvfKV2iNE8idcih7W//ld9f33cKW39I7TIcwFe2++4OPw/osVHlgHRONdOFA0oko5xhyU6R4e; 3:AVv5qAnonhmDu/3zHGwSGvbTgLb/vcHmt4JCp5xby7SJUc7IbiXR0Npg/QZLj3HDWmzZvtdR3HUlK9IgQ2G0S2xydom9L83beZ4SW1tJTHiYBmIgJIteilQ65fSMH0/+ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0434; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 25:scD3WkriqWgs6BX1lAEowh3CjFVH1y7IxajxSAtfnuFBo4DIK3FbgyxRndkgLK7gz9IAyKqIIIHVGWVDoyB+d2VrG19IkcYguTBR46XVeDToopyWkiYpZjMxbjjuc9k/UdYwyQgC3hSCy437ZjmLCql9Qnj+lBAeGSFVja63Szlq1neMdIsN77dvch45MWOZD+mQKg1SVT1b7jUIIPpn3lO/3x2C9H8aO3JnAZrBAJ4ECIZCFR2J+GTBpeg4Q26hT8JJFwBt2OecR0YOn2TYMr6tLJc+WkYKzixJZkFpMBIwfCH2Sc1M6G+/kYag7lp+Rfgw7sQ/37eiGr9DdkBwM/6afzw01OMoUisi/w+m7ZBWrwi9UWu5seCYHnQ3NOor8uvKkH0WjkR0DahwOxObv97cMVXNyrMMk9CE/kAEj64NXOHZcwHaO1T5hWFpHvYDTtVMWBbFshmP6KOTxYu/Ya02iTdvfm6r2m8dfUElW+xcdRaGeOqzcmq+1/huUv8rZMHHJid7Ova3pEw2qD+ZzugkZ9do8Z7mBjKk26Vrq9ItnhI5UJIZggtIkzgDqkl9uq9TjxF3xH/P8c8hoSFMHT8KBPbf0n95biGWO+els4PKeMy2lvoseHaPhNzncpgwb+VgBSpXCY/vWK7N7qYLseUODRUEPcHUk3X1fc/BWzUon0JnWIWmhexd/ih+VwkOJPGYmlEpwCPDy4MIs5y+E/DCLE4jFD2b68MzDDNefKfut24STfX/b86lykF3rzYbDf/phyMRwD5dNx8AtCoiFQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 31:HCxCh3VdYpu+8XwtiD0XHeBcPo9pFKTU7Zl2FLs27fxkXvCIsGj1EIfCRXU7AOL8u8z/tuYBzL7H/T8wAB53YVsjyBtWLoFxlvIVUA8DxKvej8ZaWUffYkG+1AP7jJAZaU5vxFUlSqGjgotqRYB+NJ+egjDEktUspQ37WwHlw4MHRKqwVgNi5LBl4W9Y4fMte5D6roHjSgPMiwhJXg/mhA==; 20:Z+wJooAlTJ2S9VoUWx/g9x1+H8HCs2N+ZZWAMTO608aKOABwrLnpHgeuJtNSvgNc9ENkE4YVoAFKJ2UFFqVm6PrIX/5Z1vWIBRiD1OhGeSZYdErNdN8nDv8FR7DyoiUI6OWGg17S7yAsV+LhUlYXygqueBiccjQhrrlwiDQvZ1pK3Og37ElZlwoFhzwsSk+q5BqRg/OpEY7WUrMzgXYdWQiNN3n/m3THISC8zdsNYWSj+hSIFfg5F41g8kU5EyeZOGCMwzTTLMu8OwCsn3ykfPlt9RYXviFrd76t552EGX9O5ojBL/mTp4UCCaXoW+bOYFyh3OXDON+iEr2EE2x54eHPjpYq+ajB1lucyJIGM2/mjfcb4wN0IlrLoxgwbsXh6zIoUirTmKGiPp6kekTcSZsSmNznMnz5foVmNu/w932jy2IFK/T/g3fOpTr6KCul2kM4Ay5iQefRpngINTIdloVL3kDPpRJITcKwhHVwLBy7q6RLzLcN4DpO0+BXLlGx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BLUPR12MB0434; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0434; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 4:DeGEHjvElbg9bep/r0sFoWgFcnT3PEhU7Cjp0jttGopiMRunJBqkdc5SnichpdBODq0whpHksfkMZYyGVhMa3j0KKKkTw9MEFkb64m2jnKMtHUDrCdmVKuDVr82LLWJZuAt/0FZT2lNgyBsm/4xDUPxjsWWWwtDhFIqxvsXrV93lA5yC6Quol59hrTeLWZN9sGetY2qQASSSrkC9Plym0jHVbohGm0qHjEYQtfaDZfECypF649eAVqaWF6D+yQqu2LVzeQPBZDZNGwfgMkbJcKapyPcJ2NvSTjSTp6URu6JChWUX4dtXPdhj0nLWlVgU3Yi47UTPrWy7Gfoz0Smcc6IAMBFxJIRxCHx5N/Vy23J93nNllzp+cK2E4NmnL4W3hT1FdTfejtiOvW8kARv2dcL0gJSxtJJuWCMx030Z1CPkIB8eXN3NuXnf8ocUIylH X-Forefront-PRVS: 0014E2CF50 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(77096005)(229853001)(50986999)(76176999)(586003)(48376002)(105586002)(19580405001)(81156014)(81166006)(8676002)(97736004)(4326007)(42186005)(5001770100001)(189998001)(2906002)(50226002)(19580395003)(50466002)(7846002)(66066001)(5003940100001)(68736007)(92566002)(86362001)(575784001)(101416001)(7736002)(305945005)(3846002)(6116002)(2950100001)(106356001)(47776003)(36756003)(5890100001)(33646002)(2201001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0434; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0434; 23:TB/6Qdt3Cqa4G9EGy4T4ILDPLJwFEv26wfgMhHFAT?= =?us-ascii?Q?UNn/WMvfpycXEEvDglEwiRxSzDQ0zo0Iy1GkofqvVzVdOsCA/rXAo+LDtvs+?= =?us-ascii?Q?Ykuei1UwbhWJxsSZKglxkHDiHvUuOg8xzd9aQmjJ1MldiKbpUXrmBPQIddEz?= =?us-ascii?Q?d7KhfIt+phMMm5NkPdOowSmmZlZbxeFoA6Ku9p2FwyJgpwW6zcuZVY0qmem9?= =?us-ascii?Q?TesM4zzUywoAotJF+uaiuZyhHz4sghYD9yXVh6ZGjRFIVKhIz28PBp4FERWy?= =?us-ascii?Q?BbqVzaXkk3Uo102s3ObaCCDZQrcbsC3xoiWJyU5hNcUkcqI9FzKmC2pWuuX7?= =?us-ascii?Q?mkD/DGWrM2SddRZWt/LrR/p5CcBamSszv6SCYdaJUMi5JvoA7nC5NMPdoBlB?= =?us-ascii?Q?FoeT1jax25GtoV1W5YkYxp7gXl70rr/Qbo3eZEQbNSo4ijnkknbYFuFM3fbs?= =?us-ascii?Q?spRBEuL2OvnPqXtuOZ1rlLHzsC9H90dhNMDkJQABjpNZGGmSXkvviJ9coPZN?= =?us-ascii?Q?t6uem8MLVpEg769FSZNTVnT7rqZ+BudGI3dS0dgFE3+oyiKodbGuKnnn368d?= =?us-ascii?Q?vyBicxDI+f84lpV8+FOkq+jctHawAJWn+tIngVnspATdPRlQWOIkPw9z+W/O?= =?us-ascii?Q?4kFPnd0DqZ7lfuYupuQwQMlr9+G5Oj7PPInEyMmgKuRVAKIrdq5rGEXpQtzO?= =?us-ascii?Q?FXxbmpigrf4kjgCpw/SbU4SmDppZnNEe8HtlLvqHx+JAnvqc92C80OihCRdo?= =?us-ascii?Q?EyacnvQKp3hsZPuE0HkN8XZAYy1erUk3lZhHdVaqiZ7a26Tq02JIXSZpTx3X?= =?us-ascii?Q?nBW80oGWhf1O/kSHPmbKrY5hVOqSOk8ltPAuhrFEvbRzuNGxFdjly02MN8cJ?= =?us-ascii?Q?PWexOxm9WVSxnmHntRE/qQKfSdcb5Lglue3ctdtnr89P21XklS2aaLxSIoYY?= =?us-ascii?Q?U+bpNDD/UDrHLioOG6zCTq5e07HlPlJ6j511kH5xVa8zMUfWZunvnsd8AZqu?= =?us-ascii?Q?vo3mWF2KbhaPXv2EeiE0mOqw4vtGt6CoCJGSuP8PcvZbE8yozJJXzXd4FKHN?= =?us-ascii?Q?LHXeyfY3tjvLu+KK9AuY58QfzM4+Hz6F22iKXZ9ujoBMWEP6uiagAldz/595?= =?us-ascii?Q?8C4Nm599Hw+Y9LwEoikDTK01a3qAAk4?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 6:qyKoaOdGF8I5wQAwf8Hhjo5ptr9ESmePeZW4+Y80dKbH9tjuiRTOgt3QXXtfJuMQdHuxnhsSRZa/hmThR3sMok2BcUkNLw6oU88fC46k4dfjjdEtHQgzxFgXP4Nyijsl2kRfHTSKx0wfBusDj3pWEOOEabxS3sCwJWRBAbj9OZ+wUEs9BPjhxvxoDJYP+awU6Kt6qUfuBDru5NhPeNqRMyo7jJFRnNFm7a8FqWsOFP7RScRT7+l4PeIhW2NVIPg7s1cFeM7XDr6BhpeFXyx/qe0G+jBMpM6XJXkwBiNg8EYkz1UqSwX+C4KHHB1hSLgQqQ8GHLC1MdYg7UShAMrqhA==; 5:RQjV6phbV/3GET0RMdEh+xpI3a10ZLsr4QsR6zzF7yC6SNqdZMah8G5zoMsC2L4Nrzwdqver5IC9EPDn8Gcq6iwlloe13bgV/RxYO21bIMunj3XkJiq7reCcCgCp8CoJO/9dOWztMZq2L+r1lBr6ZQ==; 24:mt0XEqjq0JZSIp8/zANu5nLy/i8U2pYZFNeIzmXiVfUbFGfg1wPhjbpffd3ajwiP2zoNhrHVGn8wNkJpPCNTN5P1GuMwx46fPx7jqKz/gDw=; 7:1nB/NhA1r3BCpGinrvc4CYkZpjAwxTqZQ0qq7lZx2M8pORTBve/f+beUD6FFJI0xQa1RkyErirqYuVj4j9lIEk/6Sty3OiJiyHWq/u9H/GwBvp9kLJgI3fe5KCHHuMjCFettJzAEZWJvbZ++JzICDbUDJbVf7EvLbnz6JYHutL7+SETnP3vWqV97G2oJndLX2h58NDBSiab3EChzC83ZU8+sg0rzdylzUKna42NmamC/YFaF8EGciu+ItZsFp1Ds SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 20:uJq3iF1LNwVYguFuTBT8zexnPzZ8TcISGHYojs1wHWGSZOm0g3+dkvP0+ffndCTzKWXuDb7ihsP+BoExnPxB4+/Ck2dRAXPunWrVpo5JyvPZLAmLWEgVY2TBwx41NbjdobReE9SNxcF4KkzFqQTf2zzilbVTuZ/U5qslYlthNoZpXJx3I95HaCuN20a0tyE/cm3Kp1FWbeLH+yBkhChjpjBr61DQJ1YJaw2F6mZuh4AboQc9ONj3EXmHWYbxGcIK X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2016 09:33:12.2499 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0434 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suravee Suthikulpanit Introduce struct iommu_dev_data.use_vapic flag, which IOMMU driver uses to determine if it should enable vAPIC support, by setting the ga_mode bit in the device's interrupt remapping table entry. Currently, it is enabled for all pass-through device if vAPIC mode is enabled. Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd_iommu.c | 44 +++++++++++++++++++++++++++++++++-------- drivers/iommu/amd_iommu_init.c | 12 ++++++++++- drivers/iommu/amd_iommu_types.h | 2 +- 3 files changed, 48 insertions(+), 10 deletions(-) -- 1.9.1 diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index a044ce4..155b4a6 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -105,6 +105,7 @@ struct iommu_dev_data { bool pri_tlp; /* PASID TLB required for PPR completions */ u32 errata; /* Bitmap for errata to apply */ + u32 use_vapic; /* Enable device to use vapic mode */ }; /* @@ -3215,6 +3216,12 @@ static void amd_iommu_detach_device(struct iommu_domain *dom, if (!iommu) return; +#ifdef CONFIG_IRQ_REMAP + if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) && + (dom->type == IOMMU_DOMAIN_UNMANAGED)) + dev_data->use_vapic = 0; +#endif + iommu_completion_wait(iommu); } @@ -3240,6 +3247,15 @@ static int amd_iommu_attach_device(struct iommu_domain *dom, ret = attach_device(dev, domain); +#ifdef CONFIG_IRQ_REMAP + if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir)) { + if (dom->type == IOMMU_DOMAIN_UNMANAGED) + dev_data->use_vapic = 1; + else + dev_data->use_vapic = 0; + } +#endif + iommu_completion_wait(iommu); return ret; @@ -3990,7 +4006,7 @@ static void free_irte(u16 devid, int index) static void irte_prepare(void *entry, u32 delivery_mode, u32 dest_mode, - u8 vector, u32 dest_apicid) + u8 vector, u32 dest_apicid, int devid) { union irte *irte = (union irte *) entry; @@ -4004,13 +4020,14 @@ static void irte_prepare(void *entry, static void irte_ga_prepare(void *entry, u32 delivery_mode, u32 dest_mode, - u8 vector, u32 dest_apicid) + u8 vector, u32 dest_apicid, int devid) { struct irte_ga *irte = (struct irte_ga *) entry; + struct iommu_dev_data *dev_data = search_dev_data(devid); irte->lo.val = 0; irte->hi.val = 0; - irte->lo.fields_remap.guest_mode = 0; + irte->lo.fields_remap.guest_mode = dev_data ? dev_data->use_vapic : 0; irte->lo.fields_remap.int_type = delivery_mode; irte->lo.fields_remap.dm = dest_mode; irte->hi.fields.vector = vector; @@ -4064,11 +4081,14 @@ static void irte_ga_set_affinity(void *entry, u16 devid, u16 index, u8 vector, u32 dest_apicid) { struct irte_ga *irte = (struct irte_ga *) entry; + struct iommu_dev_data *dev_data = search_dev_data(devid); - irte->hi.fields.vector = vector; - irte->lo.fields_remap.destination = dest_apicid; - irte->lo.fields_remap.guest_mode = 0; - modify_irte_ga(devid, index, irte, NULL); + if (!dev_data || !dev_data->use_vapic) { + irte->hi.fields.vector = vector; + irte->lo.fields_remap.destination = dest_apicid; + irte->lo.fields_remap.guest_mode = 0; + modify_irte_ga(devid, index, irte, NULL); + } } #define IRTE_ALLOCATED (~1U) @@ -4211,7 +4231,7 @@ static void irq_remapping_prepare_irte(struct amd_ir_data *data, data->irq_2_irte.index = index + sub_handle; iommu->irte_ops->prepare(data->entry, apic->irq_delivery_mode, apic->irq_dest_mode, irq_cfg->vector, - irq_cfg->dest_apicid); + irq_cfg->dest_apicid, devid); switch (info->type) { case X86_IRQ_ALLOC_TYPE_IOAPIC: @@ -4411,6 +4431,14 @@ static int amd_ir_set_vcpu_affinity(struct irq_data *data, void *vcpu_info) struct amd_ir_data *ir_data = data->chip_data; struct irte_ga *irte = (struct irte_ga *) ir_data->entry; struct irq_2_irte *irte_info = &ir_data->irq_2_irte; + struct iommu_dev_data *dev_data = search_dev_data(irte_info->devid); + + /* Note: + * This device has never been set up for guest mode. + * we should not modify the IRTE + */ + if (!dev_data || !dev_data->use_vapic) + return 0; pi_data->ir_data = ir_data; diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index c32d0b3..5eb1608 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -146,7 +146,7 @@ struct ivmd_header { bool amd_iommu_dump; bool amd_iommu_irq_remap __read_mostly; -int amd_iommu_guest_ir; +int amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_VAPIC; static bool amd_iommu_detected; static bool __initdata amd_iommu_disabled; @@ -2009,6 +2009,11 @@ static void early_enable_iommus(void) iommu_enable(iommu); iommu_flush_all_caches(iommu); } + +#ifdef CONFIG_IRQ_REMAP + if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir)) + amd_iommu_irq_ops.capability |= (1 << IRQ_POSTING_CAP); +#endif } static void enable_iommus_v2(void) @@ -2034,6 +2039,11 @@ static void disable_iommus(void) for_each_iommu(iommu) iommu_disable(iommu); + +#ifdef CONFIG_IRQ_REMAP + if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir)) + amd_iommu_irq_ops.capability &= ~(1 << IRQ_POSTING_CAP); +#endif } /* diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index 35dfe02..26f8347 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -808,7 +808,7 @@ struct irq_2_irte { }; struct amd_irte_ops { - void (*prepare)(void *, u32, u32, u8, u32); + void (*prepare)(void *, u32, u32, u8, u32, int); void (*activate)(void *, u16, u16); void (*deactivate)(void *, u16, u16); void (*set_affinity)(void *, u16, u16, u8, u32);