From patchwork Tue Apr 2 12:56:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10881647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF8A215AC for ; Tue, 2 Apr 2019 12:58:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AF86288DA for ; Tue, 2 Apr 2019 12:58:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EFF2288F7; Tue, 2 Apr 2019 12:58:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4A66D288DA for ; Tue, 2 Apr 2019 12:58:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hBIxz-0006mp-A0; Tue, 02 Apr 2019 12:56:39 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hBIxy-0006mi-Kj for xen-devel@lists.xenproject.org; Tue, 02 Apr 2019 12:56:38 +0000 X-Inumbo-ID: bfbd6763-5546-11e9-bc90-bc764e045a96 Received: from prv1-mh.provo.novell.com (unknown [137.65.248.33]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id bfbd6763-5546-11e9-bc90-bc764e045a96; Tue, 02 Apr 2019 12:56:36 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Tue, 02 Apr 2019 06:56:36 -0600 Message-Id: <5CA35C010200007800223E4C@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Tue, 02 Apr 2019 06:56:33 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Content-Disposition: inline Subject: [Xen-devel] [PATCH] VT-d: return full destination ID for IO-APIC reads X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Kevin Tian Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP In x2APIC mode it is 32 bits wide. Not having returned the full value was mostly benign: We never modify the ID based on its original value; full new values get written at all times. It was "just" debug logging which ended up wrong this way (and which will need adjustment itself as well, to also consume the full value). Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Acked-by: Kevin Tian --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -314,8 +314,13 @@ static int remap_entry_to_ioapic_rte( old_rte->dest_mode = iremap_entry->remap.dm; old_rte->trigger = iremap_entry->remap.tm; old_rte->__reserved_2 = 0; - old_rte->dest.logical.__reserved_1 = 0; - old_rte->dest.logical.logical_dest = iremap_entry->remap.dst >> 8; + if ( x2apic_enabled ) + old_rte->dest.dest32 = iremap_entry->remap.dst; + else + { + old_rte->dest.logical.__reserved_1 = 0; + old_rte->dest.logical.logical_dest = iremap_entry->remap.dst >> 8; + } unmap_vtd_domain_page(iremap_entries); spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);