Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp980945iob; Fri, 13 May 2022 18:28:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkdg9SB0Gn1jKnsvUIOHc1d7xYRAQVWfqtT2y13tgBulaScCDxe6noOA+y6m2HMGZvfAZJ X-Received: by 2002:a05:600c:b46:b0:394:30df:b95e with SMTP id k6-20020a05600c0b4600b0039430dfb95emr6779625wmr.25.1652491707870; Fri, 13 May 2022 18:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652491707; cv=none; d=google.com; s=arc-20160816; b=vR91ug+/nB1Z9M8sVLZeRQlKXA0iuQL8J/5EqCHk2vBbZ7hhq6YzT9TDRsyES6Ecaz K5W6jrJC+ALrGBOAhAR6d/mJckWJAhoQjwl3xOdUg7BgqdI9at9YyGLy6F+aA4cqqzeB flAexrNnmPZf6bFqoqi4NqRqXlg+YK9c8Sss26CzE2Qod5YkdGlROrW0RIP3ig5NCDMd bMwBOwWgmBF2jevuBLFX7Yh3TmF5T0gCTwuwCqR5N1gyYiXbASKfMbQyDl9SWEvFlozV qoP7O8sDUWUecFEiI0HSFj6oz9obK+h9t+jx9U9zSYS+MLS41senunDsENdpy2K9LwKl PO4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=JVSYPB75WopPdL5IDbCdFRmwfkP9AIBR2VAPe7ZHLtE=; b=rK6n4lciXV9yzT9JmvlH9LJIdrUgHtpfGgsgFZex3v9ANP2Rc/1TKxUyYaXvSHZDcx TsqtoEeANhI+q4dNQ6HkkYc8nPB0Ge4knFrTqNmA6O8tyVJq8tOn/WzH2yOioN84AdmZ uUhW4IaKHQPKJPW2MJqwKbM80yz9H+kMpeB00IAGOC39pC6mrKB/l61VLU9EZsiGdUN5 MNzZArqJ+PD3Rr+aKqm8j+JPPBpblu2K8tYFK8fo2mReyYL7UJJ7hmS25l0i6A1f5RVu Gto1u5S4Zb/5olhRyKYfNsQwx35YJ40x9cgOTqktKJURhmobHJj6zFFoYjTROq+/SNZ6 pmLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HWfBYkHh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x17-20020a7bc211000000b00393ebee0e19si6682129wmi.121.2022.05.13.18.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:28:27 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HWfBYkHh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C345E3F0040; Fri, 13 May 2022 16:57:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378093AbiEMPPL (ORCPT + 99 others); Fri, 13 May 2022 11:15:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381809AbiEMPPB (ORCPT ); Fri, 13 May 2022 11:15:01 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7402656C18; Fri, 13 May 2022 08:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652454900; x=1683990900; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=px2gXoFjNpJE9vOVgtdtDq3mf97BJY5Gb4Y2uSDouZw=; b=HWfBYkHhyoEDXP/HX92XHIFqjRjQx9eTA6iwEHu9e6gmIxNGbJOVNEk/ H0MspkSI4vk8FALQFMuRBtQ7ZVipp4z2VABUgRTGga6m1wnNN4i0eszbz mZNtA6I4PW4hZlI9HvP1y3KBTmKgfKpB3de+vdfYhR59acxsI3W/0Nfdl O248/ibzZVeP8Wx3NLNnI+g15UNlP8eYKF5btBkoP1E4jf+lKLaYyNsVB XFKWJGSDDfYs4cZw7rt+fACbg+IFtIxYO1qT+B+Ktm2r0dEWMYC2JdnjZ 7i1XjKaAi/BOYnSf0G+PNrWRdOQ0sEHkifWXdQzVE1guznxyN7sLL+G7O Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="252373500" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="252373500" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 08:14:56 -0700 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="595263034" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.36.190]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 08:14:53 -0700 Message-ID: Date: Fri, 13 May 2022 18:14:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.8.1 Subject: Re: [PATCH 6/6] perf intel-pt: Add guest_code support Content-Language: en-US To: Andi Kleen Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , Leo Yan , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kvm@vger.kernel.org References: <20220513090237.10444-1-adrian.hunter@intel.com> <20220513090237.10444-7-adrian.hunter@intel.com> <875ym9h4mt.fsf@linux.intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <875ym9h4mt.fsf@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/05/22 17:46, Andi Kleen wrote: > Adrian Hunter writes: > >> A common case for KVM test programs is that the guest object code can be >> found in the hypervisor process (i.e. the test program running on the >> host). To support that, a new option "--guest-code" has been added in >> previous patches. >> >> In this patch, add support also to Intel PT. >> >> In particular, ensure guest_code thread is set up before attempting to >> walk object code or synthesize samples. > > Can you make it clear in the documentation what parts runs on the host > and what parts on the guest? That is up to the test program. All the host thread maps are copied, so perf tools doesn't have to know. > > I'm still not fully sure how it exactly finds the code on the host, > how is the code transferred? I don't know. From a quick look at the code in tools/testing/selftests/kvm/lib/kvm_util.c it seems to be using KVM_SET_USER_MEMORY_REGION IOCTL. > > Other than that more support for this use case is very useful. > > -Andi