[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About support for memory event on AMD CPUs


  • To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Untitled YAN <yanluyi2010@xxxxxxxxxxx>
  • Date: Wed, 24 Nov 2021 13:44:42 +0000
  • Accept-language: en-US, zh-CN
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=il5+ogFAcdQMC7nu3Iu4mtSU5dxI8anSX8Bhz37xE0c=; b=mJYgoPgSeUwttDsXta0X4Wx3herDlgd3RJ4B/ACuZsyHV0wKBZyYt4T48M+AozH1nNmBzhML44vLxiJy6LvTsMIGRlzo7jg3E02OP+xUcdCeUBN++9YGVpIBFCXdjT+a8vD83sowYR24WmTZj8PmcHZw7cnDbmEhphfUS/fts0dmCJ8kZQCIqEzYEjNx6JHDyqBWaYuYVaeSZhLV6bsJl0UWycVhD/vAO4QZyrG7pCJmm1K+RFewqdjnJh1Or8VEl2NvCBp/OMa+oHDv59wQTp9B3dFsOEuH6zdzOiLnMr51XoZ0qvMx+a81hnlvq0vboKqv3m/XO0hzqXJ6yfLg7w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RG9pcXMboDeLdiNI0DbagK4sv1S93AK4C3xiprZvigygmAAAGgg8eNYnqmQ7zt6o8LgOPud/gYoF7BkD570q+kJJgGV3Fphcfpx/P0464hVdrCeL/hvZwy+fDaSIBZbQUYOCG6bG1pO3M/c0IjLD5MV7jUxr5TcGipQVSeCsDT2e8PfEJh54+AUs93Yd4kUPCYeSSo3xbSgZx84XJn9qp/LIiPwHIUJuM0fmsS4UUKn74Rvlf82zwCF4SaqWg3+vhDmPBCKcnIdBJpcez4aOI/9QqsRSWImjUSq1xqJPVeGM+mC9G2mMNIjf1iMU9CQzgqfvdmLcs9bo2oHS/rc8hQ==
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Nov 2021 13:45:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Suggested_attachment_session_id: e24b8c69-a59a-21e3-b83d-bb67fda0c2d9
  • Thread-index: AQHX4Ivyto+Oc0SSQ0aRZryw/8JAG6wST82AgAAO3bCAAAtgAIAAATxXgAA9XwCAAAS3GA==
  • Thread-topic: About support for memory event on AMD CPUs

Original email:

From: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
Sent: Wednesday, November 24, 2021 21:12
To: Untitled YAN <yanluyi2010@xxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>; Alexandru Isaila 
<aisaila@xxxxxxxxxxxxxxx>; Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>; 
Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: About support for memory event on AMD CPUs 
 
> Altp2m is only available on Intel, mem_access (restricting permissions) is 
> only available on Intel and ARM. No technical reason for it not working on 
> AMD, it just hasn't been implemented in Xen.
> 
> Tamas
> 
> On Wed, Nov 24, 2021, 4:44 AM Untitled YAN <yanluyi2010@xxxxxxxxxxx> wrote:
> Original email:
> 
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, November 24, 2021 17:27
> To: Untitled YAN <yanluyi2010@xxxxxxxxxxx>
> Cc: tamas@xxxxxxxxxxxxx <tamas@xxxxxxxxxxxxx>; aisaila@xxxxxxxxxxxxxxx 
> <aisaila@xxxxxxxxxxxxxxx>; ppircalabu@xxxxxxxxxxxxxxx 
> <ppircalabu@xxxxxxxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx 
> <xen-devel@lists.xenproject.> org>
> Subject: Re: About support for memory event on AMD CPUs 
>  
> > On 24.11.2021 10:23, Untitled YAN wrote:
> > > Original email:
> > > 
> > > From: Jan Beulich <jbeulich@xxxxxxxx>
> > > Sent: Wednesday, November 24, 2021 15:54
> > > To: YAN Untitled <yanluyi2010@xxxxxxxxxxx>
> > > Cc: tamas@xxxxxxxxxxxxx <tamas@xxxxxxxxxxxxx>; aisaila@xxxxxxxxxxxxxxx 
> > > <aisaila@xxxxxxxxxxxxxxx>; ppircalabu@xxxxxxxxxxxxxxx 
> > > <ppircalabu@xxxxxxxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx 
> > > <xen-devel@lists.x > enproject.>org>
> > > Subject: Re: About support for memory event on AMD CPUs 
> > >  
> > >> On 23.11.2021 18:14, YAN Untitled wrote:
> > >>> Dear developers,
> > >>>
> > >>> Short version: is memory event supported on AMD CPUs or is it going to 
> > >>> be
> > >>> supported?
> > >>>
> > >>> Long version:
> > >>>
> > >>> Environment: LibVMI 0.15.0 + Xen 4.14.3 on an **AMD CPU** (5950x), 
> > >>> 64-bit
> > >>> Debian 11 Dom0.
> > >>>
> > >>> What I am trying to accomplish: register a **memory event** handler, so 
> > >>> that
> > >>> I can capture all memory accesses within a specific range issued by any 
> > >>> thread,
> > >>> or all memory accesses within any range issued by a specific thread.
> > >>>
> > >>> What I got instead: an error from LibVMI saying
> > >>> "xc_hvm_set_mem_access failed with code: -1".
> > >>>
> > >>> Some investigation: by inspecting the source code of LibVMI, I find the 
> > >>> direct
> > >>> cause is one of the libxc functions, 1) xc_set_mem_access or
> > >>> 2) xc_altp2m_set_mem_access, returned error code -1.
> > >>>
> > >>> After some searching, I found someone else having a similar problem 
> > >>> [1]. I also
> > >>> noted LibVMI says:
> > >>>
> > >>>> Currently only the Xen Hypervisor provides these features,
> > >>>> and some of these are specifically only available on Intel CPUs
> > >>>
> > >>> However, I can't find the exact confirmation for the availability of 
> > >>> memory
> > >>> event on AMD CPUs from https://wiki.xenproject.org.
> > >>
> > >> Aiui underlying what you want is altp2m, which presently depends (in
> > >> the hypervisor) on EPT being available (and in use for the guest in
> > >> question).
> > >>
> > >> Jan
> > > 
> > > Dear Jan,
> > > 
> > > Thanks for your reply. I really appreciate the information. After some
> > > searching with the keyword "EPT" I found [1]. So I checked on dom0 with
> > > "xl dmesg | grep HAP", which says:
> > > 
> > >> (XEN) HVM: Hardware Assisted Paging (HAP) detected
> > >> (XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
> > > 
> > > And the guest is an HVM guest running Debian 10 with kernel v4.16 built 
> > > from
> > > source. Most of the configuration of the guest is generated by 
> > > virt-manager.
> > > The "xl list -l" shows that there is no explicit configuration for EPT, 
> > > RVI or
> > > HAP, but it does say the "type" is "hvm".
> > 
> > HAP is the term covering EPT on the Intel side and NPT for AMD.
> > 
> > Jan
> 
> Dear Jan,
> 
> Yeah that's why I wanted to confirm if the HAP is enabled for the guest - it
> turns out it is enabled but for some reason, xc_altp2m_set_mem_access failed.
> I am trying to replicate my setup on an Intel machine to find out if it's a
> configuration problem. Still don't know if it's implemented for AMD but thanks
> for your help and information.
> 
> 
> Untitled YAN

Dear Tamas,

Thanks for your clear answer. So I will watch the update note, or maybe I will
try to get an Intel machine for my experiments. Thanks!


Untitled YAN



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.