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

Re: Memory Layout on Dom0 in PV


  • To: Charles Gonçalves <charles.fg@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 16 Apr 2021 16:11:52 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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-SenderADCheck; bh=KWWL7CR8EoXv923pllvuDqD9L8dNPnts1UxMNYePXE0=; b=CGzyA+85s9dpgao6a7d3Ia+WC5cimiEzejCFsZ3h8hYcYrigtvLXGCTX7/khjqy7PeUWNyty4xvDKC0K47Gn3gUeXMVQo+tKRRYI0zIpmupnUJm1WTYZN1oyywjMr3RKPPThXxf8o7ik67gZUwDKrmm2VLPaCOY96ejofHuG1O+iTW3nsWgDYS+N4MxjDEHFLwnLiSTZjDPFFQ7zH3S7XTgAfDPmUGw/yLQqJ0wOFI97QAuzK4j9ZCc0sPGcrMWHNO14nQ/ftVHa0Lnta731rVl1grmPI8MzTun6YRjulhEMqZMdD+cG1u7CCOkkB2ObJFHkr0coaNvFDoLjRNtjag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RR85N4wQfMz5b05TdS8i+ymT8heTaiZtlTtUzFMPWSH+C/84B/iDfrsH2DWJTOz4jyA3C6S5ERFe5/Cgzht5g7+238kl24QCtgBwV3siIGF6/g+J+d6E+b+cwK4Axd7zRpsnQ7t1+lcK8h3M5IrxtZtQZ/sbRbz2Uw+jm/KuxI4KVTGciMqqiTcQcWg5V+uBRGzPskwAXEzbbLigeJpZRlOVJfbtZaoOwdVff3OEMTOtvUkKmTy9gtsAMMTSqiz91VAUDakqDWkB2iV+n3m7+5TbO96KpbZMp3NbeMt8ydeh/zqtXpruM++FBuSgqhGCN8+YDGnf82142KZibVVN+Q==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Delivery-date: Fri, 16 Apr 2021 15:12:11 +0000
  • Ironport-hdrordr: A9a23:h3+NdaxFXabKVmFFnURsKrPx9uskLtp033Aq2lEZdDV8btGYm8 eynP4SyB/zj3IrVGs9nM2bUZPsfVr385lp7Y4NeYqzRQWOghrMEKhOz6vHhwfhFSr36/JH2c 5bGZRWJdXsATFB4vrSzxK/F78bruWv1ICNqaPgw2x2TQdsApsQjTtRLgqACEV5SE1nKPMCdK a03cZMqzq+dXl/VK3SakUtZOTfu8bN0KvvfB9uPXUawTOThjCl4qOSKWn64j4iVVp0oIsKwC z+vCHSoo6itPy6zRG07R6o071m3OHP5/EGKMiFis0+IijhhACydO1aKsC/lQFwms6DwhIHl8 TNvgcBMq1Img/sV1DwmzTB8U3B1ysj8HDrw1PwuwqdneXJAAgUJuAEoKAxSGq812MQ+OtS/Y gO4kei871QNh/ElDSV3amxazha0nCajFBnrfQelBVkIOwjQY4Ul6Mz1mVPHqwNGSrrgbpXa9 VGPYXn6PFafUjyVQG+gkBfhNilXnEEFhybWEQ1usuMzzhMnHxipnFovfAiog==
  • Ironport-sdr: 5+ac5G0MjFHFuc+soWDQmrr9avdV9LvjyMGnz/vDi7LS9GRma1UUL+lLdA2P7TlwydRXh1fnUM InmORrNl1eTa+vIfRTGl+TP5OQGlv70XznWB0uHmkRvAGmVpiFU5dwEGneTXODErrp4Lcfvtq4 s46mTdE/FQeHuNy3vaA3Q8gY+EOgVmN/POyjU95m9VoOa6SV6BFjiWs/uv9w8kPeWRI9Tc2J9R egRbVo2rLEkE16LHhG905ryRp3w7W0fzATaIuuVlmw4psEBN9I5jipVxTokqNqzapGypnah+Kz K60=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/04/2021 15:58, Charles Gonçalves wrote:

Hello Guys,

Does memory on Dom0 also mapped to gpfn or it is mapped directly to mfn? 

 If mapped to gpfn, how can I access its p2m mapping?

I'm trying to use the xen-mfndump but it is not working with dom0

./xen-mfndump dump-p2m 0                                                                          
xc: error: Could not map the shared info frame (MFN 0xddfe9) (3 = No such process): Internal error
xc: error: Could not map domain 0 memory information: Internal error

The problem that I'm wanting to solve is:

Given a va in a process on dom0, I can get its physical representation (mfn or gpfn depending on how this works on PV) using /proc/pid/pagemap and with this I can access its real mfn.

This works perfectly with domU but not with dom0, why?


There are a lot of operations you're not permitted to perform on yourself, to prevent problems.

I think in this case, Xen is rejecting dom0's attempt to foreign map itself (although -EINVAL would be better than -ESRCH to fail with, IMO), because otherwise we get into reference counting issues IIRC.

You'll probably have an easier time asking the dom0 kernel to dump the p2m.  After all, its a kernel-owned datastructure, not a Xen-owned structure.

~Andrew

 


Rackspace

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