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=-5.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 D4BCEC433E0 for ; Thu, 18 Jun 2020 11:55:47 +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 AE4192070A for ; Thu, 18 Jun 2020 11:55:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE4192070A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlt8j-0003iV-QC; Thu, 18 Jun 2020 11:55:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlt8i-0003iQ-4p for xen-devel@lists.xenproject.org; Thu, 18 Jun 2020 11:55:28 +0000 X-Inumbo-ID: 995a614e-b15a-11ea-8496-bc764e2007e4 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 995a614e-b15a-11ea-8496-bc764e2007e4; Thu, 18 Jun 2020 11:55:27 +0000 (UTC) Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: CveAVyGHF0CqV5F/97PfNZUCLyjpXZyf5EDwD6GISBNuzu4Q8mr9ZOushC1k0UR/HaqcEWfvL8 9QZ7FRw47aX84jhFRkSjIg4/k3C6qiwxyFucQCteozJXjvzOY9YA58E5ujHrjob67oIN9altol UQjRU1byJUVa/9dpSZM2497mIE39BDW0sZBfzHz/nP1jNVfQCNv8QmSC654skFw3M8d/LS8Bgq 1kXLHNIJ65KpBtbSy2X1jRqlF4qqkpl+fnxEx3yaaNvSGxcv8CnmMESsnLDk5u9sm8jNh2A//G Twc= X-SBRS: 2.7 X-MesageID: 20706045 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,526,1583211600"; d="scan'208";a="20706045" Date: Thu, 18 Jun 2020 13:55:19 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: =?utf-8?Q?Micha=C5=82_Leszczy=C5=84ski?= Subject: Re: [PATCH v1 4/7] x86/vmx: add do_vmtrace_op Message-ID: <20200618115519.GL735@Air-de-Roger> References: <1548605014.8764792.1592320576239.JavaMail.zimbra@cert.pl> <34833328.8766172.1592320926648.JavaMail.zimbra@cert.pl> <20200616172352.GT735@Air-de-Roger> <998292451.9258672.1592421185726.JavaMail.zimbra@cert.pl> <832789003.9534743.1592478099057.JavaMail.zimbra@cert.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <832789003.9534743.1592478099057.JavaMail.zimbra@cert.pl> X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Tamas K Lengyel , Ian Jackson , George Dunlap , Jan Beulich , Andrew Cooper , Xen-devel Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Thu, Jun 18, 2020 at 01:01:39PM +0200, Michał Leszczyński wrote: > ----- 18 cze 2020 o 5:20, Tamas K Lengyel tamas.k.lengyel@gmail.com napisał(a): > > >> >> + > >> >> + a.mfn = v->arch.hvm.vmx.ipt_state->output_base >> PAGE_SHIFT; > >> > > >> > This will not work for translated domains, ie: a PVH or HVM domain > >> > won't be able to use this interface since it has no way to request the > >> > mapping of a specific mfn into it's physmap. I think we need to take > >> > this into account when deciding how the interface should be, so that > >> > we don't corner ourselves with a PV only interface. > >> > >> Please be aware that this is only going to be used by Dom0. Is is well-supported > >> case that somebody is using PVH/HVM Dom0? > >> > >> I think that all Virtual Machine Introspection stuff currently requires to have > >> Dom0 PV. Our main goal is to have this working well in combo with VMI. > > > > FYI the VMI interface doesn't require a PV domain. It works fine from > > PVH dom0 or even from a secondary privileged HVM DomU as well, > > provided you have the right XSM policy to allow that. > > > > Tamas > > > It was previously stated that: > > > PVH or HVM domain > > won't be able to use this interface since it has no way to request the > > mapping of a specific mfn into it's physmap. > > but however, taking LibVMI as an example: > > https://github.com/libvmi/libvmi/blob/c461e20ae88bc62c08c27f50fcead23c27a30f9e/libvmi/driver/xen/xen.c#L51 > > An essential abstraction xen_get_memory() relies on xc_map_foreign_range(). Doesn't this mean that it's not usable from PVH or HVM domains, or did I got it all wrong? That was my fault, so the buffer mfns are assigned to Xen, and then the Xen domain ID is used to map those, which should work on both PV and HVM (or PVH). I still think using XENMEM_acquire_resource might be better, but I would let others comment. Roger.