From patchwork Wed Mar 31 10:32:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 12175021 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=-18.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,USER_AGENT_GIT autolearn=ham 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 8FCDDC433DB for ; Wed, 31 Mar 2021 10:36:09 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 134D361582 for ; Wed, 31 Mar 2021 10:36:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 134D361582 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.103831.198031 (Exim 4.92) (envelope-from ) id 1lRYCZ-0004dy-36; Wed, 31 Mar 2021 10:35:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 103831.198031; Wed, 31 Mar 2021 10:35:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lRYCY-0004dp-Vc; Wed, 31 Mar 2021 10:35:54 +0000 Received: by outflank-mailman (input) for mailman id 103831; Wed, 31 Mar 2021 10:35:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lRYCX-0004Zp-DH for xen-devel@lists.xenproject.org; Wed, 31 Mar 2021 10:35:53 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d6b4c8f5-1a2a-4f3e-a398-b4d6f00ac697; Wed, 31 Mar 2021 10:35:51 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d6b4c8f5-1a2a-4f3e-a398-b4d6f00ac697 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1617186951; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=NV3KE9n/uXtSsphUpkD9HAmF5sKVQHJPIYSdLPj7tUc=; b=HiT10VfVApaBoPDjbJgswzgS4ajtN0BqccUSp+TcKjx84K3/aOrzKnfk +RrHOTvP/Udj9uxe9zQJIwyHMBfxVE+8KAuH4Jawisv29hycznS4d8RrS mKDZRWLOQMAJSRRjSzEVImKUfNDzGyiQdW43/F/sJ67bKvPeHeeUdRuLO k=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: E0fE6gZR48Kl3l+ZKlFokDeQ/Dhy6Y6ECTvVb+aIMVahthzYLj57uzzfAod+RjFdelFVAjz4cY uRY3GxG4Y5+DHPG0JWIl3HFagWS6Eo34HPM3daCQdKcjjq6OR6MPOSLVuEx2xx/XMRwU6P1VLl o2h/vM7EkILwbXgFEeqWD6RlZ965cZgOGoW6Uda5O3aYkNKKP3+jALSfyvIOdXvNNL94TO/SNX n+dyzV3tgKAl4HgWwWhj7xQyzjRoTxenXx5EqujU0jcE25Uby3CvqyW2r0+vAK6k77DW15ZMCK m0E= X-SBRS: 5.2 X-MesageID: 40415650 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:x0km/66VqbDf3ZJ5BAPXwRKBI+orLtY04lQ7vn1ZYQBJc8Ceis CllOka0xixszoKRHQ8g7m7VZWoa3Xa6JJz/M0tLa6vNTOW3VeAAaNDyc/ZwzPmEzDj7eI178 1dWoV3FdGYNzdHpOng5g3QKbgd6f2m1IztuuvE1XdqSmhRGsNdxiN0EBySHEEzZCQuP/oEPa GR7MZGuDasEE5/BqiGL0IIQvTZoJnznI/mCCRsOzcc9AKMgTm0gYSKcCSw4xF2aVJy6IZny0 fpuUjT5qKvs/a0oyWsrVP73tBtt/bKjvdGDMyIoMAJJjvrkRbAXvUdZ5Sy+AobjcvqxFE2kM TdgxpIBbUO11rhOlubjDGo+w783C0g43XvoGXo/kfLkIjCax8RT+9i7LgpFifx2g4bk/xXlJ 9v5Sa/saFaCBvR9R6Nn+TgZlVRuWef5UY5nfV7tQ05baIuLIV/gKY4501vHJIJDEvBmfsaOd grNs3a6fpMGGnqCUzxjy1qyNyoaHw5Ag2LdEgEotCUyDhbhhlCvjIl+PA= X-IronPort-AV: E=Sophos;i="5.81,293,1610427600"; d="scan'208";a="40415650" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=blXoAwoYh/Az5AzBRXyKenEOFnoKKEVMUzSYfdj9vmdLFoPYoH6Qv932DqgB01I7nOripYKYVZKk2rQPkjDmxiYwBF8otMvFEaSK6F9IFwxmdxtk1w9f/Scte4LYIdP+bo+4PKB6ZM8jtmivABJJpyNTsC7Z44N1t8/mz1LA2SCYT5Omsa3mxBtdjS6nXHUxYI+X4O64oRNjMGXWVDDENMKfuwWKne5XV97Welc3XYGw2pg7tNVckttQKbeKy2O246AbqCQeaL28+IHLhEWgatsjvXQie+PSoPaEJvdLaYkZQGrkaFsFpyuFWBdfRqHFTD1ayP0qXC+PYaOymRd63Q== 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=VFsVREZZe9qZvUSg1UZfGO+DXUpYL2DZXPRk+PVsbKI=; b=VWCTeBrqvsgaaTFFTIn/mo0cJOOmrPBrGYm+6WHOUE+YckzKwdtzPVRYG0/aaAgf7XKQJzrcbj2kFrbyK9FEMoccjwxmCrHLt/hjtypOuLJwqhy/4sEJUegGIAlI2SB1slXgkaYrR1Cz5igLVHHbiWJMWNJ62zNrkbdOv3m3e5cKANFB3s8MxHFLSCQj8ayObIjGZF9Sk5YaEb2puOb8/dxv8wC24b9QAbWi/32Zsvdk1ds04A7aJts3DJwcILPCDU+4yfQDwYk2d9OMvYR9w7AqwjZBlMtPEDZfzfNqphMeaJKewwGzqTvfV0fQkyLlleJ4wmJNuMW87H6UT5yS6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VFsVREZZe9qZvUSg1UZfGO+DXUpYL2DZXPRk+PVsbKI=; b=rb/qDlgeB1JlyyPf+W07TzbWKlf/LU4mPPfafr41+f1XhBYiRL2O0STpJW4WfEZWGpq4MrQMAiPDXx6RkXOM/QjrBGQEUILSNzXSHTVvzdrs2ipg5Xz6ait9Uw1ycyexw20tKgJdDgXmjDYmXiT8/EfvzgQIBmBr/PZ6cBdVd5M= From: Roger Pau Monne To: CC: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu , Paul Durrant Subject: [PATCH v3 02/11] x86/hvm: drop domain parameter from vioapic/vpic EOI callbacks Date: Wed, 31 Mar 2021 12:32:54 +0200 Message-ID: <20210331103303.79705-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210331103303.79705-1-roger.pau@citrix.com> References: <20210331103303.79705-1-roger.pau@citrix.com> X-ClientProxiedBy: MR2P264CA0050.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:31::14) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2aa7e7b-5f5e-4d8e-407f-08d8f430bea5 X-MS-TrafficTypeDiagnostic: DM5PR03MB2777: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JzeYeKuF1xe5SUZvnjAKCGfLVRy/4rtcuqjVdtk0HZrXqxzfOS9C+LSJr3x/9ZSt9NhkZGMOfEv40Fgh9PeAbEilqJGbh0lp8Qmwj57SM/9ngs3j0AWSQQAXO8BB+HzDyP5CtcqPB7cmAf/1rspWAdMHjHoPZtTb4556JzpEzaDwHCefmecXcdERhuByVfcDRe5Ons1VfQmHMQ2rrmkBJMyQMkLGBfgZsGDm6LtXxkeG6+10Id1OJMCjTx7LHv+vC+CVc6Ds4mrndrE5Dce6NzhSMlavzyeaoLB+fxszV66nS5uEmxrZH9AfsSk6akXdF+R4G2X7YOtqywUpntYwytNmDcWK2O/wlqqotkGBKAkeS/uPKKuZ2Z+P14tDSLEOhGFij2xo9fFH/oMbV96ZMyAto7fhg4RLfmOojPAWQkxJzej1oUWWO+TwFSn8hyAluRBhs+8fT6L80jfvsQoeJa+OOe75e7xwNdyixefM847Uw8Wd1ALUS8H8hZwYNg0uD831Y0aLQkesgKlxhxoEoPDUuHtOlCBMTD9JYhnyQoNn3lFHjfkQp1nqsQ53XUjs0ldsJrmiKIvXux8LrWvwd7A6XZRVZ0PhMM8RcJ+6PPVjGasGV4cBZgHoffhsfMHb2PyBlzeF4MSQj9/aUFO+0A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(136003)(346002)(366004)(39860400002)(376002)(5660300002)(186003)(66476007)(16526019)(26005)(6486002)(8676002)(36756003)(86362001)(83380400001)(38100700001)(8936002)(956004)(54906003)(1076003)(6916009)(2906002)(4326008)(316002)(2616005)(66946007)(6666004)(66556008)(478600001)(6496006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?uly5ljG/Ga7PyNovXSMxezfkCGTnhy?= =?utf-8?q?dB3Lori0Cbb1JIijvnu2go3QjoeLDG17Kns1XpNz8KDNS2GomjeuYGbdMP4MVn9f/?= =?utf-8?q?LbpMCCufG+00uMWuW3IxVJL9Y26SZBzeqTO1W+O9aMhJV8FDmbCrhMocJWjnAYsTj?= =?utf-8?q?FUeIf42illCd9f+IEZoerB8qKkZ+Z1MQIWIOHUr1TjpoxFT8mrC1h15CLISvHaczl?= =?utf-8?q?7FsSunBRwoIXwb9zR5/s/oUGM3JBzByF0bLCfvQK76d9+B3SI2IjfP0/Ysamo+S1+?= =?utf-8?q?2DK+Iz3MXWIx929x5FZhev8+j3Srd3gmR0oSIC/Z7iXSxCqbC0hT8QO6pb+AolrDu?= =?utf-8?q?mag4mQ+7KPC5AD1s/3fytWL4xD91L+P2FgbXJNZDzx4SxaHYqRstP2MUTgjmduSlB?= =?utf-8?q?Vw9L3W8V/5HNyXzffffw3bslfXQOH978F8PK6C5lLnldzrlxoFrP27KCPdqwkppY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4d8e-407f-08d8f430bea5 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 10:35:46.9015 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nb25nqCrGbm9AFGTWtwpohMLth2F2FDioSTNaJq9OP/+XmmSmjP9KMDigNXvgYtuYXhUBqv2iRp3u0BhabsL/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2777 X-OriginatorOrg: citrix.com EOIs are always executed in guest vCPU context, so there's no reason to pass a domain parameter around as can be fetched from current->domain. No functional change intended. Signed-off-by: Roger Pau Monné Reviewed-by: Paul Durrant --- Changes since v1: - New in this version. --- xen/arch/x86/hvm/vioapic.c | 4 ++-- xen/arch/x86/hvm/vpic.c | 6 ++---- xen/drivers/passthrough/x86/hvm.c | 3 ++- xen/include/asm-x86/hvm/io.h | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 91e5f892787..dcc2de76489 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -284,7 +284,7 @@ static void vioapic_write_redirent( */ ASSERT(prev_level); ASSERT(!top_word); - hvm_dpci_eoi(d, gsi); + hvm_dpci_eoi(gsi); } if ( is_hardware_domain(d) && unmasked ) @@ -541,7 +541,7 @@ void vioapic_update_EOI(unsigned int vector) if ( is_iommu_enabled(d) ) { spin_unlock(&d->arch.hvm.irq_lock); - hvm_dpci_eoi(d, vioapic->base_gsi + pin); + hvm_dpci_eoi(vioapic->base_gsi + pin); spin_lock(&d->arch.hvm.irq_lock); } diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c index f465b7f9979..a69aecad912 100644 --- a/xen/arch/x86/hvm/vpic.c +++ b/xen/arch/x86/hvm/vpic.c @@ -235,8 +235,7 @@ static void vpic_ioport_write( unsigned int pin = __scanbit(pending, 8); ASSERT(pin < 8); - hvm_dpci_eoi(current->domain, - hvm_isa_irq_to_gsi((addr >> 7) ? (pin | 8) : pin)); + hvm_dpci_eoi(hvm_isa_irq_to_gsi((addr >> 7) ? (pin | 8) : pin)); __clear_bit(pin, &pending); } return; @@ -285,8 +284,7 @@ static void vpic_ioport_write( /* Release lock and EOI the physical interrupt (if any). */ vpic_update_int_output(vpic); vpic_unlock(vpic); - hvm_dpci_eoi(current->domain, - hvm_isa_irq_to_gsi((addr >> 7) ? (pin | 8) : pin)); + hvm_dpci_eoi(hvm_isa_irq_to_gsi((addr >> 7) ? (pin | 8) : pin)); return; /* bail immediately */ case 6: /* Set Priority */ vpic->priority_add = (val + 1) & 7; diff --git a/xen/drivers/passthrough/x86/hvm.c b/xen/drivers/passthrough/x86/hvm.c index 2f6c81b1e2c..a9256e7ef51 100644 --- a/xen/drivers/passthrough/x86/hvm.c +++ b/xen/drivers/passthrough/x86/hvm.c @@ -911,8 +911,9 @@ static void hvm_gsi_eoi(struct domain *d, unsigned int gsi) hvm_pirq_eoi(pirq); } -void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi) +void hvm_dpci_eoi(unsigned int guest_gsi) { + struct domain *d = current->domain; const struct hvm_irq_dpci *hvm_irq_dpci; const struct hvm_girq_dpci_mapping *girq; diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h index 8b8392ec59e..4f294232fb7 100644 --- a/xen/include/asm-x86/hvm/io.h +++ b/xen/include/asm-x86/hvm/io.h @@ -101,7 +101,7 @@ bool handle_mmio_with_translation(unsigned long gla, unsigned long gpfn, struct npfec); bool handle_pio(uint16_t port, unsigned int size, int dir); void hvm_interrupt_post(struct vcpu *v, int vector, int type); -void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq); +void hvm_dpci_eoi(unsigned int guest_irq); void msix_write_completion(struct vcpu *); #ifdef CONFIG_HVM