From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 D3BEDC433E7 for ; Fri, 16 Oct 2020 09:32:45 +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 5F27E206DD for ; Fri, 16 Oct 2020 09:32:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="GYq8SQwC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F27E206DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.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.7853.20689 (Exim 4.92) (envelope-from ) id 1kTM69-0006EY-Nh; Fri, 16 Oct 2020 09:32:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 7853.20689; Fri, 16 Oct 2020 09:32:29 +0000 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" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kTM69-0006ER-Kc; Fri, 16 Oct 2020 09:32:29 +0000 Received: by outflank-mailman (input) for mailman id 7853; Fri, 16 Oct 2020 09:32:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kTM68-0006EM-CT for xen-devel@lists.xen.org; Fri, 16 Oct 2020 09:32:28 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f5f72749-a7be-438b-8077-20b35450b082; Fri, 16 Oct 2020 09:32:27 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 32C3BAD82; Fri, 16 Oct 2020 09:32:26 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kTM68-0006EM-CT for xen-devel@lists.xen.org; Fri, 16 Oct 2020 09:32:28 +0000 X-Inumbo-ID: f5f72749-a7be-438b-8077-20b35450b082 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f5f72749-a7be-438b-8077-20b35450b082; Fri, 16 Oct 2020 09:32:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1602840746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dYDPGZrXdyi46y7fj9XtittCt4pGBBzOezx1Qmnham4=; b=GYq8SQwC0brftuO1X2jjp6UT1ZNhZ8PGhPWINDzUJ4aPqRMgqA+cd6YVsUXAtTw/D/Q3Ya fc9uYcmzBvBoAn7yvEj8PXHlnURHUg+mGPUjwdDb5Im8vz55zYPJzom+nJ6N4HAD3QLHN3 mdQbTRVa7Z9fGaYvdOU3yjivwRYASog= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 32C3BAD82; Fri, 16 Oct 2020 09:32:26 +0000 (UTC) Subject: Re: [Xen-devel] [XEN PATCH v14 8/8] Add xentrace to vmware_port To: Don Slutz Cc: xen-devel@lists.xen.org, Aravind Gopalakrishnan , Boris Ostrovsky , Eddie Dong , Ian Campbell , Ian Jackson , Jun Nakajima , Keir Fraser , Kevin Tian , Stefano Stabellini , Suravee Suthikulpanit , Tim Deegan , Andrew Cooper , Konrad Rzeszutek Wilk , George Dunlap , Don Slutz References: <1bfc92ee47f425235821c3655564a5a4b3d34593.1597854908.git.don.slutz@gmail.com> From: Jan Beulich Message-ID: <5ad14acd-eff3-ea34-93f3-cdc195a3b9bb@suse.com> Date: Fri, 16 Oct 2020 11:32:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <1bfc92ee47f425235821c3655564a5a4b3d34593.1597854908.git.don.slutz@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 19.08.2020 18:52, Don Slutz wrote: > From: Don Slutz > > Also added missing TRAP_DEBUG & VLAPIC. > > Signed-off-by: Don Slutz > CC: Don Slutz > --- > Acked-by: Ian Campbell > > v14: > Reworked to current code. > Added VMPORT_SEND because I wanted to see it during testing. > > v13: > Please do this by extending the existing infrastructure rather > than special-casing 7 on the side. (i.e. extend ND to take 7 > parameters, and introduce HVMTRACE_7D) > = { d1, d2, d3, d4, d5, d6, d7 } will be far shorter, linewise. I think this would have wanted to split into two patches right at the time: One for the extension, and another for the new VMware logic. But see below. > @@ -62,6 +63,7 @@ static int vmport_ioport(int dir, uint32_t port, uint32_t bytes, uint32_t *val) > if ( port == BDOOR_PORT && regs->eax == BDOOR_MAGIC ) > { > uint32_t new_eax = ~0u; > + uint16_t cmd = regs->ecx; > uint64_t value; > struct vcpu *curr = current; > struct domain *currd = curr->domain; > @@ -72,7 +74,7 @@ static int vmport_ioport(int dir, uint32_t port, uint32_t bytes, uint32_t *val) > * leaving the high 32-bits unchanged, unlike what one would > * expect to happen. > */ > - switch ( regs->ecx & 0xffff ) > + switch ( cmd ) > { > case BDOOR_CMD_GETMHZ: > new_eax = currd->arch.tsc_khz / 1000; > @@ -147,14 +149,22 @@ static int vmport_ioport(int dir, uint32_t port, uint32_t bytes, uint32_t *val) > break; > > default: > + HVMTRACE_6D(VMPORT_SEND, cmd, regs->ebx, regs->ecx, > + regs->edx, regs->esi, regs->edi); With cmd derived from regs->ecx, why pass the same value twice here? > /* Let backing DM handle */ > return X86EMUL_UNHANDLEABLE; > } > + HVMTRACE_7D(VMPORT_HANDLED, cmd, new_eax, regs->ebx, regs->ecx, > + regs->edx, regs->esi, regs->edi); None of the cases making it here consumes or alter regs->edi. Why record / report its value? Without this, the entire widening to 7 parameters becomes unnecessary for now, afaics. Jan