1
Arm patches for rc3 : just a handful of bug fixes.
1
Last lot of target-arm changes to squeeze in before rc1:
2
* various minor Arm bug fixes
3
* David Carlier's Haiku build portability fixes
4
* Wentong Wu's fixes for icount handling in the nios2 target
2
5
3
thanks
6
The following changes since commit 00ce6c36b35e0eb8cc5d68a28f288a6335848813:
4
-- PMM
5
7
6
8
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-13' into staging (2020-07-13 13:01:30 +0100)
7
The following changes since commit 4ecc984210ca1bf508a96a550ec8a93a5f833f6c:
8
9
Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.2-rc3' into staging (2019-11-26 12:36:40 +0000)
10
9
11
are available in the Git repository at:
10
are available in the Git repository at:
12
11
13
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20191126
12
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200713
14
13
15
for you to fetch changes up to 6a4ef4e5d1084ce41fafa7d470a644b0fd3d9317:
14
for you to fetch changes up to 756f739b1682bf131994ec96dad7fbdf8b54493a:
16
15
17
target/arm: Honor HCR_EL2.TID3 trapping requirements (2019-11-26 13:55:37 +0000)
16
hw/arm/aspeed: Do not create and attach empty SD cards by default (2020-07-13 14:36:12 +0100)
18
17
19
----------------------------------------------------------------
18
----------------------------------------------------------------
20
target-arm queue:
19
target-arm queue:
21
* handle FTYPE flag correctly in v7M exception return
20
* hw/arm/bcm2836: Remove unused 'cpu_type' field
22
for v7M CPUs with an FPU (v8M CPUs were already correct)
21
* target/arm: Fix mtedesc for do_mem_zpz
23
* versal: Add the CRP as unimplemented
22
* Add the ability to change the FEC PHY MDIO device number on i.MX25/i.MX6/i.MX7
24
* Fix ISR_EL1 tracking when executing at EL2
23
* target/arm: Don't do raw writes for PMINTENCLR
25
* Honor HCR_EL2.TID3 trapping requirements
24
* virtio-iommu: Fix coverity issue in virtio_iommu_handle_command()
25
* build: Fix various issues with building on Haiku
26
* target/nios2: fix wrctl behaviour when using icount
27
* hw/arm/tosa: Encapsulate misc GPIO handling in a device
28
* hw/arm/palm.c: Encapsulate misc GPIO handling in a device
29
* hw/arm/aspeed: Do not create and attach empty SD cards by default
26
30
27
----------------------------------------------------------------
31
----------------------------------------------------------------
28
Edgar E. Iglesias (1):
32
Aaron Lindsay (1):
29
hw/arm: versal: Add the CRP as unimplemented
33
target/arm: Don't do raw writes for PMINTENCLR
30
34
31
Jean-Hugues Deschênes (1):
35
David CARLIER (8):
32
target/arm: Fix handling of cortex-m FTYPE flag in EXCRET
36
build: Enable BSD symbols for Haiku
37
util/qemu-openpty.c: Don't assume pty.h is glibc-only
38
build: Check that mlockall() exists
39
osdep.h: Always include <sys/signal.h> if it exists
40
osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL
41
bswap.h: Include <endian.h> on Haiku for bswap operations
42
util/compatfd.c: Only include <sys/syscall.h> if CONFIG_SIGNALFD
43
util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku
33
44
34
Marc Zyngier (2):
45
Eric Auger (1):
35
target/arm: Fix ISR_EL1 tracking when executing at EL2
46
virtio-iommu: Fix coverity issue in virtio_iommu_handle_command()
36
target/arm: Honor HCR_EL2.TID3 trapping requirements
37
47
38
include/hw/arm/xlnx-versal.h | 3 ++
48
Gerd Hoffmann (1):
39
hw/arm/xlnx-versal.c | 2 ++
49
util/drm: make portable by avoiding struct dirent d_type
40
target/arm/helper.c | 83 ++++++++++++++++++++++++++++++++++++++++++--
41
target/arm/m_helper.c | 7 ++--
42
4 files changed, 89 insertions(+), 6 deletions(-)
43
50
51
Jean-Christophe Dubois (3):
52
Add the ability to change the FEC PHY MDIO device number on i.MX25 processor
53
Add the ability to change the FEC PHY MDIO device number on i.MX6 processor
54
Add the ability to change the FEC PHY MDIO devices numbers on i.MX7 processor
55
56
Peter Maydell (4):
57
hw/arm/tosa.c: Detabify
58
hw/arm/tosa: Encapsulate misc GPIO handling in a device
59
hw/arm/palm.c: Detabify
60
hw/arm/palm.c: Encapsulate misc GPIO handling in a device
61
62
Philippe Mathieu-Daudé (2):
63
hw/arm/bcm2836: Remove unused 'cpu_type' field
64
hw/arm/aspeed: Do not create and attach empty SD cards by default
65
66
Richard Henderson (1):
67
target/arm: Fix mtedesc for do_mem_zpz
68
69
Wentong Wu (4):
70
target/nios2: add DISAS_NORETURN case for nothing more to generate
71
target/nios2: in line the semantics of DISAS_UPDATE with other targets
72
target/nios2: Use gen_io_start around wrctl instruction
73
hw/nios2: exit to main CPU loop only when unmasking interrupts
74
75
configure | 38 ++++++++++++-
76
include/hw/arm/bcm2836.h | 1 -
77
include/hw/arm/fsl-imx25.h | 1 +
78
include/hw/arm/fsl-imx6.h | 1 +
79
include/hw/arm/fsl-imx7.h | 1 +
80
include/qemu/bswap.h | 2 +
81
include/qemu/osdep.h | 6 +-
82
hw/arm/aspeed.c | 9 +--
83
hw/arm/fsl-imx25.c | 7 +++
84
hw/arm/fsl-imx6.c | 7 +++
85
hw/arm/fsl-imx7.c | 9 +++
86
hw/arm/palm.c | 111 +++++++++++++++++++++++++------------
87
hw/arm/tosa.c | 132 +++++++++++++++++++++++++++++---------------
88
hw/nios2/cpu_pic.c | 3 +-
89
hw/virtio/virtio-iommu.c | 1 +
90
hw/xen/xen-legacy-backend.c | 1 -
91
os-posix.c | 4 ++
92
target/arm/helper.c | 4 +-
93
target/arm/translate-sve.c | 2 +-
94
target/nios2/translate.c | 12 +++-
95
util/compatfd.c | 2 +
96
util/drm.c | 19 +++++--
97
util/oslib-posix.c | 20 ++++++-
98
util/qemu-openpty.c | 2 +-
99
24 files changed, 292 insertions(+), 103 deletions(-)
100
diff view generated by jsdifflib
New patch
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
2
3
The 'cpu_type' has been moved from BCM283XState to BCM283XClass
4
in commit 210f47840d, but we forgot to remove the old variable.
5
Do it now.
6
7
Fixes: 210f47840d ("hw/arm/bcm2836: Hardcode correct CPU type")
8
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
9
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
10
Message-id: 20200703200459.23294-1-f4bug@amsat.org
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
13
include/hw/arm/bcm2836.h | 1 -
14
1 file changed, 1 deletion(-)
15
16
diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h
17
index XXXXXXX..XXXXXXX 100644
18
--- a/include/hw/arm/bcm2836.h
19
+++ b/include/hw/arm/bcm2836.h
20
@@ -XXX,XX +XXX,XX @@ typedef struct BCM283XState {
21
DeviceState parent_obj;
22
/*< public >*/
23
24
- char *cpu_type;
25
uint32_t enabled_cpus;
26
27
struct {
28
--
29
2.20.1
30
31
diff view generated by jsdifflib
New patch
1
From: Richard Henderson <richard.henderson@linaro.org>
1
2
3
The mtedesc that was constructed was not actually passed in.
4
Found by Coverity (CID 1429996).
5
6
Fixes: d28d12f008e
7
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
8
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
9
Message-id: 20200706202345.193676-1-richard.henderson@linaro.org
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
target/arm/translate-sve.c | 2 +-
13
1 file changed, 1 insertion(+), 1 deletion(-)
14
15
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/target/arm/translate-sve.c
18
+++ b/target/arm/translate-sve.c
19
@@ -XXX,XX +XXX,XX @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,
20
desc = FIELD_DP32(desc, MTEDESC, ESIZE, 1 << msz);
21
desc <<= SVE_MTEDESC_SHIFT;
22
}
23
- desc = simd_desc(vsz, vsz, scale);
24
+ desc = simd_desc(vsz, vsz, desc | scale);
25
t_desc = tcg_const_i32(desc);
26
27
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
28
--
29
2.20.1
30
31
diff view generated by jsdifflib
New patch
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
1
2
3
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
4
Message-id: 9f8923ecd974160ae8f634c275b1100c2cbe66d7.1593806826.git.jcd@tribudubois.net
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
[PMM: updated for object_property_set_uint() argument reordering]
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
---
9
include/hw/arm/fsl-imx25.h | 1 +
10
hw/arm/fsl-imx25.c | 7 +++++++
11
2 files changed, 8 insertions(+)
12
13
diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h
14
index XXXXXXX..XXXXXXX 100644
15
--- a/include/hw/arm/fsl-imx25.h
16
+++ b/include/hw/arm/fsl-imx25.h
17
@@ -XXX,XX +XXX,XX @@ typedef struct FslIMX25State {
18
MemoryRegion rom[2];
19
MemoryRegion iram;
20
MemoryRegion iram_alias;
21
+ uint32_t phy_num;
22
} FslIMX25State;
23
24
/**
25
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
26
index XXXXXXX..XXXXXXX 100644
27
--- a/hw/arm/fsl-imx25.c
28
+++ b/hw/arm/fsl-imx25.c
29
@@ -XXX,XX +XXX,XX @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
30
epit_table[i].irq));
31
}
32
33
+ object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, &err);
34
qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]);
35
36
if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) {
37
@@ -XXX,XX +XXX,XX @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
38
&s->iram_alias);
39
}
40
41
+static Property fsl_imx25_properties[] = {
42
+ DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0),
43
+ DEFINE_PROP_END_OF_LIST(),
44
+};
45
+
46
static void fsl_imx25_class_init(ObjectClass *oc, void *data)
47
{
48
DeviceClass *dc = DEVICE_CLASS(oc);
49
50
+ device_class_set_props(dc, fsl_imx25_properties);
51
dc->realize = fsl_imx25_realize;
52
dc->desc = "i.MX25 SOC";
53
/*
54
--
55
2.20.1
56
57
diff view generated by jsdifflib
New patch
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
1
2
3
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
4
Message-id: 05a64e83eb1c0c865ac077b22c599425c024c02c.1593806826.git.jcd@tribudubois.net
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
[PMM: updated for object_property_set_uint() argument reordering]
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
---
9
include/hw/arm/fsl-imx6.h | 1 +
10
hw/arm/fsl-imx6.c | 7 +++++++
11
2 files changed, 8 insertions(+)
12
13
diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
14
index XXXXXXX..XXXXXXX 100644
15
--- a/include/hw/arm/fsl-imx6.h
16
+++ b/include/hw/arm/fsl-imx6.h
17
@@ -XXX,XX +XXX,XX @@ typedef struct FslIMX6State {
18
MemoryRegion caam;
19
MemoryRegion ocram;
20
MemoryRegion ocram_alias;
21
+ uint32_t phy_num;
22
} FslIMX6State;
23
24
25
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
26
index XXXXXXX..XXXXXXX 100644
27
--- a/hw/arm/fsl-imx6.c
28
+++ b/hw/arm/fsl-imx6.c
29
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
30
spi_table[i].irq));
31
}
32
33
+ object_property_set_uint(OBJECT(&s->eth), "phy-num", s->phy_num, &err);
34
qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]);
35
if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), errp)) {
36
return;
37
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
38
&s->ocram_alias);
39
}
40
41
+static Property fsl_imx6_properties[] = {
42
+ DEFINE_PROP_UINT32("fec-phy-num", FslIMX6State, phy_num, 0),
43
+ DEFINE_PROP_END_OF_LIST(),
44
+};
45
+
46
static void fsl_imx6_class_init(ObjectClass *oc, void *data)
47
{
48
DeviceClass *dc = DEVICE_CLASS(oc);
49
50
+ device_class_set_props(dc, fsl_imx6_properties);
51
dc->realize = fsl_imx6_realize;
52
dc->desc = "i.MX6 SOC";
53
/* Reason: Uses serial_hd() in the realize() function */
54
--
55
2.20.1
56
57
diff view generated by jsdifflib
New patch
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
1
2
3
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
4
Message-id: c850187322be9930e47c8b234c385a7d0da245cb.1593806826.git.jcd@tribudubois.net
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
[PMM: updated for object_property_set_uint() argument reordering]
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
---
9
include/hw/arm/fsl-imx7.h | 1 +
10
hw/arm/fsl-imx7.c | 9 +++++++++
11
2 files changed, 10 insertions(+)
12
13
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
14
index XXXXXXX..XXXXXXX 100644
15
--- a/include/hw/arm/fsl-imx7.h
16
+++ b/include/hw/arm/fsl-imx7.h
17
@@ -XXX,XX +XXX,XX @@ typedef struct FslIMX7State {
18
IMX7GPRState gpr;
19
ChipideaState usb[FSL_IMX7_NUM_USBS];
20
DesignwarePCIEHost pcie;
21
+ uint32_t phy_num[FSL_IMX7_NUM_ETHS];
22
} FslIMX7State;
23
24
enum FslIMX7MemoryMap {
25
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
26
index XXXXXXX..XXXXXXX 100644
27
--- a/hw/arm/fsl-imx7.c
28
+++ b/hw/arm/fsl-imx7.c
29
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
30
FSL_IMX7_ENET2_ADDR,
31
};
32
33
+ object_property_set_uint(OBJECT(&s->eth[i]), "phy-num",
34
+ s->phy_num[i], &error_abort);
35
object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
36
FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort);
37
qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
38
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
39
FSL_IMX7_PCIE_PHY_SIZE);
40
}
41
42
+static Property fsl_imx7_properties[] = {
43
+ DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0),
44
+ DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1),
45
+ DEFINE_PROP_END_OF_LIST(),
46
+};
47
+
48
static void fsl_imx7_class_init(ObjectClass *oc, void *data)
49
{
50
DeviceClass *dc = DEVICE_CLASS(oc);
51
52
+ device_class_set_props(dc, fsl_imx7_properties);
53
dc->realize = fsl_imx7_realize;
54
55
/* Reason: Uses serial_hds and nd_table in realize() directly */
56
--
57
2.20.1
58
59
diff view generated by jsdifflib
1
From: Marc Zyngier <maz@kernel.org>
1
From: Aaron Lindsay <aaron@os.amperecomputing.com>
2
2
3
HCR_EL2.TID3 mandates that access from EL1 to a long list of id
3
Raw writes to this register when in KVM mode can cause interrupts to be
4
registers traps to EL2, and QEMU has so far ignored this requirement.
4
raised (even when the PMU is disabled). Because the underlying state is
5
already aliased to PMINTENSET (which already provides raw write
6
functions), we can safely disable raw accesses to PMINTENCLR entirely.
5
7
6
This breaks (among other things) KVM guests that have PtrAuth enabled,
8
Signed-off-by: Aaron Lindsay <aaron@os.amperecomputing.com>
7
while the hypervisor doesn't want to expose the feature to its guest.
9
Message-id: 20200707152616.1917154-1-aaron@os.amperecomputing.com
8
To achieve this, KVM traps the ID registers (ID_AA64ISAR1_EL1 in this
9
case), and masks out the unsupported feature.
10
11
QEMU not honoring the trap request means that the guest observes
12
that the feature is present in the HW, starts using it, and dies
13
a horrible death when KVM injects an UNDEF, because the feature
14
*really* isn't supported.
15
16
Do the right thing by trapping to EL2 if HCR_EL2.TID3 is set.
17
18
Note that this change does not include trapping of the MVFR
19
registers from AArch32 (they are accessed via the VMRS
20
instruction and need to be handled in a different way).
21
22
Reported-by: Will Deacon <will@kernel.org>
23
Signed-off-by: Marc Zyngier <maz@kernel.org>
24
Tested-by: Will Deacon <will@kernel.org>
25
Message-id: 20191123115618.29230-1-maz@kernel.org
26
[PMM: added missing accessfn line for ID_AA4PFR2_EL1_RESERVED;
27
changed names of access functions to include _tid3]
28
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
29
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
30
---
12
---
31
target/arm/helper.c | 76 +++++++++++++++++++++++++++++++++++++++++++++
13
target/arm/helper.c | 4 ++--
32
1 file changed, 76 insertions(+)
14
1 file changed, 2 insertions(+), 2 deletions(-)
33
15
34
diff --git a/target/arm/helper.c b/target/arm/helper.c
16
diff --git a/target/arm/helper.c b/target/arm/helper.c
35
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
36
--- a/target/arm/helper.c
18
--- a/target/arm/helper.c
37
+++ b/target/arm/helper.c
19
+++ b/target/arm/helper.c
38
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo predinv_reginfo[] = {
20
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = {
39
REGINFO_SENTINEL
21
.resetvalue = 0x0 },
40
};
22
{ .name = "PMINTENCLR", .cp = 15, .crn = 9, .crm = 14, .opc1 = 0, .opc2 = 2,
41
23
.access = PL1_RW, .accessfn = access_tpm,
42
+static CPAccessResult access_aa64_tid3(CPUARMState *env, const ARMCPRegInfo *ri,
24
- .type = ARM_CP_ALIAS | ARM_CP_IO,
43
+ bool isread)
25
+ .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW,
44
+{
26
.fieldoffset = offsetof(CPUARMState, cp15.c9_pminten),
45
+ if ((arm_current_el(env) < 2) && (arm_hcr_el2_eff(env) & HCR_TID3)) {
27
.writefn = pmintenclr_write, },
46
+ return CP_ACCESS_TRAP_EL2;
28
{ .name = "PMINTENCLR_EL1", .state = ARM_CP_STATE_AA64,
47
+ }
29
.opc0 = 3, .opc1 = 0, .crn = 9, .crm = 14, .opc2 = 2,
48
+
30
.access = PL1_RW, .accessfn = access_tpm,
49
+ return CP_ACCESS_OK;
31
- .type = ARM_CP_ALIAS | ARM_CP_IO,
50
+}
32
+ .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW,
51
+
33
.fieldoffset = offsetof(CPUARMState, cp15.c9_pminten),
52
+static CPAccessResult access_aa32_tid3(CPUARMState *env, const ARMCPRegInfo *ri,
34
.writefn = pmintenclr_write },
53
+ bool isread)
35
{ .name = "CCSIDR", .state = ARM_CP_STATE_BOTH,
54
+{
55
+ if (arm_feature(env, ARM_FEATURE_V8)) {
56
+ return access_aa64_tid3(env, ri, isread);
57
+ }
58
+
59
+ return CP_ACCESS_OK;
60
+}
61
+
62
void register_cp_regs_for_features(ARMCPU *cpu)
63
{
64
/* Register all the coprocessor registers based on feature bits */
65
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
66
{ .name = "ID_PFR0", .state = ARM_CP_STATE_BOTH,
67
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 0,
68
.access = PL1_R, .type = ARM_CP_CONST,
69
+ .accessfn = access_aa32_tid3,
70
.resetvalue = cpu->id_pfr0 },
71
/* ID_PFR1 is not a plain ARM_CP_CONST because we don't know
72
* the value of the GIC field until after we define these regs.
73
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
74
{ .name = "ID_PFR1", .state = ARM_CP_STATE_BOTH,
75
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 1,
76
.access = PL1_R, .type = ARM_CP_NO_RAW,
77
+ .accessfn = access_aa32_tid3,
78
.readfn = id_pfr1_read,
79
.writefn = arm_cp_write_ignore },
80
{ .name = "ID_DFR0", .state = ARM_CP_STATE_BOTH,
81
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 2,
82
.access = PL1_R, .type = ARM_CP_CONST,
83
+ .accessfn = access_aa32_tid3,
84
.resetvalue = cpu->id_dfr0 },
85
{ .name = "ID_AFR0", .state = ARM_CP_STATE_BOTH,
86
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 3,
87
.access = PL1_R, .type = ARM_CP_CONST,
88
+ .accessfn = access_aa32_tid3,
89
.resetvalue = cpu->id_afr0 },
90
{ .name = "ID_MMFR0", .state = ARM_CP_STATE_BOTH,
91
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 4,
92
.access = PL1_R, .type = ARM_CP_CONST,
93
+ .accessfn = access_aa32_tid3,
94
.resetvalue = cpu->id_mmfr0 },
95
{ .name = "ID_MMFR1", .state = ARM_CP_STATE_BOTH,
96
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 5,
97
.access = PL1_R, .type = ARM_CP_CONST,
98
+ .accessfn = access_aa32_tid3,
99
.resetvalue = cpu->id_mmfr1 },
100
{ .name = "ID_MMFR2", .state = ARM_CP_STATE_BOTH,
101
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 6,
102
.access = PL1_R, .type = ARM_CP_CONST,
103
+ .accessfn = access_aa32_tid3,
104
.resetvalue = cpu->id_mmfr2 },
105
{ .name = "ID_MMFR3", .state = ARM_CP_STATE_BOTH,
106
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 7,
107
.access = PL1_R, .type = ARM_CP_CONST,
108
+ .accessfn = access_aa32_tid3,
109
.resetvalue = cpu->id_mmfr3 },
110
{ .name = "ID_ISAR0", .state = ARM_CP_STATE_BOTH,
111
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 0,
112
.access = PL1_R, .type = ARM_CP_CONST,
113
+ .accessfn = access_aa32_tid3,
114
.resetvalue = cpu->isar.id_isar0 },
115
{ .name = "ID_ISAR1", .state = ARM_CP_STATE_BOTH,
116
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 1,
117
.access = PL1_R, .type = ARM_CP_CONST,
118
+ .accessfn = access_aa32_tid3,
119
.resetvalue = cpu->isar.id_isar1 },
120
{ .name = "ID_ISAR2", .state = ARM_CP_STATE_BOTH,
121
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 2,
122
.access = PL1_R, .type = ARM_CP_CONST,
123
+ .accessfn = access_aa32_tid3,
124
.resetvalue = cpu->isar.id_isar2 },
125
{ .name = "ID_ISAR3", .state = ARM_CP_STATE_BOTH,
126
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 3,
127
.access = PL1_R, .type = ARM_CP_CONST,
128
+ .accessfn = access_aa32_tid3,
129
.resetvalue = cpu->isar.id_isar3 },
130
{ .name = "ID_ISAR4", .state = ARM_CP_STATE_BOTH,
131
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 4,
132
.access = PL1_R, .type = ARM_CP_CONST,
133
+ .accessfn = access_aa32_tid3,
134
.resetvalue = cpu->isar.id_isar4 },
135
{ .name = "ID_ISAR5", .state = ARM_CP_STATE_BOTH,
136
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 5,
137
.access = PL1_R, .type = ARM_CP_CONST,
138
+ .accessfn = access_aa32_tid3,
139
.resetvalue = cpu->isar.id_isar5 },
140
{ .name = "ID_MMFR4", .state = ARM_CP_STATE_BOTH,
141
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 6,
142
.access = PL1_R, .type = ARM_CP_CONST,
143
+ .accessfn = access_aa32_tid3,
144
.resetvalue = cpu->id_mmfr4 },
145
{ .name = "ID_ISAR6", .state = ARM_CP_STATE_BOTH,
146
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 7,
147
.access = PL1_R, .type = ARM_CP_CONST,
148
+ .accessfn = access_aa32_tid3,
149
.resetvalue = cpu->isar.id_isar6 },
150
REGINFO_SENTINEL
151
};
152
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
153
{ .name = "ID_AA64PFR0_EL1", .state = ARM_CP_STATE_AA64,
154
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 0,
155
.access = PL1_R, .type = ARM_CP_NO_RAW,
156
+ .accessfn = access_aa64_tid3,
157
.readfn = id_aa64pfr0_read,
158
.writefn = arm_cp_write_ignore },
159
{ .name = "ID_AA64PFR1_EL1", .state = ARM_CP_STATE_AA64,
160
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 1,
161
.access = PL1_R, .type = ARM_CP_CONST,
162
+ .accessfn = access_aa64_tid3,
163
.resetvalue = cpu->isar.id_aa64pfr1},
164
{ .name = "ID_AA64PFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
165
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 2,
166
.access = PL1_R, .type = ARM_CP_CONST,
167
+ .accessfn = access_aa64_tid3,
168
.resetvalue = 0 },
169
{ .name = "ID_AA64PFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
170
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 3,
171
.access = PL1_R, .type = ARM_CP_CONST,
172
+ .accessfn = access_aa64_tid3,
173
.resetvalue = 0 },
174
{ .name = "ID_AA64ZFR0_EL1", .state = ARM_CP_STATE_AA64,
175
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 4,
176
.access = PL1_R, .type = ARM_CP_CONST,
177
+ .accessfn = access_aa64_tid3,
178
/* At present, only SVEver == 0 is defined anyway. */
179
.resetvalue = 0 },
180
{ .name = "ID_AA64PFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
181
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 5,
182
.access = PL1_R, .type = ARM_CP_CONST,
183
+ .accessfn = access_aa64_tid3,
184
.resetvalue = 0 },
185
{ .name = "ID_AA64PFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
186
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 6,
187
.access = PL1_R, .type = ARM_CP_CONST,
188
+ .accessfn = access_aa64_tid3,
189
.resetvalue = 0 },
190
{ .name = "ID_AA64PFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
191
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 7,
192
.access = PL1_R, .type = ARM_CP_CONST,
193
+ .accessfn = access_aa64_tid3,
194
.resetvalue = 0 },
195
{ .name = "ID_AA64DFR0_EL1", .state = ARM_CP_STATE_AA64,
196
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 0,
197
.access = PL1_R, .type = ARM_CP_CONST,
198
+ .accessfn = access_aa64_tid3,
199
.resetvalue = cpu->id_aa64dfr0 },
200
{ .name = "ID_AA64DFR1_EL1", .state = ARM_CP_STATE_AA64,
201
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 1,
202
.access = PL1_R, .type = ARM_CP_CONST,
203
+ .accessfn = access_aa64_tid3,
204
.resetvalue = cpu->id_aa64dfr1 },
205
{ .name = "ID_AA64DFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
206
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 2,
207
.access = PL1_R, .type = ARM_CP_CONST,
208
+ .accessfn = access_aa64_tid3,
209
.resetvalue = 0 },
210
{ .name = "ID_AA64DFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
211
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 3,
212
.access = PL1_R, .type = ARM_CP_CONST,
213
+ .accessfn = access_aa64_tid3,
214
.resetvalue = 0 },
215
{ .name = "ID_AA64AFR0_EL1", .state = ARM_CP_STATE_AA64,
216
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 4,
217
.access = PL1_R, .type = ARM_CP_CONST,
218
+ .accessfn = access_aa64_tid3,
219
.resetvalue = cpu->id_aa64afr0 },
220
{ .name = "ID_AA64AFR1_EL1", .state = ARM_CP_STATE_AA64,
221
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 5,
222
.access = PL1_R, .type = ARM_CP_CONST,
223
+ .accessfn = access_aa64_tid3,
224
.resetvalue = cpu->id_aa64afr1 },
225
{ .name = "ID_AA64AFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
226
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 6,
227
.access = PL1_R, .type = ARM_CP_CONST,
228
+ .accessfn = access_aa64_tid3,
229
.resetvalue = 0 },
230
{ .name = "ID_AA64AFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
231
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 7,
232
.access = PL1_R, .type = ARM_CP_CONST,
233
+ .accessfn = access_aa64_tid3,
234
.resetvalue = 0 },
235
{ .name = "ID_AA64ISAR0_EL1", .state = ARM_CP_STATE_AA64,
236
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 0,
237
.access = PL1_R, .type = ARM_CP_CONST,
238
+ .accessfn = access_aa64_tid3,
239
.resetvalue = cpu->isar.id_aa64isar0 },
240
{ .name = "ID_AA64ISAR1_EL1", .state = ARM_CP_STATE_AA64,
241
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 1,
242
.access = PL1_R, .type = ARM_CP_CONST,
243
+ .accessfn = access_aa64_tid3,
244
.resetvalue = cpu->isar.id_aa64isar1 },
245
{ .name = "ID_AA64ISAR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
246
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 2,
247
.access = PL1_R, .type = ARM_CP_CONST,
248
+ .accessfn = access_aa64_tid3,
249
.resetvalue = 0 },
250
{ .name = "ID_AA64ISAR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
251
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 3,
252
.access = PL1_R, .type = ARM_CP_CONST,
253
+ .accessfn = access_aa64_tid3,
254
.resetvalue = 0 },
255
{ .name = "ID_AA64ISAR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
256
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 4,
257
.access = PL1_R, .type = ARM_CP_CONST,
258
+ .accessfn = access_aa64_tid3,
259
.resetvalue = 0 },
260
{ .name = "ID_AA64ISAR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
261
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 5,
262
.access = PL1_R, .type = ARM_CP_CONST,
263
+ .accessfn = access_aa64_tid3,
264
.resetvalue = 0 },
265
{ .name = "ID_AA64ISAR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
266
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 6,
267
.access = PL1_R, .type = ARM_CP_CONST,
268
+ .accessfn = access_aa64_tid3,
269
.resetvalue = 0 },
270
{ .name = "ID_AA64ISAR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
271
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 7,
272
.access = PL1_R, .type = ARM_CP_CONST,
273
+ .accessfn = access_aa64_tid3,
274
.resetvalue = 0 },
275
{ .name = "ID_AA64MMFR0_EL1", .state = ARM_CP_STATE_AA64,
276
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 0,
277
.access = PL1_R, .type = ARM_CP_CONST,
278
+ .accessfn = access_aa64_tid3,
279
.resetvalue = cpu->isar.id_aa64mmfr0 },
280
{ .name = "ID_AA64MMFR1_EL1", .state = ARM_CP_STATE_AA64,
281
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 1,
282
.access = PL1_R, .type = ARM_CP_CONST,
283
+ .accessfn = access_aa64_tid3,
284
.resetvalue = cpu->isar.id_aa64mmfr1 },
285
{ .name = "ID_AA64MMFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
286
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 2,
287
.access = PL1_R, .type = ARM_CP_CONST,
288
+ .accessfn = access_aa64_tid3,
289
.resetvalue = 0 },
290
{ .name = "ID_AA64MMFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
291
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 3,
292
.access = PL1_R, .type = ARM_CP_CONST,
293
+ .accessfn = access_aa64_tid3,
294
.resetvalue = 0 },
295
{ .name = "ID_AA64MMFR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
296
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 4,
297
.access = PL1_R, .type = ARM_CP_CONST,
298
+ .accessfn = access_aa64_tid3,
299
.resetvalue = 0 },
300
{ .name = "ID_AA64MMFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
301
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 5,
302
.access = PL1_R, .type = ARM_CP_CONST,
303
+ .accessfn = access_aa64_tid3,
304
.resetvalue = 0 },
305
{ .name = "ID_AA64MMFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
306
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 6,
307
.access = PL1_R, .type = ARM_CP_CONST,
308
+ .accessfn = access_aa64_tid3,
309
.resetvalue = 0 },
310
{ .name = "ID_AA64MMFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
311
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 7,
312
.access = PL1_R, .type = ARM_CP_CONST,
313
+ .accessfn = access_aa64_tid3,
314
.resetvalue = 0 },
315
{ .name = "MVFR0_EL1", .state = ARM_CP_STATE_AA64,
316
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 0,
317
.access = PL1_R, .type = ARM_CP_CONST,
318
+ .accessfn = access_aa64_tid3,
319
.resetvalue = cpu->isar.mvfr0 },
320
{ .name = "MVFR1_EL1", .state = ARM_CP_STATE_AA64,
321
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 1,
322
.access = PL1_R, .type = ARM_CP_CONST,
323
+ .accessfn = access_aa64_tid3,
324
.resetvalue = cpu->isar.mvfr1 },
325
{ .name = "MVFR2_EL1", .state = ARM_CP_STATE_AA64,
326
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 2,
327
.access = PL1_R, .type = ARM_CP_CONST,
328
+ .accessfn = access_aa64_tid3,
329
.resetvalue = cpu->isar.mvfr2 },
330
{ .name = "MVFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
331
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 3,
332
.access = PL1_R, .type = ARM_CP_CONST,
333
+ .accessfn = access_aa64_tid3,
334
.resetvalue = 0 },
335
{ .name = "MVFR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
336
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 4,
337
.access = PL1_R, .type = ARM_CP_CONST,
338
+ .accessfn = access_aa64_tid3,
339
.resetvalue = 0 },
340
{ .name = "MVFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
341
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 5,
342
.access = PL1_R, .type = ARM_CP_CONST,
343
+ .accessfn = access_aa64_tid3,
344
.resetvalue = 0 },
345
{ .name = "MVFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
346
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 6,
347
.access = PL1_R, .type = ARM_CP_CONST,
348
+ .accessfn = access_aa64_tid3,
349
.resetvalue = 0 },
350
{ .name = "MVFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
351
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 7,
352
.access = PL1_R, .type = ARM_CP_CONST,
353
+ .accessfn = access_aa64_tid3,
354
.resetvalue = 0 },
355
{ .name = "PMCEID0", .state = ARM_CP_STATE_AA32,
356
.cp = 15, .opc1 = 0, .crn = 9, .crm = 12, .opc2 = 6,
357
--
36
--
358
2.20.1
37
2.20.1
359
38
360
39
diff view generated by jsdifflib
New patch
1
From: Eric Auger <eric.auger@redhat.com>
1
2
3
Coverity points out (CID 1430180) that the new case is missing
4
break or a /* fallthrough */ comment. Break is the right thing to
5
do as in that case, tail is not used.
6
7
Fixes 1733eebb9e ("virtio-iommu: Implement RESV_MEM probe request")
8
Signed-off-by: Eric Auger <eric.auger@redhat.com>
9
Reported-by: Peter Maydell <peter.maydell@linaro.org>
10
Message-id: 20200708160147.18426-1-eric.auger@redhat.com
11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
hw/virtio/virtio-iommu.c | 1 +
15
1 file changed, 1 insertion(+)
16
17
diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/virtio/virtio-iommu.c
20
+++ b/hw/virtio/virtio-iommu.c
21
@@ -XXX,XX +XXX,XX @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq)
22
ptail = (struct virtio_iommu_req_tail *)
23
(buf + s->config.probe_size);
24
ptail->status = virtio_iommu_handle_probe(s, iov, iov_cnt, buf);
25
+ break;
26
}
27
default:
28
tail.status = VIRTIO_IOMMU_S_UNSUPP;
29
--
30
2.20.1
31
32
diff view generated by jsdifflib
New patch
1
From: David CARLIER <devnexen@gmail.com>
1
2
3
Tell Haiku to provide various BSD functions by setting BSD_SOURCE
4
and linking libbsd.
5
6
Signed-off-by: David Carlier <devnexen@gmail.com>
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Message-id: 20200703145614.16684-2-peter.maydell@linaro.org
10
[PMM: expanded commit message]
11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
configure | 4 ++--
15
1 file changed, 2 insertions(+), 2 deletions(-)
16
17
diff --git a/configure b/configure
18
index XXXXXXX..XXXXXXX 100755
19
--- a/configure
20
+++ b/configure
21
@@ -XXX,XX +XXX,XX @@ SunOS)
22
;;
23
Haiku)
24
haiku="yes"
25
- QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
26
- LIBS="-lposix_error_mapper -lnetwork $LIBS"
27
+ QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -DBSD_SOURCE $QEMU_CFLAGS"
28
+ LIBS="-lposix_error_mapper -lnetwork -lbsd $LIBS"
29
;;
30
Linux)
31
audio_drv_list="try-pa oss"
32
--
33
2.20.1
34
35
diff view generated by jsdifflib
New patch
1
From: David CARLIER <devnexen@gmail.com>
1
2
3
Instead of using an OS-specific ifdef test to select the "openpty()
4
is in pty.h" codepath, make configure check for the existence of
5
the header and use the new CONFIG_PTY instead.
6
7
This is necessary to build on Haiku, which also provides openpty()
8
via pty.h.
9
10
Signed-off-by: David Carlier <devnexen@gmail.com>
11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Message-id: 20200703145614.16684-3-peter.maydell@linaro.org
14
[PMM: Expanded commit message; rename to HAVE_PTY_H]
15
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
16
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
17
---
18
configure | 9 +++++++++
19
util/qemu-openpty.c | 2 +-
20
2 files changed, 10 insertions(+), 1 deletion(-)
21
22
diff --git a/configure b/configure
23
index XXXXXXX..XXXXXXX 100755
24
--- a/configure
25
+++ b/configure
26
@@ -XXX,XX +XXX,XX @@ else
27
l2tpv3=no
28
fi
29
30
+if check_include "pty.h" ; then
31
+ pty_h=yes
32
+else
33
+ pty_h=no
34
+fi
35
+
36
#########################################
37
# vhost interdependencies and host support
38
39
@@ -XXX,XX +XXX,XX @@ fi
40
if test "$sheepdog" = "yes" ; then
41
echo "CONFIG_SHEEPDOG=y" >> $config_host_mak
42
fi
43
+if test "$pty_h" = "yes" ; then
44
+ echo "HAVE_PTY_H=y" >> $config_host_mak
45
+fi
46
if test "$fuzzing" = "yes" ; then
47
if test "$have_fuzzer" = "yes"; then
48
FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
49
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
50
index XXXXXXX..XXXXXXX 100644
51
--- a/util/qemu-openpty.c
52
+++ b/util/qemu-openpty.c
53
@@ -XXX,XX +XXX,XX @@
54
#include "qemu/osdep.h"
55
#include "qemu-common.h"
56
57
-#if defined(__GLIBC__)
58
+#if defined HAVE_PTY_H
59
# include <pty.h>
60
#elif defined CONFIG_BSD
61
# include <termios.h>
62
--
63
2.20.1
64
65
diff view generated by jsdifflib
New patch
1
From: David CARLIER <devnexen@gmail.com>
1
2
3
Instead of assuming that all POSIX platforms provide mlockall(),
4
test for it in configure. If the host doesn't provide this platform
5
then os_mlock() will fail -ENOSYS, as it does already on Windows.
6
7
This is necessary for Haiku, which does not have mlockall().
8
9
Signed-off-by: David Carlier <devnexen@gmail.com>
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Message-id: 20200703145614.16684-4-peter.maydell@linaro.org
13
[PMM: Expanded commit message; rename to HAVE_MLOCKALL]
14
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
15
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
---
17
configure | 15 +++++++++++++++
18
os-posix.c | 4 ++++
19
2 files changed, 19 insertions(+)
20
21
diff --git a/configure b/configure
22
index XXXXXXX..XXXXXXX 100755
23
--- a/configure
24
+++ b/configure
25
@@ -XXX,XX +XXX,XX @@ else
26
pty_h=no
27
fi
28
29
+cat > $TMPC <<EOF
30
+#include <sys/mman.h>
31
+int main(int argc, char *argv[]) {
32
+ return mlockall(MCL_FUTURE);
33
+}
34
+EOF
35
+if compile_prog "" "" ; then
36
+ have_mlockall=yes
37
+else
38
+ have_mlockall=no
39
+fi
40
+
41
#########################################
42
# vhost interdependencies and host support
43
44
@@ -XXX,XX +XXX,XX @@ fi
45
if test "$pty_h" = "yes" ; then
46
echo "HAVE_PTY_H=y" >> $config_host_mak
47
fi
48
+if test "$have_mlockall" = "yes" ; then
49
+ echo "HAVE_MLOCKALL=y" >> $config_host_mak
50
+fi
51
if test "$fuzzing" = "yes" ; then
52
if test "$have_fuzzer" = "yes"; then
53
FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
54
diff --git a/os-posix.c b/os-posix.c
55
index XXXXXXX..XXXXXXX 100644
56
--- a/os-posix.c
57
+++ b/os-posix.c
58
@@ -XXX,XX +XXX,XX @@ bool is_daemonized(void)
59
60
int os_mlock(void)
61
{
62
+#ifdef HAVE_MLOCKALL
63
int ret = 0;
64
65
ret = mlockall(MCL_CURRENT | MCL_FUTURE);
66
@@ -XXX,XX +XXX,XX @@ int os_mlock(void)
67
}
68
69
return ret;
70
+#else
71
+ return -ENOSYS;
72
+#endif
73
}
74
--
75
2.20.1
76
77
diff view generated by jsdifflib
New patch
1
From: David CARLIER <devnexen@gmail.com>
1
2
3
Regularize our handling of <sys/signal.h>: currently we include it in
4
osdep.h, but only for OpenBSD, and we include it without an ifdef
5
guard in a couple of C files. This causes problems for Haiku, which
6
doesn't have that header.
7
8
Instead, check in configure whether sys/signal.h exists, and if it
9
does then always include it from osdep.h.
10
11
Signed-off-by: David Carlier <devnexen@gmail.com>
12
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Thomas Huth <thuth@redhat.com>
14
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
15
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
Message-id: 20200703145614.16684-5-peter.maydell@linaro.org
17
[PMM: Expanded commit message; rename to HAVE_SYS_SIGNAL_H]
18
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
19
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
---
21
configure | 10 ++++++++++
22
include/qemu/osdep.h | 2 +-
23
hw/xen/xen-legacy-backend.c | 1 -
24
util/oslib-posix.c | 1 -
25
4 files changed, 11 insertions(+), 3 deletions(-)
26
27
diff --git a/configure b/configure
28
index XXXXXXX..XXXXXXX 100755
29
--- a/configure
30
+++ b/configure
31
@@ -XXX,XX +XXX,XX @@ if check_include "libdrm/drm.h" ; then
32
have_drm_h=yes
33
fi
34
35
+#########################################
36
+# sys/signal.h check
37
+have_sys_signal_h=no
38
+if check_include "sys/signal.h" ; then
39
+ have_sys_signal_h=yes
40
+fi
41
+
42
##########################################
43
# VTE probe
44
45
@@ -XXX,XX +XXX,XX @@ fi
46
if test "$have_openpty" = "yes" ; then
47
echo "HAVE_OPENPTY=y" >> $config_host_mak
48
fi
49
+if test "$have_sys_signal_h" = "yes" ; then
50
+ echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak
51
+fi
52
53
# Work around a system header bug with some kernel/XFS header
54
# versions where they both try to define 'struct fsxattr':
55
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
56
index XXXXXXX..XXXXXXX 100644
57
--- a/include/qemu/osdep.h
58
+++ b/include/qemu/osdep.h
59
@@ -XXX,XX +XXX,XX @@ extern int daemon(int, int);
60
#include <setjmp.h>
61
#include <signal.h>
62
63
-#ifdef __OpenBSD__
64
+#ifdef HAVE_SYS_SIGNAL_H
65
#include <sys/signal.h>
66
#endif
67
68
diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
69
index XXXXXXX..XXXXXXX 100644
70
--- a/hw/xen/xen-legacy-backend.c
71
+++ b/hw/xen/xen-legacy-backend.c
72
@@ -XXX,XX +XXX,XX @@
73
*/
74
75
#include "qemu/osdep.h"
76
-#include <sys/signal.h>
77
78
#include "hw/sysbus.h"
79
#include "hw/boards.h"
80
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
81
index XXXXXXX..XXXXXXX 100644
82
--- a/util/oslib-posix.c
83
+++ b/util/oslib-posix.c
84
@@ -XXX,XX +XXX,XX @@
85
#include "qemu/sockets.h"
86
#include "qemu/thread.h"
87
#include <libgen.h>
88
-#include <sys/signal.h>
89
#include "qemu/cutils.h"
90
91
#ifdef CONFIG_LINUX
92
--
93
2.20.1
94
95
diff view generated by jsdifflib
New patch
1
From: David CARLIER <devnexen@gmail.com>
1
2
3
Haiku doesn't provide SIGIO; fix this up in osdep.h by defining it as
4
equal to SIGPOLL.
5
6
Signed-off-by: David Carlier <devnexen@gmail.com>
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Thomas Huth <thuth@redhat.com>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Message-id: 20200703145614.16684-6-peter.maydell@linaro.org
11
[PMM: Expanded commit message]
12
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
---
15
include/qemu/osdep.h | 4 ++++
16
1 file changed, 4 insertions(+)
17
18
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
19
index XXXXXXX..XXXXXXX 100644
20
--- a/include/qemu/osdep.h
21
+++ b/include/qemu/osdep.h
22
@@ -XXX,XX +XXX,XX @@ void qemu_anon_ram_free(void *ptr, size_t size);
23
#define HAVE_CHARDEV_PARPORT 1
24
#endif
25
26
+#if defined(__HAIKU__)
27
+#define SIGIO SIGPOLL
28
+#endif
29
+
30
#if defined(CONFIG_LINUX)
31
#ifndef BUS_MCEERR_AR
32
#define BUS_MCEERR_AR 4
33
--
34
2.20.1
35
36
diff view generated by jsdifflib
New patch
1
From: David CARLIER <devnexen@gmail.com>
1
2
3
Haiku puts the bswap* functions in <endian.h>; pull in that
4
include file on that platform.
5
6
Signed-off-by: David Carlier <devnexen@gmail.com>
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Thomas Huth <thuth@redhat.com>
9
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Message-id: 20200703145614.16684-7-peter.maydell@linaro.org
12
[PMM: Expanded commit message]
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
---
16
include/qemu/bswap.h | 2 ++
17
1 file changed, 2 insertions(+)
18
19
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
20
index XXXXXXX..XXXXXXX 100644
21
--- a/include/qemu/bswap.h
22
+++ b/include/qemu/bswap.h
23
@@ -XXX,XX +XXX,XX @@
24
# include <machine/bswap.h>
25
#elif defined(__FreeBSD__)
26
# include <sys/endian.h>
27
+#elif defined(__HAIKU__)
28
+# include <endian.h>
29
#elif defined(CONFIG_BYTESWAP_H)
30
# include <byteswap.h>
31
32
--
33
2.20.1
34
35
diff view generated by jsdifflib
New patch
1
From: David CARLIER <devnexen@gmail.com>
1
2
3
util/compatfd.c includes <sys/syscall.h> so that the CONFIG_SIGNALFD
4
code can use SYS_signalfd. Guard the #include with CONFIG_SIGNALFD
5
to avoid portability issues on hosts like Haiku which do not
6
provide that header file.
7
8
Signed-off-by: David Carlier <devnexen@gmail.com>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Thomas Huth <thuth@redhat.com>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Message-id: 20200703145614.16684-8-peter.maydell@linaro.org
13
[PMM: Expanded commit message]
14
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
15
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
---
17
util/compatfd.c | 2 ++
18
1 file changed, 2 insertions(+)
19
20
diff --git a/util/compatfd.c b/util/compatfd.c
21
index XXXXXXX..XXXXXXX 100644
22
--- a/util/compatfd.c
23
+++ b/util/compatfd.c
24
@@ -XXX,XX +XXX,XX @@
25
#include "qemu/osdep.h"
26
#include "qemu/thread.h"
27
28
+#if defined(CONFIG_SIGNALFD)
29
#include <sys/syscall.h>
30
+#endif
31
32
struct sigfd_compat_info
33
{
34
--
35
2.20.1
36
37
diff view generated by jsdifflib
1
From: Marc Zyngier <maz@kernel.org>
1
From: David CARLIER <devnexen@gmail.com>
2
2
3
The ARMv8 ARM states when executing at EL2, EL3 or Secure EL1,
3
The qemu_init_exec_dir() function is inherently non-portable;
4
ISR_EL1 shows the pending status of the physical IRQ, FIQ, or
4
provide an implementation for Haiku hosts.
5
SError interrupts.
6
5
7
Unfortunately, QEMU's implementation only considers the HCR_EL2
6
Signed-off-by: David Carlier <devnexen@gmail.com>
8
bits, and ignores the current exception level. This means a hypervisor
9
trying to look at its own interrupt state actually sees the guest
10
state, which is unexpected and breaks KVM as of Linux 5.3.
11
12
Instead, check for the running EL and return the physical bits
13
if not running in a virtualized context.
14
15
Fixes: 636540e9c40b
16
Cc: qemu-stable@nongnu.org
17
Reported-by: Quentin Perret <qperret@google.com>
18
Signed-off-by: Marc Zyngier <maz@kernel.org>
19
Message-id: 20191122135833.28953-1-maz@kernel.org
20
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
21
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Message-id: 20200703145614.16684-9-peter.maydell@linaro.org
10
[PMM: Expanded commit message]
11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
22
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
23
---
13
---
24
target/arm/helper.c | 7 +++++--
14
util/oslib-posix.c | 19 +++++++++++++++++++
25
1 file changed, 5 insertions(+), 2 deletions(-)
15
1 file changed, 19 insertions(+)
26
16
27
diff --git a/target/arm/helper.c b/target/arm/helper.c
17
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
28
index XXXXXXX..XXXXXXX 100644
18
index XXXXXXX..XXXXXXX 100644
29
--- a/target/arm/helper.c
19
--- a/util/oslib-posix.c
30
+++ b/target/arm/helper.c
20
+++ b/util/oslib-posix.c
31
@@ -XXX,XX +XXX,XX @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri)
21
@@ -XXX,XX +XXX,XX @@
32
CPUState *cs = env_cpu(env);
22
#include <mach-o/dyld.h>
33
uint64_t hcr_el2 = arm_hcr_el2_eff(env);
23
#endif
34
uint64_t ret = 0;
24
35
+ bool allow_virt = (arm_current_el(env) == 1 &&
25
+#ifdef __HAIKU__
36
+ (!arm_is_secure_below_el3(env) ||
26
+#include <kernel/image.h>
37
+ (env->cp15.scr_el3 & SCR_EEL2)));
27
+#endif
38
28
+
39
- if (hcr_el2 & HCR_IMO) {
29
#include "qemu/mmap-alloc.h"
40
+ if (allow_virt && (hcr_el2 & HCR_IMO)) {
30
41
if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) {
31
#ifdef CONFIG_DEBUG_STACK_USAGE
42
ret |= CPSR_I;
32
@@ -XXX,XX +XXX,XX @@ void qemu_init_exec_dir(const char *argv0)
43
}
33
}
44
@@ -XXX,XX +XXX,XX @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri)
45
}
34
}
46
}
35
}
47
36
+#elif defined(__HAIKU__)
48
- if (hcr_el2 & HCR_FMO) {
37
+ {
49
+ if (allow_virt && (hcr_el2 & HCR_FMO)) {
38
+ image_info ii;
50
if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) {
39
+ int32_t c = 0;
51
ret |= CPSR_F;
40
+
52
}
41
+ *buf = '\0';
42
+ while (get_next_image_info(0, &c, &ii) == B_OK) {
43
+ if (ii.type == B_APP_IMAGE) {
44
+ strncpy(buf, ii.name, sizeof(buf));
45
+ buf[sizeof(buf) - 1] = 0;
46
+ p = buf;
47
+ break;
48
+ }
49
+ }
50
+ }
51
#endif
52
/* If we don't have any way of figuring out the actual executable
53
location then try argv[0]. */
53
--
54
--
54
2.20.1
55
2.20.1
55
56
56
57
diff view generated by jsdifflib
New patch
1
From: Gerd Hoffmann <kraxel@redhat.com>
1
2
3
Given this isn't perforance critical at all lets avoid the non-portable
4
d_type and use fstat instead to check whenever the file is a chardev.
5
6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7
Reported-by: David Carlier <devnexen@gmail.com>
8
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Message-id: 20200703145614.16684-10-peter.maydell@linaro.org
12
Message-id: 20200701180302.14821-1-kraxel@redhat.com
13
[PMM: fixed comment style; tweaked subject line]
14
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
15
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
---
17
util/drm.c | 19 ++++++++++++++-----
18
1 file changed, 14 insertions(+), 5 deletions(-)
19
20
diff --git a/util/drm.c b/util/drm.c
21
index XXXXXXX..XXXXXXX 100644
22
--- a/util/drm.c
23
+++ b/util/drm.c
24
@@ -XXX,XX +XXX,XX @@ int qemu_drm_rendernode_open(const char *rendernode)
25
{
26
DIR *dir;
27
struct dirent *e;
28
- int r, fd;
29
+ struct stat st;
30
+ int r, fd, ret;
31
char *p;
32
33
if (rendernode) {
34
@@ -XXX,XX +XXX,XX @@ int qemu_drm_rendernode_open(const char *rendernode)
35
36
fd = -1;
37
while ((e = readdir(dir))) {
38
- if (e->d_type != DT_CHR) {
39
- continue;
40
- }
41
-
42
if (strncmp(e->d_name, "renderD", 7)) {
43
continue;
44
}
45
@@ -XXX,XX +XXX,XX @@ int qemu_drm_rendernode_open(const char *rendernode)
46
g_free(p);
47
continue;
48
}
49
+
50
+ /*
51
+ * prefer fstat() over checking e->d_type == DT_CHR for
52
+ * portability reasons
53
+ */
54
+ ret = fstat(r, &st);
55
+ if (ret < 0 || (st.st_mode & S_IFMT) != S_IFCHR) {
56
+ close(r);
57
+ g_free(p);
58
+ continue;
59
+ }
60
+
61
fd = r;
62
g_free(p);
63
break;
64
--
65
2.20.1
66
67
diff view generated by jsdifflib
New patch
1
From: Wentong Wu <wentong.wu@intel.com>
1
2
3
Add DISAS_NORETURN case for nothing more to generate because at runtime
4
execution will never return from some helper call. And at the same time
5
replace DISAS_UPDATE in t_gen_helper_raise_exception and gen_exception
6
with the newly added DISAS_NORETURN.
7
8
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
9
Message-id: 20200710233433.19729-1-wentong.wu@intel.com
10
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
13
target/nios2/translate.c | 5 +++--
14
1 file changed, 3 insertions(+), 2 deletions(-)
15
16
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/target/nios2/translate.c
19
+++ b/target/nios2/translate.c
20
@@ -XXX,XX +XXX,XX @@ static void t_gen_helper_raise_exception(DisasContext *dc,
21
tcg_gen_movi_tl(dc->cpu_R[R_PC], dc->pc);
22
gen_helper_raise_exception(dc->cpu_env, tmp);
23
tcg_temp_free_i32(tmp);
24
- dc->is_jmp = DISAS_UPDATE;
25
+ dc->is_jmp = DISAS_NORETURN;
26
}
27
28
static bool use_goto_tb(DisasContext *dc, uint32_t dest)
29
@@ -XXX,XX +XXX,XX @@ static void gen_exception(DisasContext *dc, uint32_t excp)
30
tcg_gen_movi_tl(cpu_R[R_PC], dc->pc);
31
gen_helper_raise_exception(cpu_env, tmp);
32
tcg_temp_free_i32(tmp);
33
- dc->is_jmp = DISAS_UPDATE;
34
+ dc->is_jmp = DISAS_NORETURN;
35
}
36
37
/* generate intermediate code for basic block 'tb'. */
38
@@ -XXX,XX +XXX,XX @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
39
tcg_gen_exit_tb(NULL, 0);
40
break;
41
42
+ case DISAS_NORETURN:
43
case DISAS_TB_JUMP:
44
/* nothing more to generate */
45
break;
46
--
47
2.20.1
48
49
diff view generated by jsdifflib
New patch
1
From: Wentong Wu <wentong.wu@intel.com>
1
2
3
In line the semantics of DISAS_UPDATE on nios2 target with other targets
4
which is to explicitly write the PC back into the cpu state before doing
5
a tcg_gen_exit_tb().
6
7
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
8
Message-id: 20200710233433.19729-2-wentong.wu@intel.com
9
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
target/nios2/translate.c | 2 +-
13
1 file changed, 1 insertion(+), 1 deletion(-)
14
15
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/target/nios2/translate.c
18
+++ b/target/nios2/translate.c
19
@@ -XXX,XX +XXX,XX @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
20
/* Indicate where the next block should start */
21
switch (dc->is_jmp) {
22
case DISAS_NEXT:
23
+ case DISAS_UPDATE:
24
/* Save the current PC back into the CPU register */
25
tcg_gen_movi_tl(cpu_R[R_PC], dc->pc);
26
tcg_gen_exit_tb(NULL, 0);
27
@@ -XXX,XX +XXX,XX @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
28
29
default:
30
case DISAS_JUMP:
31
- case DISAS_UPDATE:
32
/* The jump will already have updated the PC register */
33
tcg_gen_exit_tb(NULL, 0);
34
break;
35
--
36
2.20.1
37
38
diff view generated by jsdifflib
New patch
1
From: Wentong Wu <wentong.wu@intel.com>
1
2
3
wrctl instruction on nios2 target will cause checking cpu
4
interrupt but tcg_handle_interrupt() will call cpu_abort()
5
if the CPU gets an interrupt while it's not in 'can do IO'
6
state, so add gen_io_start around wrctl instruction. Also
7
at the same time, end the onging TB with DISAS_UPDATE.
8
9
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
10
Message-id: 20200710233433.19729-3-wentong.wu@intel.com
11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
target/nios2/translate.c | 5 +++++
15
1 file changed, 5 insertions(+)
16
17
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/target/nios2/translate.c
20
+++ b/target/nios2/translate.c
21
@@ -XXX,XX +XXX,XX @@
22
#include "exec/cpu_ldst.h"
23
#include "exec/translator.h"
24
#include "qemu/qemu-print.h"
25
+#include "exec/gen-icount.h"
26
27
/* is_jmp field values */
28
#define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */
29
@@ -XXX,XX +XXX,XX @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags)
30
/* If interrupts were enabled using WRCTL, trigger them. */
31
#if !defined(CONFIG_USER_ONLY)
32
if ((instr.imm5 + CR_BASE) == CR_STATUS) {
33
+ if (tb_cflags(dc->tb) & CF_USE_ICOUNT) {
34
+ gen_io_start();
35
+ }
36
gen_helper_check_interrupts(dc->cpu_env);
37
+ dc->is_jmp = DISAS_UPDATE;
38
}
39
#endif
40
}
41
--
42
2.20.1
43
44
diff view generated by jsdifflib
1
From: Jean-Hugues Deschênes <Jean-Hugues.Deschenes@ossiaco.com>
1
From: Wentong Wu <wentong.wu@intel.com>
2
2
3
According to the PushStack() pseudocode in the armv7m RM,
3
Only when guest code is unmasking interrupts, terminate the excution
4
bit 4 of the LR should be set to NOT(CONTROL.PFCA) when
4
of translated code and exit to the main CPU loop to handle previous
5
an FPU is present. Current implementation is doing it for
5
pended interrupts because of the interrupts mask by guest code.
6
armv8, but not for armv7. This patch makes the existing
7
logic applicable to both code paths.
8
6
9
Signed-off-by: Jean-Hugues Deschenes <jean-hugues.deschenes@ossiaco.com>
7
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
8
Message-id: 20200710233433.19729-4-wentong.wu@intel.com
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
11
---
13
target/arm/m_helper.c | 7 +++----
12
hw/nios2/cpu_pic.c | 3 ++-
14
1 file changed, 3 insertions(+), 4 deletions(-)
13
1 file changed, 2 insertions(+), 1 deletion(-)
15
14
16
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
15
diff --git a/hw/nios2/cpu_pic.c b/hw/nios2/cpu_pic.c
17
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/m_helper.c
17
--- a/hw/nios2/cpu_pic.c
19
+++ b/target/arm/m_helper.c
18
+++ b/hw/nios2/cpu_pic.c
20
@@ -XXX,XX +XXX,XX @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
19
@@ -XXX,XX +XXX,XX @@ static void nios2_pic_cpu_handler(void *opaque, int irq, int level)
21
if (env->v7m.secure) {
20
22
lr |= R_V7M_EXCRET_S_MASK;
21
void nios2_check_interrupts(CPUNios2State *env)
23
}
22
{
24
- if (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK)) {
23
- if (env->irq_pending) {
25
- lr |= R_V7M_EXCRET_FTYPE_MASK;
24
+ if (env->irq_pending &&
26
- }
25
+ (env->regs[CR_STATUS] & CR_STATUS_PIE)) {
27
} else {
26
env->irq_pending = 0;
28
lr = R_V7M_EXCRET_RES1_MASK |
27
cpu_interrupt(env_cpu(env), CPU_INTERRUPT_HARD);
29
R_V7M_EXCRET_S_MASK |
30
R_V7M_EXCRET_DCRS_MASK |
31
- R_V7M_EXCRET_FTYPE_MASK |
32
R_V7M_EXCRET_ES_MASK;
33
if (env->v7m.control[M_REG_NS] & R_V7M_CONTROL_SPSEL_MASK) {
34
lr |= R_V7M_EXCRET_SPSEL_MASK;
35
}
36
}
37
+ if (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK)) {
38
+ lr |= R_V7M_EXCRET_FTYPE_MASK;
39
+ }
40
if (!arm_v7m_is_handler_mode(env)) {
41
lr |= R_V7M_EXCRET_MODE_MASK;
42
}
28
}
43
--
29
--
44
2.20.1
30
2.20.1
45
31
46
32
diff view generated by jsdifflib
New patch
1
Remove the hardcoded tabs from hw/arm/tosa.c. There aren't
2
many, but since they're all in constant #defines they're not
3
going to go away with our usual "only when we touch a function"
4
policy on reformatting.
1
5
6
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Message-id: 20200628203748.14250-2-peter.maydell@linaro.org
9
---
10
hw/arm/tosa.c | 44 ++++++++++++++++++++++----------------------
11
1 file changed, 22 insertions(+), 22 deletions(-)
12
13
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/arm/tosa.c
16
+++ b/hw/arm/tosa.c
17
@@ -XXX,XX +XXX,XX @@
18
#include "hw/sysbus.h"
19
#include "exec/address-spaces.h"
20
21
-#define TOSA_RAM 0x04000000
22
-#define TOSA_ROM    0x00800000
23
+#define TOSA_RAM 0x04000000
24
+#define TOSA_ROM 0x00800000
25
26
-#define TOSA_GPIO_USB_IN        (5)
27
-#define TOSA_GPIO_nSD_DETECT    (9)
28
-#define TOSA_GPIO_ON_RESET        (19)
29
-#define TOSA_GPIO_CF_IRQ        (21)    /* CF slot0 Ready */
30
-#define TOSA_GPIO_CF_CD            (13)
31
-#define TOSA_GPIO_TC6393XB_INT (15)
32
-#define TOSA_GPIO_JC_CF_IRQ        (36)    /* CF slot1 Ready */
33
+#define TOSA_GPIO_USB_IN (5)
34
+#define TOSA_GPIO_nSD_DETECT (9)
35
+#define TOSA_GPIO_ON_RESET (19)
36
+#define TOSA_GPIO_CF_IRQ (21) /* CF slot0 Ready */
37
+#define TOSA_GPIO_CF_CD (13)
38
+#define TOSA_GPIO_TC6393XB_INT (15)
39
+#define TOSA_GPIO_JC_CF_IRQ (36) /* CF slot1 Ready */
40
41
-#define TOSA_SCOOP_GPIO_BASE    1
42
-#define TOSA_GPIO_IR_POWERDWN    (TOSA_SCOOP_GPIO_BASE + 2)
43
-#define TOSA_GPIO_SD_WP            (TOSA_SCOOP_GPIO_BASE + 3)
44
-#define TOSA_GPIO_PWR_ON        (TOSA_SCOOP_GPIO_BASE + 4)
45
+#define TOSA_SCOOP_GPIO_BASE 1
46
+#define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2)
47
+#define TOSA_GPIO_SD_WP (TOSA_SCOOP_GPIO_BASE + 3)
48
+#define TOSA_GPIO_PWR_ON (TOSA_SCOOP_GPIO_BASE + 4)
49
50
-#define TOSA_SCOOP_JC_GPIO_BASE        1
51
-#define TOSA_GPIO_BT_LED        (TOSA_SCOOP_JC_GPIO_BASE + 0)
52
-#define TOSA_GPIO_NOTE_LED        (TOSA_SCOOP_JC_GPIO_BASE + 1)
53
-#define TOSA_GPIO_CHRG_ERR_LED        (TOSA_SCOOP_JC_GPIO_BASE + 2)
54
-#define TOSA_GPIO_TC6393XB_L3V_ON    (TOSA_SCOOP_JC_GPIO_BASE + 5)
55
-#define TOSA_GPIO_WLAN_LED        (TOSA_SCOOP_JC_GPIO_BASE + 7)
56
+#define TOSA_SCOOP_JC_GPIO_BASE 1
57
+#define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0)
58
+#define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1)
59
+#define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2)
60
+#define TOSA_GPIO_TC6393XB_L3V_ON (TOSA_SCOOP_JC_GPIO_BASE + 5)
61
+#define TOSA_GPIO_WLAN_LED (TOSA_SCOOP_JC_GPIO_BASE + 7)
62
63
-#define    DAC_BASE    0x4e
64
-#define DAC_CH1        0
65
-#define DAC_CH2        1
66
+#define DAC_BASE 0x4e
67
+#define DAC_CH1 0
68
+#define DAC_CH2 1
69
70
static void tosa_microdrive_attach(PXA2xxState *cpu)
71
{
72
--
73
2.20.1
74
75
diff view generated by jsdifflib
New patch
1
Currently we have a free-floating set of IRQs and a function
2
tosa_out_switch() which handle the GPIO lines on the tosa board which
3
connect to LEDs, and another free-floating IRQ and tosa_reset()
4
function to handle the GPIO line that resets the system. Encapsulate
5
this behaviour in a simple QOM device.
1
6
7
This commit fixes Coverity issue CID 1421929 (which pointed out that
8
the 'outsignals' in tosa_gpio_setup() were leaked), because it
9
removes the use of the qemu_allocate_irqs() API from this code
10
entirely.
11
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
14
Message-id: 20200628203748.14250-3-peter.maydell@linaro.org
15
---
16
hw/arm/tosa.c | 88 +++++++++++++++++++++++++++++++++++++--------------
17
1 file changed, 64 insertions(+), 24 deletions(-)
18
19
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
20
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/arm/tosa.c
22
+++ b/hw/arm/tosa.c
23
@@ -XXX,XX +XXX,XX @@ static void tosa_microdrive_attach(PXA2xxState *cpu)
24
pxa2xx_pcmcia_attach(cpu->pcmcia[0], md);
25
}
26
27
-static void tosa_out_switch(void *opaque, int line, int level)
28
+/*
29
+ * Encapsulation of some GPIO line behaviour for the Tosa board
30
+ *
31
+ * QEMU interface:
32
+ * + named GPIO inputs "leds[0..3]": assert to light LEDs
33
+ * + named GPIO input "reset": when asserted, resets the system
34
+ */
35
+
36
+#define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio"
37
+#define TOSA_MISC_GPIO(obj) \
38
+ OBJECT_CHECK(TosaMiscGPIOState, (obj), TYPE_TOSA_MISC_GPIO)
39
+
40
+typedef struct TosaMiscGPIOState {
41
+ SysBusDevice parent_obj;
42
+} TosaMiscGPIOState;
43
+
44
+static void tosa_gpio_leds(void *opaque, int line, int level)
45
{
46
switch (line) {
47
- case 0:
48
- fprintf(stderr, "blue LED %s.\n", level ? "on" : "off");
49
- break;
50
- case 1:
51
- fprintf(stderr, "green LED %s.\n", level ? "on" : "off");
52
- break;
53
- case 2:
54
- fprintf(stderr, "amber LED %s.\n", level ? "on" : "off");
55
- break;
56
- case 3:
57
- fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off");
58
- break;
59
- default:
60
- fprintf(stderr, "Uhandled out event: %d = %d\n", line, level);
61
- break;
62
+ case 0:
63
+ fprintf(stderr, "blue LED %s.\n", level ? "on" : "off");
64
+ break;
65
+ case 1:
66
+ fprintf(stderr, "green LED %s.\n", level ? "on" : "off");
67
+ break;
68
+ case 2:
69
+ fprintf(stderr, "amber LED %s.\n", level ? "on" : "off");
70
+ break;
71
+ case 3:
72
+ fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off");
73
+ break;
74
+ default:
75
+ g_assert_not_reached();
76
}
77
}
78
79
@@ -XXX,XX +XXX,XX @@ static void tosa_reset(void *opaque, int line, int level)
80
}
81
}
82
83
+static void tosa_misc_gpio_init(Object *obj)
84
+{
85
+ DeviceState *dev = DEVICE(obj);
86
+
87
+ qdev_init_gpio_in_named(dev, tosa_gpio_leds, "leds", 4);
88
+ qdev_init_gpio_in_named(dev, tosa_reset, "reset", 1);
89
+}
90
+
91
static void tosa_gpio_setup(PXA2xxState *cpu,
92
DeviceState *scp0,
93
DeviceState *scp1,
94
TC6393xbState *tmio)
95
{
96
- qemu_irq *outsignals = qemu_allocate_irqs(tosa_out_switch, cpu, 4);
97
- qemu_irq reset;
98
+ DeviceState *misc_gpio;
99
+
100
+ misc_gpio = sysbus_create_simple(TYPE_TOSA_MISC_GPIO, -1, NULL);
101
102
/* MMC/SD host */
103
pxa2xx_mmci_handlers(cpu->mmc,
104
@@ -XXX,XX +XXX,XX @@ static void tosa_gpio_setup(PXA2xxState *cpu,
105
qemu_irq_invert(qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_nSD_DETECT)));
106
107
/* Handle reset */
108
- reset = qemu_allocate_irq(tosa_reset, cpu, 0);
109
- qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET, reset);
110
+ qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET,
111
+ qdev_get_gpio_in_named(misc_gpio, "reset", 0));
112
113
/* PCMCIA signals: card's IRQ and Card-Detect */
114
pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[0],
115
@@ -XXX,XX +XXX,XX @@ static void tosa_gpio_setup(PXA2xxState *cpu,
116
qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_JC_CF_IRQ),
117
NULL);
118
119
- qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, outsignals[0]);
120
- qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, outsignals[1]);
121
- qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, outsignals[2]);
122
- qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, outsignals[3]);
123
+ qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED,
124
+ qdev_get_gpio_in_named(misc_gpio, "leds", 0));
125
+ qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED,
126
+ qdev_get_gpio_in_named(misc_gpio, "leds", 1));
127
+ qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED,
128
+ qdev_get_gpio_in_named(misc_gpio, "leds", 2));
129
+ qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED,
130
+ qdev_get_gpio_in_named(misc_gpio, "leds", 3));
131
132
qdev_connect_gpio_out(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio));
133
134
@@ -XXX,XX +XXX,XX @@ static const TypeInfo tosa_ssp_info = {
135
.class_init = tosa_ssp_class_init,
136
};
137
138
+static const TypeInfo tosa_misc_gpio_info = {
139
+ .name = "tosa-misc-gpio",
140
+ .parent = TYPE_SYS_BUS_DEVICE,
141
+ .instance_size = sizeof(TosaMiscGPIOState),
142
+ .instance_init = tosa_misc_gpio_init,
143
+ /*
144
+ * No class init required: device has no internal state so does not
145
+ * need to set up reset or vmstate, and has no realize method.
146
+ */
147
+};
148
+
149
static void tosa_register_types(void)
150
{
151
type_register_static(&tosa_dac_info);
152
type_register_static(&tosa_ssp_info);
153
+ type_register_static(&tosa_misc_gpio_info);
154
}
155
156
type_init(tosa_register_types)
157
--
158
2.20.1
159
160
diff view generated by jsdifflib
New patch
1
Remove hard-tabs from palm.c.
1
2
3
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4
Reviewed-by: Li Qiang <liq3ea@gmail.com>
5
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6
Message-id: 20200628214230.2592-2-peter.maydell@linaro.org
7
---
8
hw/arm/palm.c | 64 +++++++++++++++++++++++++--------------------------
9
1 file changed, 32 insertions(+), 32 deletions(-)
10
11
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
12
index XXXXXXX..XXXXXXX 100644
13
--- a/hw/arm/palm.c
14
+++ b/hw/arm/palm.c
15
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps static_ops = {
16
/* Palm Tunsgten|E support */
17
18
/* Shared GPIOs */
19
-#define PALMTE_USBDETECT_GPIO    0
20
-#define PALMTE_USB_OR_DC_GPIO    1
21
-#define PALMTE_TSC_GPIO        4
22
-#define PALMTE_PINTDAV_GPIO    6
23
-#define PALMTE_MMC_WP_GPIO    8
24
-#define PALMTE_MMC_POWER_GPIO    9
25
-#define PALMTE_HDQ_GPIO        11
26
-#define PALMTE_HEADPHONES_GPIO    14
27
-#define PALMTE_SPEAKER_GPIO    15
28
+#define PALMTE_USBDETECT_GPIO 0
29
+#define PALMTE_USB_OR_DC_GPIO 1
30
+#define PALMTE_TSC_GPIO 4
31
+#define PALMTE_PINTDAV_GPIO 6
32
+#define PALMTE_MMC_WP_GPIO 8
33
+#define PALMTE_MMC_POWER_GPIO 9
34
+#define PALMTE_HDQ_GPIO 11
35
+#define PALMTE_HEADPHONES_GPIO 14
36
+#define PALMTE_SPEAKER_GPIO 15
37
/* MPU private GPIOs */
38
-#define PALMTE_DC_GPIO        2
39
-#define PALMTE_MMC_SWITCH_GPIO    4
40
-#define PALMTE_MMC1_GPIO    6
41
-#define PALMTE_MMC2_GPIO    7
42
-#define PALMTE_MMC3_GPIO    11
43
+#define PALMTE_DC_GPIO 2
44
+#define PALMTE_MMC_SWITCH_GPIO 4
45
+#define PALMTE_MMC1_GPIO 6
46
+#define PALMTE_MMC2_GPIO 7
47
+#define PALMTE_MMC3_GPIO 11
48
49
static MouseTransformInfo palmte_pointercal = {
50
.x = 320,
51
@@ -XXX,XX +XXX,XX @@ static struct {
52
int column;
53
} palmte_keymap[0x80] = {
54
[0 ... 0x7f] = { -1, -1 },
55
- [0x3b] = { 0, 0 },    /* F1    -> Calendar */
56
- [0x3c] = { 1, 0 },    /* F2    -> Contacts */
57
- [0x3d] = { 2, 0 },    /* F3    -> Tasks List */
58
- [0x3e] = { 3, 0 },    /* F4    -> Note Pad */
59
- [0x01] = { 4, 0 },    /* Esc    -> Power */
60
- [0x4b] = { 0, 1 },    /*      Left */
61
- [0x50] = { 1, 1 },    /*      Down */
62
- [0x48] = { 2, 1 },    /*     Up */
63
- [0x4d] = { 3, 1 },    /*     Right */
64
- [0x4c] = { 4, 1 },    /*      Centre */
65
- [0x39] = { 4, 1 },    /* Spc    -> Centre */
66
+ [0x3b] = { 0, 0 }, /* F1 -> Calendar */
67
+ [0x3c] = { 1, 0 }, /* F2 -> Contacts */
68
+ [0x3d] = { 2, 0 }, /* F3 -> Tasks List */
69
+ [0x3e] = { 3, 0 }, /* F4 -> Note Pad */
70
+ [0x01] = { 4, 0 }, /* Esc -> Power */
71
+ [0x4b] = { 0, 1 }, /* Left */
72
+ [0x50] = { 1, 1 }, /* Down */
73
+ [0x48] = { 2, 1 }, /* Up */
74
+ [0x4d] = { 3, 1 }, /* Right */
75
+ [0x4c] = { 4, 1 }, /* Centre */
76
+ [0x39] = { 4, 1 }, /* Spc -> Centre */
77
};
78
79
static void palmte_button_event(void *opaque, int keycode)
80
@@ -XXX,XX +XXX,XX @@ static void palmte_gpio_setup(struct omap_mpu_state_s *cpu)
81
[PALMTE_MMC_SWITCH_GPIO]));
82
83
misc_gpio = qemu_allocate_irqs(palmte_onoff_gpios, cpu, 7);
84
- qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO,    misc_gpio[0]);
85
- qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO,    misc_gpio[1]);
86
- qdev_connect_gpio_out(cpu->gpio, 11,            misc_gpio[2]);
87
- qdev_connect_gpio_out(cpu->gpio, 12,            misc_gpio[3]);
88
- qdev_connect_gpio_out(cpu->gpio, 13,            misc_gpio[4]);
89
- omap_mpuio_out_set(cpu->mpuio, 1,                misc_gpio[5]);
90
- omap_mpuio_out_set(cpu->mpuio, 3,                misc_gpio[6]);
91
+ qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO, misc_gpio[0]);
92
+ qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO, misc_gpio[1]);
93
+ qdev_connect_gpio_out(cpu->gpio, 11, misc_gpio[2]);
94
+ qdev_connect_gpio_out(cpu->gpio, 12, misc_gpio[3]);
95
+ qdev_connect_gpio_out(cpu->gpio, 13, misc_gpio[4]);
96
+ omap_mpuio_out_set(cpu->mpuio, 1, misc_gpio[5]);
97
+ omap_mpuio_out_set(cpu->mpuio, 3, misc_gpio[6]);
98
99
/* Reset some inputs to initial state. */
100
qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO));
101
--
102
2.20.1
103
104
diff view generated by jsdifflib
New patch
1
Replace the free-floating set of IRQs and palmte_onoff_gpios()
2
function with a simple QOM device that encapsulates this
3
behaviour.
1
4
5
This fixes Coverity issue CID 1421944, which points out that
6
the memory returned by qemu_allocate_irqs() is leaked.
7
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Li Qiang <liq3ea@gmail.com>
10
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
11
Message-id: 20200628214230.2592-3-peter.maydell@linaro.org
12
---
13
hw/arm/palm.c | 61 +++++++++++++++++++++++++++++++++++++++++++--------
14
1 file changed, 52 insertions(+), 9 deletions(-)
15
16
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/arm/palm.c
19
+++ b/hw/arm/palm.c
20
@@ -XXX,XX +XXX,XX @@ static void palmte_button_event(void *opaque, int keycode)
21
!(keycode & 0x80));
22
}
23
24
+/*
25
+ * Encapsulation of some GPIO line behaviour for the Palm board
26
+ *
27
+ * QEMU interface:
28
+ * + unnamed GPIO inputs 0..6: for the various miscellaneous input lines
29
+ */
30
+
31
+#define TYPE_PALM_MISC_GPIO "palm-misc-gpio"
32
+#define PALM_MISC_GPIO(obj) \
33
+ OBJECT_CHECK(PalmMiscGPIOState, (obj), TYPE_PALM_MISC_GPIO)
34
+
35
+typedef struct PalmMiscGPIOState {
36
+ SysBusDevice parent_obj;
37
+} PalmMiscGPIOState;
38
+
39
static void palmte_onoff_gpios(void *opaque, int line, int level)
40
{
41
switch (line) {
42
@@ -XXX,XX +XXX,XX @@ static void palmte_onoff_gpios(void *opaque, int line, int level)
43
}
44
}
45
46
+static void palm_misc_gpio_init(Object *obj)
47
+{
48
+ DeviceState *dev = DEVICE(obj);
49
+
50
+ qdev_init_gpio_in(dev, palmte_onoff_gpios, 7);
51
+}
52
+
53
+static const TypeInfo palm_misc_gpio_info = {
54
+ .name = TYPE_PALM_MISC_GPIO,
55
+ .parent = TYPE_SYS_BUS_DEVICE,
56
+ .instance_size = sizeof(PalmMiscGPIOState),
57
+ .instance_init = palm_misc_gpio_init,
58
+ /*
59
+ * No class init required: device has no internal state so does not
60
+ * need to set up reset or vmstate, and has no realize method.
61
+ */
62
+};
63
+
64
static void palmte_gpio_setup(struct omap_mpu_state_s *cpu)
65
{
66
- qemu_irq *misc_gpio;
67
+ DeviceState *misc_gpio;
68
+
69
+ misc_gpio = sysbus_create_simple(TYPE_PALM_MISC_GPIO, -1, NULL);
70
71
omap_mmc_handlers(cpu->mmc,
72
qdev_get_gpio_in(cpu->gpio, PALMTE_MMC_WP_GPIO),
73
qemu_irq_invert(omap_mpuio_in_get(cpu->mpuio)
74
[PALMTE_MMC_SWITCH_GPIO]));
75
76
- misc_gpio = qemu_allocate_irqs(palmte_onoff_gpios, cpu, 7);
77
- qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO, misc_gpio[0]);
78
- qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO, misc_gpio[1]);
79
- qdev_connect_gpio_out(cpu->gpio, 11, misc_gpio[2]);
80
- qdev_connect_gpio_out(cpu->gpio, 12, misc_gpio[3]);
81
- qdev_connect_gpio_out(cpu->gpio, 13, misc_gpio[4]);
82
- omap_mpuio_out_set(cpu->mpuio, 1, misc_gpio[5]);
83
- omap_mpuio_out_set(cpu->mpuio, 3, misc_gpio[6]);
84
+ qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO,
85
+ qdev_get_gpio_in(misc_gpio, 0));
86
+ qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO,
87
+ qdev_get_gpio_in(misc_gpio, 1));
88
+ qdev_connect_gpio_out(cpu->gpio, 11, qdev_get_gpio_in(misc_gpio, 2));
89
+ qdev_connect_gpio_out(cpu->gpio, 12, qdev_get_gpio_in(misc_gpio, 3));
90
+ qdev_connect_gpio_out(cpu->gpio, 13, qdev_get_gpio_in(misc_gpio, 4));
91
+ omap_mpuio_out_set(cpu->mpuio, 1, qdev_get_gpio_in(misc_gpio, 5));
92
+ omap_mpuio_out_set(cpu->mpuio, 3, qdev_get_gpio_in(misc_gpio, 6));
93
94
/* Reset some inputs to initial state. */
95
qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO));
96
@@ -XXX,XX +XXX,XX @@ static void palmte_machine_init(MachineClass *mc)
97
}
98
99
DEFINE_MACHINE("cheetah", palmte_machine_init)
100
+
101
+static void palm_register_types(void)
102
+{
103
+ type_register_static(&palm_misc_gpio_info);
104
+}
105
+
106
+type_init(palm_register_types)
107
--
108
2.20.1
109
110
diff view generated by jsdifflib
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
Add the CRP as unimplemented thus avoiding bus errors when
3
Since added in commit 2bea128c3d, each SDHCI is wired with a SD
4
guests access these registers.
4
card, using empty card when no block drive provided. This is not
5
the desired behavior. The SDHCI exposes a SD bus to plug cards
6
on, if no card available, it is fine to have an unplugged bus.
5
7
6
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
8
Avoid creating unnecessary SD card device when no block drive
7
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
9
provided.
8
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
10
9
Message-id: 20191115154734.26449-2-edgar.iglesias@gmail.com
11
Fixes: 2bea128c3d ("hw/sd/aspeed_sdhci: New device")
12
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
13
Message-id: 20200705173402.15620-1-f4bug@amsat.org
14
Reviewed-by: Cédric Le Goater <clg@kaod.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
16
---
12
include/hw/arm/xlnx-versal.h | 3 +++
17
hw/arm/aspeed.c | 9 +++++----
13
hw/arm/xlnx-versal.c | 2 ++
18
1 file changed, 5 insertions(+), 4 deletions(-)
14
2 files changed, 5 insertions(+)
15
19
16
diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h
20
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
17
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
18
--- a/include/hw/arm/xlnx-versal.h
22
--- a/hw/arm/aspeed.c
19
+++ b/include/hw/arm/xlnx-versal.h
23
+++ b/hw/arm/aspeed.c
20
@@ -XXX,XX +XXX,XX @@ typedef struct Versal {
24
@@ -XXX,XX +XXX,XX @@ static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo)
21
#define MM_IOU_SCNTRS_SIZE 0x10000
25
{
22
#define MM_FPD_CRF 0xfd1a0000U
26
DeviceState *card;
23
#define MM_FPD_CRF_SIZE 0x140000
27
24
+
28
- card = qdev_new(TYPE_SD_CARD);
25
+#define MM_PMC_CRP 0xf1260000U
29
- if (dinfo) {
26
+#define MM_PMC_CRP_SIZE 0x10000
30
- qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
27
#endif
31
- &error_fatal);
28
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
32
+ if (!dinfo) {
29
index XXXXXXX..XXXXXXX 100644
33
+ return;
30
--- a/hw/arm/xlnx-versal.c
34
}
31
+++ b/hw/arm/xlnx-versal.c
35
+ card = qdev_new(TYPE_SD_CARD);
32
@@ -XXX,XX +XXX,XX @@ static void versal_unimp(Versal *s)
36
+ qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
33
MM_CRL, MM_CRL_SIZE);
37
+ &error_fatal);
34
versal_unimp_area(s, "crf", &s->mr_ps,
38
qdev_realize_and_unref(card,
35
MM_FPD_CRF, MM_FPD_CRF_SIZE);
39
qdev_get_child_bus(DEVICE(sdhci), "sd-bus"),
36
+ versal_unimp_area(s, "crp", &s->mr_ps,
40
&error_fatal);
37
+ MM_PMC_CRP, MM_PMC_CRP_SIZE);
38
versal_unimp_area(s, "iou-scntr", &s->mr_ps,
39
MM_IOU_SCNTR, MM_IOU_SCNTR_SIZE);
40
versal_unimp_area(s, "iou-scntr-seucre", &s->mr_ps,
41
--
41
--
42
2.20.1
42
2.20.1
43
43
44
44
diff view generated by jsdifflib