From patchwork Fri Mar 11 10:35:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 12777780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C985C433F5 for ; Fri, 11 Mar 2022 10:35:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347674AbiCKKgT (ORCPT ); Fri, 11 Mar 2022 05:36:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240566AbiCKKgR (ORCPT ); Fri, 11 Mar 2022 05:36:17 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A2051160F9; Fri, 11 Mar 2022 02:35:04 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1505421901; Fri, 11 Mar 2022 10:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1646994903; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=cl8eXsZGXE2910dV3+hGtO5AmlArXF2/CNH7AFhna9A=; b=jzLP/R1zJqyhsxtF02jryM8k300pfwJZXj8gxvxt/4Nm6TDhvTgoPKqENjWl1clmPGCMbt UIL2Xl9sT9WOeDqiCb8WyElSfyhKO6RDIANpNYwGrrZN/pHL8Z7FWmqzuDzEpdMtsLQpdh GxViyLpxS0aatuAWvXEwYj0rudthaDU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D69EB13A85; Fri, 11 Mar 2022 10:35:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Pe8nM9YlK2I5dgAAMHmgww (envelope-from ); Fri, 11 Mar 2022 10:35:02 +0000 From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Greg Kroah-Hartman Subject: [PATCH] xen/usb: don't use arbitrary_virt_to_machine() Date: Fri, 11 Mar 2022 11:35:00 +0100 Message-Id: <20220311103500.12885-1-jgross@suse.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org arbitrary_virt_to_machine() is meant to be used in PV guests only. Replace its usage with virt_to_gfn(). Signed-off-by: Juergen Gross --- drivers/usb/host/xen-hcd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/host/xen-hcd.c b/drivers/usb/host/xen-hcd.c index 5f4a00df4f1c..01db5c767251 100644 --- a/drivers/usb/host/xen-hcd.c +++ b/drivers/usb/host/xen-hcd.c @@ -589,14 +589,12 @@ static void xenhcd_gnttab_map(struct xenhcd_info *info, void *addr, int length, int nr_pages, int flags) { grant_ref_t ref; - unsigned long buffer_mfn; unsigned int offset; unsigned int len = length; unsigned int bytes; int i; for (i = 0; i < nr_pages; i++) { - buffer_mfn = PFN_DOWN(arbitrary_virt_to_machine(addr).maddr); offset = offset_in_page(addr); bytes = PAGE_SIZE - offset; @@ -605,7 +603,7 @@ static void xenhcd_gnttab_map(struct xenhcd_info *info, void *addr, int length, ref = gnttab_claim_grant_reference(gref_head); gnttab_grant_foreign_access_ref(ref, info->xbdev->otherend_id, - buffer_mfn, flags); + virt_to_gfn(addr), flags); seg[i].gref = ref; seg[i].offset = (__u16)offset; seg[i].length = (__u16)bytes;