Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Nadav Amit <namit@vmware.com>
Cc: Nikos Nikoleris <nikos.nikoleris@arm.com>,
	Andrew Jones <andrew.jones@linux.dev>,
	Shaoqin Huang <shahuang@redhat.com>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [kvm-unit-tests PATCH 1/2] arm64: set sctlr_el1.SPAN
Date: Tue, 18 Jul 2023 09:44:26 +0100	[thread overview]
Message-ID: <ZLZQ6r4-9mVdg4Ry@monolith.localdoman> (raw)
In-Reply-To: <4C6E9B6F-1879-48FB-98B6-6F271982067D@vmware.com>

Hi,

On Mon, Jul 17, 2023 at 05:05:06PM +0000, Nadav Amit wrote:
> Combining the answers to Andrew and Nikos.
> 
> On Jul 17, 2023, at 1:53 AM, Nikos Nikoleris <nikos.nikoleris@arm.com> wrote:
> > 
> >>> 
> >>> Would you mind reposting this along with the BSS zeroing patch, the
> >>> way I proposed we do that, and anything else you've discovered when
> >>> trying to use the EFI unit tests without QEMU? We'll call that our
> >>> first non-QEMU EFI support series, since the first EFI series was
> >>> only targeting QEMU.
> 
> I need to rehash the solution that you proposed for BSS (if there is
> anything special there). I had a different workaround for that issue,
> because IIRC I had some issues with the zeroing. I’ll give it another
> 
> >> 
> >> Oh, and I meant to mention that, when reposting this patch, maybe we
> >> can consider managing sctlr in a similar way to the non-efi start path?
> >> 
> 
> I am afraid of turning on random bits on SCTLR. Arguably, the way that

What do you mean by turning on random bits on SCTLR? All the functional
bits are documented in the architecture. Same goes for RES1 (it's in the
Glossary).

> the non-efi test sets the default value of SCTLR (with no naming of the
> different bits) is not very friendly.

That's because as the architecture gets updated, what used to be a RES1 bit
becomes a functional bit. The only sane way to handle this is to disable
all the features you don't support, **and** set all the RES1 bits (and
clear RES0 bits), to disable any newly introduced features you don't know
about yet which were left enabled by software running at a higher privilege
level.

You can send a patch if you want to give a name to the bits which have
become functional since SCTLR_EL1_RES1 was introduced.

Thanks,
Alex

> 
> I will have a look on the other bits of SCTLR and see if I can do something
> quick and simple, but I don’t want to refactor things in a way that might
> break things.
> 
> > 
> > Nadav, if you are running baremetal, it might be worth checking what EL
> > you're running in as well. If HW is implementing EL2, EFI will handover
> > in EL2.
> 
> I don’t. I run the test on a different hypervisor. When I enabled the x86
> tests to run on a different hypervisor years ago, there were many many
> test and real issues that required me to run KVM-unit-tests on bare
> metal - and therefore I fixed these tests to run on bare-metal as well.
> 
> With ARM, excluding the BSS and the SCTLR issue, I didn’t encounter any
> additional test issues. So I don’t have the need or time to enable it
> to run on bare-metal… sorry.
>  

  reply	other threads:[~2023-07-18  8:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17  1:31 [kvm-unit-tests PATCH 0/2] arm64: fix paging issues Nadav Amit
2023-06-17  1:31 ` [kvm-unit-tests PATCH 1/2] arm64: set sctlr_el1.SPAN Nadav Amit
2023-06-25 19:44   ` Nadav Amit
2023-07-07 18:26   ` Nadav Amit
2023-07-14 10:31   ` Alexandru Elisei
2023-07-14 11:29     ` Shaoqin Huang
2023-07-14 18:42       ` Nadav Amit
2023-07-17  6:50         ` Andrew Jones
2023-07-17  6:52           ` Andrew Jones
2023-07-17  8:53             ` Nikos Nikoleris
2023-07-17 17:05               ` Nadav Amit
2023-07-18  8:44                 ` Alexandru Elisei [this message]
2023-07-19  5:42                   ` Nadav Amit
2023-06-17  1:31 ` [kvm-unit-tests PATCH 2/2] arm64: ensure tlbi is safe Nadav Amit
2023-07-14 10:55   ` Alexandru Elisei
2023-07-14 17:20     ` Nadav Amit

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=ZLZQ6r4-9mVdg4Ry@monolith.localdoman \
    --to=alexandru.elisei@arm.com \
    --cc=andrew.jones@linux.dev \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=namit@vmware.com \
    --cc=nikos.nikoleris@arm.com \
    --cc=shahuang@redhat.com \
    /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