Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-2…
Browse files Browse the repository at this point in the history
…0210417' into staging

Fixes for rc4:
 * Fix compile failures of C++ files with new glib headers
 * mps3-an547: Use correct Cortex-M55 CPU and don't disable its FPU
 * accel/tcg: Fix assertion failure executing from non-RAM with -icount

# gpg: Signature made Sat 17 Apr 2021 20:39:58 BST
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20210417:
  accel/tcg: avoid re-translating one-shot instructions
  target/arm: drop CF_LAST_IO/dc->condjump check
  hw/arm/armsse: Make SSE-300 use Cortex-M55
  hw/arm/armsse: Give SSE-300 its own Property array
  include/qemu/osdep.h: Move system includes to top
  osdep: protect qemu/osdep.h with extern "C"
  osdep: include glib-compat.h before other QEMU headers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Apr 17, 2021
2 parents 8fe9f1f + 277aed9 commit 0c5393a
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 22 deletions.
2 changes: 1 addition & 1 deletion accel/tcg/translate-all.c
Expand Up @@ -1863,7 +1863,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,

if (phys_pc == -1) {
/* Generate a one-shot TB with 1 insn in it */
cflags = (cflags & ~CF_COUNT_MASK) | 1;
cflags = (cflags & ~CF_COUNT_MASK) | CF_LAST_IO | 1;
}

max_insns = cflags & CF_COUNT_MASK;
Expand Down
2 changes: 1 addition & 1 deletion disas/arm-a64.cc
Expand Up @@ -17,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

extern "C" {
#include "qemu/osdep.h"
extern "C" {
#include "disas/dis-asm.h"
}

Expand Down
2 changes: 1 addition & 1 deletion disas/nanomips.cpp
Expand Up @@ -27,8 +27,8 @@
* Reference Manual", Revision 01.01, April 27, 2018
*/

extern "C" {
#include "qemu/osdep.h"
extern "C" {
#include "disas/dis-asm.h"
}

Expand Down
24 changes: 19 additions & 5 deletions hw/arm/armsse.c
Expand Up @@ -56,6 +56,7 @@ typedef struct ARMSSEDeviceInfo {

struct ARMSSEInfo {
const char *name;
const char *cpu_type;
uint32_t sse_version;
int sram_banks;
int num_cpus;
Expand Down Expand Up @@ -84,7 +85,7 @@ static Property iotkit_properties[] = {
DEFINE_PROP_END_OF_LIST()
};

static Property armsse_properties[] = {
static Property sse200_properties[] = {
DEFINE_PROP_LINK("memory", ARMSSE, board_memory, TYPE_MEMORY_REGION,
MemoryRegion *),
DEFINE_PROP_UINT32("EXP_NUMIRQ", ARMSSE, exp_numirq, 64),
Expand All @@ -97,6 +98,17 @@ static Property armsse_properties[] = {
DEFINE_PROP_END_OF_LIST()
};

static Property sse300_properties[] = {
DEFINE_PROP_LINK("memory", ARMSSE, board_memory, TYPE_MEMORY_REGION,
MemoryRegion *),
DEFINE_PROP_UINT32("EXP_NUMIRQ", ARMSSE, exp_numirq, 64),
DEFINE_PROP_UINT32("SRAM_ADDR_WIDTH", ARMSSE, sram_addr_width, 15),
DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000),
DEFINE_PROP_BOOL("CPU0_FPU", ARMSSE, cpu_fpu[0], true),
DEFINE_PROP_BOOL("CPU0_DSP", ARMSSE, cpu_dsp[0], true),
DEFINE_PROP_END_OF_LIST()
};

static const ARMSSEDeviceInfo iotkit_devices[] = {
{
.name = "timer0",
Expand Down Expand Up @@ -490,6 +502,7 @@ static const ARMSSEInfo armsse_variants[] = {
{
.name = TYPE_IOTKIT,
.sse_version = ARMSSE_IOTKIT,
.cpu_type = ARM_CPU_TYPE_NAME("cortex-m33"),
.sram_banks = 1,
.num_cpus = 1,
.sys_version = 0x41743,
Expand All @@ -508,6 +521,7 @@ static const ARMSSEInfo armsse_variants[] = {
{
.name = TYPE_SSE200,
.sse_version = ARMSSE_SSE200,
.cpu_type = ARM_CPU_TYPE_NAME("cortex-m33"),
.sram_banks = 4,
.num_cpus = 2,
.sys_version = 0x22041743,
Expand All @@ -519,13 +533,14 @@ static const ARMSSEInfo armsse_variants[] = {
.has_cpuid = true,
.has_cpu_pwrctrl = false,
.has_sse_counter = false,
.props = armsse_properties,
.props = sse200_properties,
.devinfo = sse200_devices,
.irq_is_common = sse200_irq_is_common,
},
{
.name = TYPE_SSE300,
.sse_version = ARMSSE_SSE300,
.cpu_type = ARM_CPU_TYPE_NAME("cortex-m55"),
.sram_banks = 2,
.num_cpus = 1,
.sys_version = 0x7e00043b,
Expand All @@ -537,7 +552,7 @@ static const ARMSSEInfo armsse_variants[] = {
.has_cpuid = true,
.has_cpu_pwrctrl = true,
.has_sse_counter = true,
.props = armsse_properties,
.props = sse300_properties,
.devinfo = sse300_devices,
.irq_is_common = sse300_irq_is_common,
},
Expand Down Expand Up @@ -708,8 +723,7 @@ static void armsse_init(Object *obj)
name = g_strdup_printf("armv7m%d", i);
object_initialize_child(OBJECT(&s->cluster[i]), name, &s->armv7m[i],
TYPE_ARMV7M);
qdev_prop_set_string(DEVICE(&s->armv7m[i]), "cpu-type",
ARM_CPU_TYPE_NAME("cortex-m33"));
qdev_prop_set_string(DEVICE(&s->armv7m[i]), "cpu-type", info->cpu_type);
g_free(name);
name = g_strdup_printf("arm-sse-cpu-container%d", i);
memory_region_init(&s->cpu_container[i], obj, name, UINT64_MAX);
Expand Down
6 changes: 6 additions & 0 deletions include/qemu/compiler.h
Expand Up @@ -11,6 +11,12 @@
#define QEMU_STATIC_ANALYSIS 1
#endif

#ifdef __cplusplus
#define QEMU_EXTERN_C extern "C"
#else
#define QEMU_EXTERN_C extern
#endif

#define QEMU_NORETURN __attribute__ ((__noreturn__))

#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
Expand Down
38 changes: 29 additions & 9 deletions include/qemu/osdep.h
Expand Up @@ -57,7 +57,7 @@
#define daemon qemu_fake_daemon_function
#include <stdlib.h>
#undef daemon
extern int daemon(int, int);
QEMU_EXTERN_C int daemon(int, int);
#endif

#ifdef _WIN32
Expand Down Expand Up @@ -104,13 +104,37 @@ extern int daemon(int, int);
#include <setjmp.h>
#include <signal.h>

#ifdef CONFIG_IOVEC
#include <sys/uio.h>
#endif

#if defined(__linux__) && defined(__sparc__)
/* The SPARC definition of QEMU_VMALLOC_ALIGN needs SHMLBA */
#include <sys/shm.h>
#endif

#ifndef _WIN32
#include <sys/wait.h>
#else
#define WIFEXITED(x) 1
#define WEXITSTATUS(x) (x)
#endif

#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif

/*
* This is somewhat like a system header; it must be outside any extern "C"
* block because it includes system headers itself, including glib.h,
* which will not compile if inside an extern "C" block.
*/
#include "glib-compat.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifdef _WIN32
#include "sysemu/os-win32.h"
#endif
Expand All @@ -119,11 +143,6 @@ extern int daemon(int, int);
#include "sysemu/os-posix.h"
#endif

#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif

#include "glib-compat.h"
#include "qemu/typedefs.h"

/*
Expand Down Expand Up @@ -459,7 +478,6 @@ void qemu_anon_ram_free(void *ptr, size_t size);
/* Use 1 MiB (segment size) alignment so gmap can be used by KVM. */
# define QEMU_VMALLOC_ALIGN (256 * 4096)
#elif defined(__linux__) && defined(__sparc__)
#include <sys/shm.h>
# define QEMU_VMALLOC_ALIGN MAX(qemu_real_host_page_size, SHMLBA)
#else
# define QEMU_VMALLOC_ALIGN qemu_real_host_page_size
Expand Down Expand Up @@ -539,8 +557,6 @@ struct iovec {

ssize_t readv(int fd, const struct iovec *iov, int iov_cnt);
ssize_t writev(int fd, const struct iovec *iov, int iov_cnt);
#else
#include <sys/uio.h>
#endif

#ifdef _WIN32
Expand Down Expand Up @@ -722,4 +738,8 @@ static inline int platform_does_not_support_system(const char *command)
}
#endif /* !HAVE_SYSTEM_FUNCTION */

#ifdef __cplusplus
}
#endif

#endif
5 changes: 0 additions & 5 deletions target/arm/translate.c
Expand Up @@ -9199,11 +9199,6 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
{
DisasContext *dc = container_of(dcbase, DisasContext, base);

if (tb_cflags(dc->base.tb) & CF_LAST_IO && dc->condjmp) {
/* FIXME: This can theoretically happen with self-modifying code. */
cpu_abort(cpu, "IO on conditional branch instruction");
}

/* At this stage dc->condjmp will only be set when the skipped
instruction was a conditional branch or trap, and the PC has
already been written. */
Expand Down

0 comments on commit 0c5393a

Please sign in to comment.