-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'pull-tcg-20230810' of https://gitlab.com/rth7680/qemu into…
… staging accel/tcg: Avoid reading too much in load_atom_{2,4} tests/tcg: ensure system-mode gdb tests start stopped gdbstub: more fixes for client Ctrl-C handling # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmTVJ4EdHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV+/iAf9EUojONGO1FQCUokR # +8kfHFaGH5R5U4v6Zd6xlwHt94iagW8s+DdpM/YdmgZFxQ5jglCCsLOXQYtJ/HPu # McKRv86Yr264ysrwYzTuyOLIC585UU0KzYbGBQvjCSeQ43Au5bR/3ec35Lwgm7OO # eukLdpmuD4QoSgBmVgkbziKH1zaX8NjgPoWGfFqxfzzWUZBfU4VfyLgGKw2gtqoz # fMTORiqbnzSvQfYINNJ0qBTyXWm0YmydDzaK6zfBrsCzdMk3JYksxgneItvqgRar # A5UAYUPhBPftIyTAnI3PQo+siyuaDhFRU9BwHb25a/pkuOUg8PBFO2HruseLmmdl # bPcnhQ== # =7c0w # -----END PGP SIGNATURE----- # gpg: Signature made Thu 10 Aug 2023 11:08:01 AM PDT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate] * tag 'pull-tcg-20230810' of https://gitlab.com/rth7680/qemu: gdbstub: don't complain about preemptive ACK chars gdbstub: more fixes for client Ctrl-C handling tests/tcg: ensure system-mode gdb tests start stopped accel/tcg: Avoid reading too much in load_atom_{2,4} Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
- Loading branch information
Showing
6 changed files
with
59 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <sys/mman.h> | ||
#include <sys/shm.h> | ||
#include <unistd.h> | ||
#include <stdio.h> | ||
|
||
int main() | ||
{ | ||
int psize = getpagesize(); | ||
int id; | ||
void *p; | ||
|
||
/* | ||
* We need a shared mapping to enter CF_PARALLEL mode. | ||
* The easiest way to get that is shmat. | ||
*/ | ||
id = shmget(IPC_PRIVATE, 2 * psize, IPC_CREAT | 0600); | ||
if (id < 0) { | ||
perror("shmget"); | ||
return 2; | ||
} | ||
p = shmat(id, NULL, 0); | ||
if (p == MAP_FAILED) { | ||
perror("shmat"); | ||
return 2; | ||
} | ||
|
||
/* Protect the second page. */ | ||
if (mprotect(p + psize, psize, PROT_NONE) < 0) { | ||
perror("mprotect"); | ||
return 2; | ||
} | ||
|
||
/* | ||
* Load 4 bytes, 6 bytes from the end of the page. | ||
* On success this will load 0 from the newly allocated shm. | ||
*/ | ||
return *(int *)(p + psize - 6); | ||
} |