qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Helge Deller <deller@gmx.de>, Anton Johansson <anjo@rev.ng>
Subject: Re: [PATCH v2 4/6] hw/hppa: Move CPU::kernel_entry -> Machine::boot_info.gr25
Date: Fri, 10 Oct 2025 10:54:40 -0700	[thread overview]
Message-ID: <df6c8e6e-931b-4403-802f-50977ea6d3e5@linaro.org> (raw)
In-Reply-To: <20251010061836.45739-5-philmd@linaro.org>

On 10/9/25 23:18, Philippe Mathieu-Daudé wrote:
> Current code uses CPUHPPAState::@kernel_entry to hold either:
>   - kernel entry virtual address
>   - firmware interactive mode
> and CPUHPPAState::@cmdline_or_bootorder to either:
>   - kernel &cmdline physical address
>   - firmware boot order
> 
> Besides, these variables don't belong to CPUHPPAState, they
> depend on how the machine is started, and only apply to the
> first CPU.
> 
> The MachineReset handler initialize some registers of the
> first CPU. Hold these register reset values in the MachineState,
> initializing them once in machine_HP_common_init_tail().
> 
> Start by addressing the kernel entry and firmware interactive
> mode values, stored in $GP25.
> 
> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/hppa/cpu.h |  1 -
>   hw/hppa/machine.c | 28 ++++++++++++++++------------
>   2 files changed, 16 insertions(+), 13 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

> -    }
> -
> -    if (!kernel_entry) {
> +    } else {
>           /* When booting via firmware, tell firmware if we want interactive
> -         * mode (kernel_entry=1), and to boot from CD (cmdline_or_bootorder='d')
> +         * mode (interactive_mode=1), and to boot from CD (cmdline_or_bootorder='d')
>            * or hard disc (cmdline_or_bootorder='c').
>            */
> -        kernel_entry = machine->boot_config.has_menu ? machine->boot_config.menu : 0;
> +        hms->boot_info.gr25 = machine->boot_config.has_menu
> +                            ? machine->boot_config.menu
> +                            : 0;

There is no interactive_mode variable, so the change to the comment isn't great.  Perhaps 
just mention gr25.

As an aside, the expression involves two booleans, so better written as

   machine->boot_config.has_menu && machine->boot_config.menu


r~


  reply	other threads:[~2025-10-10 17:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10  6:18 [PATCH v2 0/6] hw/hppa: Clarify machine variables and move them out of CPUArchState Philippe Mathieu-Daudé
2025-10-10  6:18 ` [PATCH v2 1/6] hw/hppa: Convert type_init() -> DEFINE_TYPES() Philippe Mathieu-Daudé
2025-10-10  6:18 ` [PATCH v2 2/6] hw/hppa: Factor QOM HPPA_COMMON_MACHINE out Philippe Mathieu-Daudé
2025-10-10  6:18 ` [PATCH v2 3/6] hw/hppa: Reduce variables scope in common_init() Philippe Mathieu-Daudé
2025-10-10 17:23   ` Richard Henderson
2025-10-10  6:18 ` [PATCH v2 4/6] hw/hppa: Move CPU::kernel_entry -> Machine::boot_info.gr25 Philippe Mathieu-Daudé
2025-10-10 17:54   ` Richard Henderson [this message]
2025-10-10  6:18 ` [PATCH v2 5/6] hw/hppa: Move CPU::cmdline_or_bootorder -> Machine::boot_info.gr24 Philippe Mathieu-Daudé
2025-10-10 17:57   ` Richard Henderson
2025-10-10  6:18 ` [PATCH v2 6/6] hw/hppa: Move CPU::initrd_base/end -> Machine::boot_info.gr22/23 Philippe Mathieu-Daudé
2025-10-10 17:59   ` Richard Henderson

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=df6c8e6e-931b-4403-802f-50977ea6d3e5@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=anjo@rev.ng \
    --cc=deller@gmx.de \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.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).