All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Chenxu Wang <irakatz51@gmail.com>
Cc: kvmarm@lists.cs.columbia.edu
Subject: Re: Problems about Stage-2 translation
Date: Mon, 18 Oct 2021 11:06:35 +0100	[thread overview]
Message-ID: <87zgr6odec.wl-maz@kernel.org> (raw)
In-Reply-To: <CAFLP=uDY-Eh6gvA2UvAtd=u1wa61tg9TAmdnqiJGZE+Yan8PpA@mail.gmail.com>

Wang,

Please don't top-post, and stick to plain text instead of HTML.

On Mon, 18 Oct 2021 09:36:05 +0100,
Chenxu Wang <irakatz51@gmail.com> wrote:
> 
> Hi Marc,
> 
> Thanks for your help. I studied the kvm_handle_guest_abort() handler, and
> basically know the reason for "return 0".
> But I still cannot solve the mapping problem.
> 
> I want to find a function or APIs, whose input parameters are (1) region
> base IPA and size (2) mapped PA in Host (if IPA=PA, it could be better) (3)
> R/W/X attributes.
> Then, when I call the func(IPA start, IPA end, PA start, attr), I can get
> the map.

There is no such function, because that's not how KVM works.

> Where should I follow? Should I follow the "translation fault path" again?
> Or create the mapping function by myself?

Neither. You cannot directly map random physical ranges into a VM.
Memory that gets mapped into a VM needs to be exposed by userspace in
the form of a memslot. KVM will then map that memory on demand as the
guest accesses it.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2021-10-18 10:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16 12:21 Problems about Stage-2 translation Chenxu Wang
2021-10-16 21:19 ` Marc Zyngier
2021-10-18  8:36   ` Chenxu Wang
2021-10-18 10:06     ` Marc Zyngier [this message]
2021-10-18 19:01       ` Chenxu Wang
2021-10-18 19:31         ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgr6odec.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=irakatz51@gmail.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.