Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: Nadav Amit <namit@vmware.com>
Cc: Shaoqin Huang <shahuang@redhat.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Nikos Nikoleris <nikos.nikoleris@arm.com>
Subject: Re: [kvm-unit-tests PATCH 1/2] arm64: set sctlr_el1.SPAN
Date: Mon, 17 Jul 2023 08:52:18 +0200	[thread overview]
Message-ID: <20230717-085f1ee1d631f213544fed03@orel> (raw)
In-Reply-To: <20230717-52b1cacc323e5105506e5079@orel>

On Mon, Jul 17, 2023 at 08:50:30AM +0200, Andrew Jones wrote:
> On Fri, Jul 14, 2023 at 06:42:25PM +0000, Nadav Amit wrote:
> > 
> > 
> > > On Jul 14, 2023, at 4:29 AM, Shaoqin Huang <shahuang@redhat.com> wrote:
> > > 
> > > !! External Email
> > > 
> > > Hi,
> > > 
> > > On 7/14/23 18:31, Alexandru Elisei wrote:
> > >> Hi,
> > >> 
> > >> On Sat, Jun 17, 2023 at 01:31:37AM +0000, Nadav Amit wrote:
> > >>> From: Nadav Amit <namit@vmware.com>
> > >>> 
> > >>> Do not assume PAN is not supported or that sctlr_el1.SPAN is already set.
> > >> 
> > >> In arm/cstart64.S
> > >> 
> > >> .globl start
> > >> start:
> > >>         /* get our base address */
> > >>      [..]
> > >> 
> > >> 1:
> > >>         /* zero BSS */
> > >>      [..]
> > >> 
> > >>         /* zero and set up stack */
> > >>      [..]
> > >> 
> > >>         /* set SCTLR_EL1 to a known value */
> > >>         ldr     x4, =INIT_SCTLR_EL1_MMU_OFF
> > >>      [..]
> > >> 
> > >>         /* set up exception handling */
> > >>         bl      exceptions_init
> > >>      [..]
> > >> 
> > >> Where in lib/arm64/asm/sysreg.h:
> > >> 
> > >> #define SCTLR_EL1_RES1  (_BITUL(7) | _BITUL(8) | _BITUL(11) | _BITUL(20) | \
> > >>                          _BITUL(22) | _BITUL(23) | _BITUL(28) | _BITUL(29))
> > >> #define INIT_SCTLR_EL1_MMU_OFF  \
> > >>                         SCTLR_EL1_RES1
> > >> 
> > >> Look like bit 23 (SPAN) should be set.
> > >> 
> > >> How are you seeing SCTLR_EL1.SPAN unset?
> > > 
> > > Yeah. the sctlr_el1.SPAN has always been set by the above flow. So Nadav
> > > you can describe what you encounter with more details. Like which tests
> > > crash you encounter, and how to reproduce it.
> > 
> > I am using Nikos’s work to run the test using EFI, not from QEMU.
> > 
> > So the code that you mentioned - which is supposed to initialize SCTLR -
> > is not executed (and actually not part of the EFI image).
> > 
> > Note that using EFI, the entry point is _start [1], and not “start”.
> > 
> > That is also the reason lack of BSS zeroing also caused me issues with the
> > EFI setup, which I reported before.
> 
> Nadav,
> 
> 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.

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?

Thanks,
drew

  reply	other threads:[~2023-07-17  6:52 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 [this message]
2023-07-17  8:53             ` Nikos Nikoleris
2023-07-17 17:05               ` Nadav Amit
2023-07-18  8:44                 ` Alexandru Elisei
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=20230717-085f1ee1d631f213544fed03@orel \
    --to=andrew.jones@linux.dev \
    --cc=alexandru.elisei@arm.com \
    --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