xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stefano Stabellini <stefano.stabellini@xilinx.com>,
	andrew.cooper3@citrix.com, julien@xen.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] xen: introduce XENFEAT_direct_mapped and XENFEAT_not_direct_mapped
Date: Mon, 1 Mar 2021 10:10:01 +0100	[thread overview]
Message-ID: <ed3b997c-a741-2e71-dc5b-4bc68ed22087@suse.com> (raw)
In-Reply-To: <20210226225217.2137-1-sstabellini@kernel.org>

On 26.02.2021 23:52, Stefano Stabellini wrote:
> Introduce two feature flags to tell the domain whether it is
> direct-mapped or not. It allows the guest kernel to make informed
> decisions on things such as swiotlb-xen enablement.
> 
> The introduction of both flags (XENFEAT_direct_mapped and
> XENFEAT_not_direct_mapped) allows the guest kernel to avoid any
> guesswork if one of the two is present, or fallback to the current
> checks if neither of them is present.
> 
> XENFEAT_direct_mapped is always set for not auto-translated guests.
> 
> For auto-translated guests, only Dom0 on ARM is direct-mapped. Also,
> see is_domain_direct_mapped() which refers to auto-translated guests:
> xen/include/asm-arm/domain.h:is_domain_direct_mapped
> xen/include/asm-x86/domain.h:is_domain_direct_mapped
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
preferably with one cosmetic aspect taken care of:

> --- a/xen/common/kernel.c
> +++ b/xen/common/kernel.c
> @@ -560,6 +560,10 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>                               (1U << XENFEAT_hvm_callback_vector) |
>                               (has_pirq(d) ? (1U << XENFEAT_hvm_pirqs) : 0);
>  #endif
> +            if ( is_domain_direct_mapped(d) || !paging_mode_translate(d) )

While I realize the left side of the || is what you're after,
I'd generally see the more common/universal/whatever-you-want-
to-call-it condition be checked first, and the most special
purpose one last. IOW I'd prefer if both side of the || could
be swapped.

Jan


  reply	other threads:[~2021-03-01  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 22:52 [PATCH v2] xen: introduce XENFEAT_direct_mapped and XENFEAT_not_direct_mapped Stefano Stabellini
2021-03-01  9:10 ` Jan Beulich [this message]
2021-03-01  9:26 ` Julien Grall

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=ed3b997c-a741-2e71-dc5b-4bc68ed22087@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).