From patchwork Mon Nov 23 17:57:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Belits X-Patchwork-Id: 331969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C360DC64E7A for ; Mon, 23 Nov 2020 17:58:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 607E0206B2 for ; Mon, 23 Nov 2020 17:58:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="i6R4a19b"; dkim=pass (1024-bit key) header.d=marvell.onmicrosoft.com header.i=@marvell.onmicrosoft.com header.b="mlLJQs0L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390527AbgKWR62 (ORCPT ); Mon, 23 Nov 2020 12:58:28 -0500 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:57330 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390442AbgKWR61 (ORCPT ); Mon, 23 Nov 2020 12:58:27 -0500 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0ANHtsnQ032585; Mon, 23 Nov 2020 09:57:45 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0220; bh=ZsVGrf96RQZC2gJ3j4omQY4A3uR1ZqJF3Li3cBFxpiA=; b=i6R4a19bSrjS23VdfN6af2/g2McSsGsc3qY7nC4vg5UGxoMU4GpoFqytEG042dNueq8o NiX3EkYiPIzUtiKrzUwH4DMD/Q4afnlrRqknzZDZ/g65gQ4Wy2cSatmkOqqJr4b8uR8t WUPqtQ3XMwN7CJECNbR6CNqh6ncffxdBUOzvXaO7Gh7dFXLL6a1oN9zMIWhDi74UiVYf Sg37NpXecW/kfWUkYWeHDXhB//LEKz3P41yy4cvZr2AevgAcp5yNfg60wLCsI/pp01/H IK9fj1OClJ8LAivXIyZGodH8CqRDWTSGnwvtYaxsRmeSGXmFaYQwjTeSQ7zhKNEMOXE5 LA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 34y14u6tyw-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 23 Nov 2020 09:57:45 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 23 Nov 2020 09:57:44 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 23 Nov 2020 09:57:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RBfML/BzAdDDVOmR5W2tEL1SVOMADQUrOgAheS7eTVNm6q0TA5Szp54pdPAFb8HSad4EIB49opeYX2XO7jRVsAqT9IKZUhp19QQX6oUiTKKUMjwoZ3VeH4eBQiJd62fmDt6YEFRdjj2anQteMTUFSwKafF1Mnq0UB4FJZKOQe2HgsQzqN7Tb2DEQ2emgXOawRwsITQ6ssPAuuBDTzyY/C1JtHDIswKZrvRTr3yorVvsosA6BdpIZsTuvUgkypkkIGMC4Wye10OOwTLyHyPk39Pr56n/DLf2l1HhkdQJJKs+m/e7yhsq48HSpeJmEF0XJir21dIpLnbGPR6R/lsGuVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZsVGrf96RQZC2gJ3j4omQY4A3uR1ZqJF3Li3cBFxpiA=; b=DL5G5XNvZHqdUwdflqrgOUwv5Xk8ymgSVZie7d1kpduQBbeAisD5si5lwONkcheYOEl+jNzSa5IaiytAZmyBYh9q2sj0Adqn2pzisXb+MzNlERTWwdR8yD8aMhtjJpwihwG0QWCRIn/gpJe89xvkWmmznSqvAlMs4y0Jbbu4Dld2lrTEZ/XjsWyHPt0XUrfV8OsI6VQYtb+aEwUZPwAL9BsxNgxQOPhpqkW1SmMKh35XUKJ+P+1ZHfAno2q9uGZW6IVX59oXZHC2gMxkEZVUjRVyrVKv4dCXVL2coIy9Oy9Z41aiEeePFoVVaiX2X1Kv6PRIx3mOEV6GwEG4DvrrXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZsVGrf96RQZC2gJ3j4omQY4A3uR1ZqJF3Li3cBFxpiA=; b=mlLJQs0LTu88LU1d6eaIFip4Uph09Bss7YakCaz+5szVeOBHamw4GSFJbKfJhkaP99GYb9zRpYKkGEmZmbt7MWtzvfraaNFp6Cr7+IAGKPaj3SpirCoDeibdahhX+/gKairHFVEEJlZ8LiDB8a+phHGW1XMm98EN/SorsgxnBJo= Received: from MW2PR18MB2267.namprd18.prod.outlook.com (2603:10b6:907:3::11) by MW3PR18MB3530.namprd18.prod.outlook.com (2603:10b6:303:55::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.22; Mon, 23 Nov 2020 17:57:43 +0000 Received: from MW2PR18MB2267.namprd18.prod.outlook.com ([fe80::e17f:37fb:4eb3:c703]) by MW2PR18MB2267.namprd18.prod.outlook.com ([fe80::e17f:37fb:4eb3:c703%4]) with mapi id 15.20.3564.039; Mon, 23 Nov 2020 17:57:43 +0000 From: Alex Belits To: "nitesh@redhat.com" , "frederic@kernel.org" CC: Prasun Kapoor , "linux-api@vger.kernel.org" , "davem@davemloft.net" , "trix@redhat.com" , "mingo@kernel.org" , "catalin.marinas@arm.com" , "rostedt@goodmis.org" , "linux-kernel@vger.kernel.org" , "peterx@redhat.com" , "tglx@linutronix.de" , "linux-arch@vger.kernel.org" , "mtosatti@redhat.com" , "will@kernel.org" , "peterz@infradead.org" , "leon@sidebranch.com" , "linux-arm-kernel@lists.infradead.org" , "pauld@redhat.com" , "netdev@vger.kernel.org" Subject: [PATCH v5 5/9] task_isolation: Add driver-specific hooks Thread-Topic: [PATCH v5 5/9] task_isolation: Add driver-specific hooks Thread-Index: AQHWwcIjLJ3XhCtZ4UCn5Rp0YgDpdQ== Date: Mon, 23 Nov 2020 17:57:42 +0000 Message-ID: <6e15fde56203f89ebab0565dc22177f42063ae7c.camel@marvell.com> References: <8d887e59ca713726f4fcb25a316e1e932b02823e.camel@marvell.com> In-Reply-To: <8d887e59ca713726f4fcb25a316e1e932b02823e.camel@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [173.228.7.197] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 97615725-7978-467b-5bf9-08d88fd946b9 x-ms-traffictypediagnostic: MW3PR18MB3530: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1265; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IqZH+V28Y+39eM63y9yPGzz58EwE1gqJMAPAihDdMV7ILV4T4+pzHmR0tS+HNiv6aqA9GwVX0wBnUD+YHAvsXN7hv/hw+SA5XxJUunvShzgI99+GYQNftOzGceodwpR6CksoCGr4zST4em4tMK/KlFYN7R/j99VxkuiCnbmzbCcDOJaWzehRZ6fSChF+55rI33+CW8vHdSC4EHcx0TYz25CkLmxDqCjOhUUhhySuM0AFbKqckcIPcV8kkArIdBkoPnSaLawPYKNqKuoOzvpVyHkia9URj1ICHcC/pcIy3zbeIjEgvmuC9pjuck1XpOXU x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR18MB2267.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(376002)(39860400002)(136003)(396003)(2906002)(2616005)(71200400001)(5660300002)(6512007)(83380400001)(110136005)(26005)(54906003)(6486002)(186003)(6506007)(36756003)(66946007)(8676002)(316002)(478600001)(8936002)(86362001)(7416002)(66476007)(66556008)(64756008)(66446008)(91956017)(76116006)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 3elDcvQibqAkHgBF6TTWWiEMZfiJIQh6SlSwvFJUJvI1GmLahDjkrPiw3MmeT/igzsrsOVfjJHSV3DZul9ixvWLuPoYJMAGlmk5OgtQVru/IxlqRajyuneW+BgVR4C2k/m2+qx4V9CUCg9eS/xwXcqMuLc4y3kLQNzeeWgtx/JrcFQzFNJRFqMySxLP2O5jV8MUB+0xSrdUOwYH9o7jHopJhJEq8v+mFpZPmlcI/SM9Kzzn5Kt6jfiGzm3yYlDfBoKjZPeMXQR/JlD1pArCKpmKgbC+VdgNFQguH5S21vn4dR/NO9ra4rhlCWz/Jqm5VQTkRhJyYuhl1ROc3vISJEKAAHKvoyo8yF479i1Jk0gMwvF1FaWDZvPJb8vHNcC52lwaDGTFnL6qkWWL0N94dwTZ2k6t4+wGJ//CClapiCpoWo3qjIixlskvoId1rMsJgxw0LFnRVOn11+YOZudxg6ti3pQ2qNIKvtToMYKfEeihGS09sUeeFGndPzbHD5i9a5IqX1oefWGzsj1F6la2OfL7qv6aT98ULKdyVGnsAeLl913qrlP9S6M9InTjsVC7aau6ox+D2GAJu6Y6WYVdvUwrvKs4gL0r2MxumNBG7vPS8/VzOP6+63yoXY3O5qtwbTdJUzdeIT1suyIS6i8jt4zERWtT3MN0FEEtwDm7aIxToRcUtwwkOP7jwS5QuHEzF+2qnlOWyICAodsDaOoFRCCP4oo8Frt+k2trzn4cE/brnxeMNi9HrLm/fdjux0ouKLdxdsPf18sr9Hcwqa3eDpDfPddQ3fLMqwbmnI0Y3Wfe9aJbE+txiB1qGP37Bw3Kdnz+DMayuhQTN+LA4hzc7stYijx2MW+54gKBFbuO6knXL8pEUi+MLwmyoXj8+VlpWMI07EU02p/TbdSkL0Lp38w== Content-ID: <5C8C0415A4BFAA41923B78D82E3BB917@namprd18.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR18MB2267.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97615725-7978-467b-5bf9-08d88fd946b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2020 17:57:42.8194 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: v3ZMSJ2xPJtEQVOxFlqQA2TE/pwZdjx3y2XIbX6I5lX35cPIbrw5NDTk1/7A1q/obJS9ypZsbucQK8VGQrglQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR18MB3530 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-23_17:2020-11-23,2020-11-23 signatures=0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some drivers don't call functions that call task_isolation_kernel_enter() in interrupt handlers. Call it directly. Signed-off-by: Alex Belits --- drivers/irqchip/irq-armada-370-xp.c | 6 ++++++ drivers/irqchip/irq-gic-v3.c | 3 +++ drivers/irqchip/irq-gic.c | 3 +++ drivers/s390/cio/cio.c | 3 +++ 4 files changed, 15 insertions(+) -- 2.20.1 diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index d7eb2e93db8f..4ac7babe1abe 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -572,6 +573,7 @@ static const struct irq_domain_ops armada_370_xp_mpic_irq_ops = { static void armada_370_xp_handle_msi_irq(struct pt_regs *regs, bool is_chained) { u32 msimask, msinr; + int isol_entered = 0; msimask = readl_relaxed(per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS) @@ -588,6 +590,10 @@ static void armada_370_xp_handle_msi_irq(struct pt_regs *regs, bool is_chained) continue; if (is_chained) { + if (!isol_entered) { + task_isolation_kernel_enter(); + isol_entered = 1; + } irq = irq_find_mapping(armada_370_xp_msi_inner_domain, msinr - PCI_MSI_DOORBELL_START); generic_handle_irq(irq); diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 16fecc0febe8..ded26dd4da0f 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -646,6 +647,8 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs { u32 irqnr; + task_isolation_kernel_enter(); + irqnr = gic_read_iar(); if (gic_supports_nmi() && diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 6053245a4754..bb482b4ae218 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -337,6 +338,8 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) struct gic_chip_data *gic = &gic_data[0]; void __iomem *cpu_base = gic_data_cpu_base(gic); + task_isolation_kernel_enter(); + do { irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK); irqnr = irqstat & GICC_IAR_INT_ID_MASK; diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 6d716db2a46a..beab88881b6d 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -584,6 +585,8 @@ void cio_tsch(struct subchannel *sch) struct irb *irb; int irq_context; + task_isolation_kernel_enter(); + irb = this_cpu_ptr(&cio_irb); /* Store interrupt response block to lowcore. */ if (tsch(sch->schid, irb) != 0)