All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andre Przywara <Andre.Przywara@arm.com>
Subject: Re: [PATCH v2] xen/arm: do not read MVFR2 when is not defined
Date: Mon, 11 Jan 2021 18:21:54 +0000	[thread overview]
Message-ID: <F715A994-7B47-4171-84F8-5BE912985784@arm.com> (raw)
In-Reply-To: <dce8bed2-db66-b032-06a9-86c8f80d26aa@xen.org>

Hi Julien,

Sorry for the delay but I was on holiday until today.

> On 11 Jan 2021, at 10:25, Julien Grall <julien@xen.org> wrote:
> 
> Hi Jan,
> 
> On 11/01/2021 08:49, Jan Beulich wrote:
>> On 08.01.2021 20:22, Stefano Stabellini wrote:
>>> MVFR2 is not available on ARMv7. It is available on ARMv8 aarch32 and
>>> aarch64. If Xen reads MVFR2 on ARMv7 it could crash.
>>> 
>>> Avoid the issue by doing the following:
>>> 
>>> - define MVFR2_MAYBE_UNDEFINED on arm32
>>> - if MVFR2_MAYBE_UNDEFINED, do not attempt to read MVFR2 in Xen
>>> - keep the 3rd register_t in struct cpuinfo_arm.mvfr on arm32 so that a
>>>   guest read to the register returns '0' instead of crashing the guest.
>>> 
>>> '0' is an appropriate value to return to the guest because it is defined
>>> as "no support for miscellaneous features".
>>> 
>>> Aarch64 Xen is not affected by this patch.
>> But it looks to also be affected by ...
> 
> AFAICT, the smoke test passed on Laxton0 (AMD Seattle) [1] over the week-end.
> 
>>> Fixes: 9cfdb489af81 ("xen/arm: Add ID registers and complete cpuinfo")
>> ... this, faulting (according to osstest logs) early during boot on
> 
> The xen-unstable flight [2] ran on Rochester0 (Cavium Thunder-X). So this has something to do with the platform.
> 
> The main difference is AMD Seattle supports AArch32 while Cavium Thunder-X doesn't.
> 
>> 000000000025D314	mrs	x1, id_pfr2_el1
> This register contains information for the AArch32 state.
> 
> AFAICT, the Arm Arm back to at least ARM DDI 0487A.j (published in 2016) described the encoding as Read-Only. So I am not sure why we receive an UNDEF here, the more it looks like ID_PFR{0, 1}_EL1 were correctly accessed.
> 
> Andre, Bertrand, do you have any clue?

I will double check this but my understanding when I checked this was that it would be possible to read with an unknown value but should not generate an UNDEF.

> 
> However, most of the AArch32 ID registers are UNKNOWN on platform not implementing AArch32. So we may want to conditionally skip the access to AArch32 state.

We could skip aarch32 registers on platforms not supporting aarch32 but we will still have to provide values to a guest trying to access them so might be better to return what is returned by the hardware.
Now if some platforms are generating an UNDEF we need to understand in what cases and behave the same way for the guest.

Do i understand it right that on Cavium which has no aarch32 support the access is generating an UNDEF ?

Cheers
Bertrand

> 
> Cheers,
> 
> [1] http://logs.test-lab.xenproject.org/osstest/logs/158293/test-arm64-arm64-xl-xsm/info.html
> 
>> Jan
> 
> [1]
> 
> 
> -- 
> Julien Grall



  reply	other threads:[~2021-01-11 18:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 19:22 [PATCH v2] xen/arm: do not read MVFR2 when is not defined Stefano Stabellini
2021-01-08 19:31 ` Julien Grall
2021-01-08 19:51   ` Stefano Stabellini
2021-01-11  8:49 ` Jan Beulich
2021-01-11 10:25   ` Julien Grall
2021-01-11 18:21     ` Bertrand Marquis [this message]
2021-01-11 18:50       ` Julien Grall
2021-01-11 19:02         ` Bertrand Marquis
2021-01-11 19:07           ` Julien Grall
2021-01-11 19:14             ` Bertrand Marquis

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=F715A994-7B47-4171-84F8-5BE912985784@arm.com \
    --to=bertrand.marquis@arm.com \
    --cc=Andre.Przywara@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=jbeulich@suse.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 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.