From: Warner Losh <imp@bsdimp.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Ajeet Singh <itachis6234@gmail.com>,
qemu-devel@nongnu.org, Ajeet Singh <itachis@freebsd.org>,
Stacey Son <sson@freebsd.org>
Subject: Re: [PATCH 01/23] Add CPU initialization function
Date: Sat, 22 Jun 2024 12:37:10 -0600 [thread overview]
Message-ID: <CANCZdfpFcJ3wodLi4FsDNcPoyqiRF0dfEfkq1ahrsNCD5GM4kw@mail.gmail.com> (raw)
In-Reply-To: <843f41b3-5ade-47bf-9802-be94086e6168@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 2832 bytes --]
On Mon, Jun 17, 2024 at 10:17 PM Richard Henderson <
richard.henderson@linaro.org> wrote:
> On 6/17/24 11:57, Ajeet Singh wrote:
> > From: Stacey Son <sson@FreeBSD.org>
> >
> > Addded function to initialize ARM CPU
> > and to check if it supports 64 bit mode
> >
> > Signed-off-by: Ajeet Singh <itachis@FreeBSD.org>
> > Signed-off-by: Stacey Son <sson@FreeBSD.org>
> > ---
> > bsd-user/aarch64/target_arch_cpu.h | 42 ++++++++++++++++++++++++++++++
> > 1 file changed, 42 insertions(+)
> > create mode 100644 bsd-user/aarch64/target_arch_cpu.h
> >
> > diff --git a/bsd-user/aarch64/target_arch_cpu.h
> b/bsd-user/aarch64/target_arch_cpu.h
> > new file mode 100644
> > index 0000000000..db5c7062b9
> > --- /dev/null
> > +++ b/bsd-user/aarch64/target_arch_cpu.h
> > @@ -0,0 +1,42 @@
> > +/*
> > + * ARM AArch64 cpu init and loop
> > + *
> > + * Copyright (c) 2015 Stacey Son
> > + *
> > + * This library is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2 of the License, or (at your option) any later version.
> > + *
> > + * This library is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> > + * Lesser General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Lesser General Public
> > + * License along with this library; if not, see <
> http://www.gnu.org/licenses/>.
> > + */
> > +
> > +#ifndef TARGET_ARCH_CPU_H
> > +#define TARGET_ARCH_CPU_H
> > +
> > +#include "target_arch.h"
> > +#include "target/arm/syndrome.h"
>
> Do you actually need syndrome.h?
>
It's needed, but not for this chunk. It is needed for patch 2 because we
start to use the syndrome functions there to dispatch / decode the traps.
So that should be moved to patch 2 in the next round, I think.
Also
Reviewed-by: Warner Losh <imp@bsdimp.com>
since this looks correct and I didn't write it :)
Warner
> Otherwise,
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> r~
>
> > +
> > +#define TARGET_DEFAULT_CPU_MODEL "any"
> > +
> > +static inline void target_cpu_init(CPUARMState *env,
> > + struct target_pt_regs *regs)
> > +{
> > + int i;
> > +
> > + if (!(arm_feature(env, ARM_FEATURE_AARCH64))) {
> > + fprintf(stderr, "The selected ARM CPU does not support 64 bit
> mode\n");
> > + exit(1);
> > + }
> > + for (i = 0; i < 31; i++) {
> > + env->xregs[i] = regs->regs[i];
> > + }
> > + env->pc = regs->pc;
> > + env->xregs[31] = regs->sp;
> > +}
>
>
[-- Attachment #2: Type: text/html, Size: 4032 bytes --]
next prev parent reply other threads:[~2024-06-22 18:38 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 18:57 [PATCH 00/23] ARM AArch64 Support for BSD Ajeet Singh
2024-06-17 18:57 ` [PATCH 01/23] Add CPU initialization function Ajeet Singh
2024-06-18 4:17 ` Richard Henderson
2024-06-22 18:37 ` Warner Losh [this message]
2024-06-17 18:57 ` [PATCH 02/23] Added CPU loop function Ajeet Singh
2024-06-18 4:24 ` Richard Henderson
2024-06-22 18:49 ` Warner Losh
2024-06-23 16:30 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 03/23] Added function to clone CPU state Ajeet Singh
2024-06-18 4:27 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 04/23] AArch64 specific CPU for bsd-user Ajeet Singh
2024-06-18 4:28 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 05/23] Managing CPU register for BSD-USER Ajeet Singh
2024-06-18 4:28 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 06/23] Add Aarch64 register handling Ajeet Singh
2024-06-18 4:35 ` Richard Henderson
2024-06-23 20:37 ` Warner Losh
2024-06-17 18:57 ` [PATCH 07/23] Add ARM AArch64 TLS Management Prototypes for BSD-User Ajeet Singh
2024-06-18 4:38 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 08/23] Add Aarch64 sysarch() system call emulation for BSD-USER Ajeet Singh
2024-06-18 4:39 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 09/23] Add thread setup " Ajeet Singh
2024-06-18 22:07 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 10/23] Add thread initialization " Ajeet Singh
2024-06-18 22:10 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 11/23] Update ARM AArch64 VM parameter definitions for bsd-user Ajeet Singh
2024-06-18 22:16 ` Richard Henderson
2024-06-22 18:56 ` Warner Losh
2024-06-17 18:57 ` [PATCH 12/23] Add ability to get rval2 Ajeet Singh
2024-06-18 22:17 ` Richard Henderson
2024-06-23 22:48 ` Warner Losh
2024-06-17 18:57 ` [PATCH 13/23] Add ARM AArch64 ELF definitions for bsd-user Ajeet Singh
2024-06-18 22:18 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 14/23] Add ARM AArch64 hardware capability definitions Ajeet Singh
2024-06-18 22:20 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 15/23] Add function to retrieve ARM AArch64 hardware capabilities Ajeet Singh
2024-06-18 22:21 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 16/23] Add function to retrieve additional ARM AArch64 hwcap Ajeet Singh
2024-06-18 22:22 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 17/23] Add ARM AArch64 sigcode setup function for bsd-user Ajeet Singh
2024-06-18 22:32 ` Richard Henderson
2024-06-17 18:57 ` [PATCH 18/23] Add ARM AArch64 specific signal definitions " Ajeet Singh
2024-06-18 22:35 ` Richard Henderson
2024-06-17 18:58 ` [PATCH 19/23] Add ARM AArch64 signal trampoline argument setup " Ajeet Singh
2024-06-18 22:37 ` Richard Henderson
2024-06-17 18:58 ` [PATCH 20/23] Add get_mcontext function for ARM AArch64 in bsd-user Ajeet Singh
2024-06-18 22:47 ` Richard Henderson
2024-06-17 18:58 ` [PATCH 21/23] Add setup_sigframe_arch " Ajeet Singh
2024-06-18 22:49 ` Richard Henderson
2024-06-17 18:58 ` [PATCH 22/23] Add set_mcontext " Ajeet Singh
2024-06-18 22:50 ` Richard Henderson
2024-06-23 15:54 ` Warner Losh
2024-06-23 17:48 ` Richard Henderson
2024-06-17 18:58 ` [PATCH 23/23] Add get_ucontext_sigreturn function Ajeet Singh
2024-06-18 22:56 ` Richard Henderson
2024-06-23 16:01 ` Warner Losh
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=CANCZdfpFcJ3wodLi4FsDNcPoyqiRF0dfEfkq1ahrsNCD5GM4kw@mail.gmail.com \
--to=imp@bsdimp.com \
--cc=itachis6234@gmail.com \
--cc=itachis@freebsd.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sson@freebsd.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).