Re: #!shebang

2024-11-20 Thread lacsaP Patatetom
Le mer. 20 nov. 2024 à 10:37, lacsaP Patatetom  a
écrit :

> hi,
>
> I'd like to use an executable file as a configuration file for `qemu`
> using a shebang : let me explain.
>
> I currently store my configuration like this in `configuration.qemu` :
> ```
> -argument
>
> - argument -option
>
> -etc...
> ```
>
> and I call `qemu` like this and it works as expected :
> `$ qemu $(
> which corresponds to the following command line :
> `$ qemu -argument -argument -option -etc...`
>
> I can also add additional/temporary arguments/options on the command line
> if I wish.
>
> I'd like to add comments to this configuration file :
> ```
> # this is a configuration file for...
>
> -argument
>
> # this option...
> -argument -option
>
> # add your own arguments/options here...
> -etc...
> ```
>
> but passed directly in this way, these comments become arguments/options
> for `qemu` :
> ```
> $ qemu $( qemu-system-x86_64: # this is a configuration file for...: Could not open
> '# this is a configuration file for...': No such file or directory
> ```
>
> I can eliminate them using `grep` like this :
> `$ qemu $(grep -v '^#' configuration.qemu)`
>
> but it seems to me complicated and time-consuming to enter.
>
> so I wanted to use `grep` as shebang :
> ```
> #!/usr/bin/grep -v '^#'
> # this is a configuration file for...
>
> -argument
>
> # this option...
> -argument -option
>
> # add your own arguments/options here...
> -etc...
> ```
>
> but it doesn't work as I'd hoped :
> ```
> $ qemu $(./configuration.qemu)
> /usr/bin/grep: invalid option -- ' '
> Usage: grep [OPTION]... PATTERNS [FILE]...
> Try 'grep --help' for more information.
> ```
>
> does anyone have an explanation or another way to get a commented
> configuration file ?
>
> regards, lacsaP.
>

`#!/usr/bin/env -S grep -v '^#'` as shebang works like a charm :-)
 (with env (GNU coreutils) 9.5)

regards, lascaP.


Re: QEMU v6.2 riscv64 device crash

2024-11-20 Thread Peter Maydell
On Wed, 20 Nov 2024 at 07:32, Yanfeng  wrote:
>
> Dear experts,
>
> I am running a rv64 binary program which uses hypervisor extension v0.6.1 on
> QEMU with "virt" board. The same RiscV program can run on both QEMU v6.0 and
> v6.1, but it led to crash of QEMU v6.2:
>
> ```
> ERROR:../..target/riscv/translate.c:232:get_gpr: code should not be reached
> Bail out! ERROR:../../target/riscv/translate.c:232:get_gpr: code should not be
> reached
> Aborted (core dumped)
> ```
>
> From GDB I can see the target is in VU mode, and the crash happens when the 
> code
> at 0x10152 is hit:
>
> ```
> 1014e <_start>:
>1014e:   0069e197  auipc gp,0x69e
>10152:   96218193  addi  gp,gp,-1694 # 6adab0 <__global_pointer$>
> ```
>
> Since I am too new to QEMU tracing, can someone teach how can I find out more
> information?

QEMU 6.2 is now several years old, so before investing too much
time in looking into this, I would suggest seeing if the bug
is still present in the most recent release (which is 9.1),
or on head-of-git. Even if you did identify the bug in 6.2,
that release is now so old that we are no longer doing stable
point releases for it, so it will never be fixed.

thanks
-- PMM



#!shebang

2024-11-20 Thread lacsaP Patatetom
hi,

I'd like to use an executable file as a configuration file for `qemu` using
a shebang : let me explain.

I currently store my configuration like this in `configuration.qemu` :
```
-argument

- argument -option

-etc...
```

and I call `qemu` like this and it works as expected :
`$ qemu $(

Re: #!shebang

2024-11-20 Thread G.W. Haywood

Hi there,

On Wed, 20 Nov 2024, lacsaP Patatetom wrote:


...
I can eliminate them using `grep` like this :
`$ qemu $(grep -v '^#' configuration.qemu)`

but it seems to me complicated and time-consuming to enter.
...
... another way ... ?


You could always use an alias, something like

alias qemugrep="qemu $(grep -v '^#' configuration.qemu)"

I use aliases a lot, for things like

alias l="ls -lrt"

--

73,
Ged.