qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] hw/gpio/aspeed: Don't let guests modify input pins
@ 2022-07-12  2:32 Peter Delevoryas
  2022-07-12  2:32 ` [PATCH v3 1/3] qtest/aspeed_gpio: Add input pin modification test Peter Delevoryas
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Delevoryas @ 2022-07-12  2:32 UTC (permalink / raw)
  Cc: peter, clg, peter.maydell, andrew, joel, thuth, lvivier, pbonzini,
	qemu-arm, qemu-devel

v3:
- Replaced fix in v2 with change suggested by arj
- Removed all changes to the body of the aspeed_gpio_update loop
- Removed guest error messages from v2

Peter Delevoryas (3):
  qtest/aspeed_gpio: Add input pin modification test
  hw/gpio/aspeed: Don't let guests modify input pins
  aspeed: Add fby35-bmc slot GPIO's

 hw/arm/aspeed.c                | 14 +++++++++++++-
 hw/gpio/aspeed_gpio.c          | 15 ++++++++-------
 tests/qtest/aspeed_gpio-test.c | 27 +++++++++++++++++++++++++++
 3 files changed, 48 insertions(+), 8 deletions(-)

-- 
2.37.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/3] qtest/aspeed_gpio: Add input pin modification test
  2022-07-12  2:32 [PATCH v3 0/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
@ 2022-07-12  2:32 ` Peter Delevoryas
  2022-07-12 10:15   ` Cédric Le Goater
  2022-07-12  2:32 ` [PATCH v3 2/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
  2022-07-12  2:32 ` [PATCH v3 3/3] aspeed: Add fby35-bmc slot GPIO's Peter Delevoryas
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Delevoryas @ 2022-07-12  2:32 UTC (permalink / raw)
  Cc: peter, clg, peter.maydell, andrew, joel, thuth, lvivier, pbonzini,
	qemu-arm, qemu-devel

Verify the current behavior, which is that input pins can be modified by
guest OS register writes.

Signed-off-by: Peter Delevoryas <peter@pjd.dev>
---
 tests/qtest/aspeed_gpio-test.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/qtest/aspeed_gpio-test.c b/tests/qtest/aspeed_gpio-test.c
index bac63e8742..8f52454099 100644
--- a/tests/qtest/aspeed_gpio-test.c
+++ b/tests/qtest/aspeed_gpio-test.c
@@ -28,6 +28,11 @@
 #include "qapi/qmp/qdict.h"
 #include "libqtest-single.h"
 
+#define AST2600_GPIO_BASE 0x1E780000
+
+#define GPIO_ABCD_DATA_VALUE 0x000
+#define GPIO_ABCD_DIRECTION  0x004
+
 static void test_set_colocated_pins(const void *data)
 {
     QTestState *s = (QTestState *)data;
@@ -46,6 +51,27 @@ static void test_set_colocated_pins(const void *data)
     g_assert(!qtest_qom_get_bool(s, "/machine/soc/gpio", "gpioV7"));
 }
 
+static void test_set_input_pins(const void *data)
+{
+    QTestState *s = (QTestState *)data;
+    char name[16];
+    uint32_t value;
+
+    qtest_writel(s, AST2600_GPIO_BASE + GPIO_ABCD_DIRECTION, 0x00000000);
+    for (char c = 'A'; c <= 'D'; c++) {
+        for (int i = 0; i < 8; i++) {
+            sprintf(name, "gpio%c%d", c, i);
+            qtest_qom_set_bool(s, "/machine/soc/gpio", name, true);
+        }
+    }
+    value = qtest_readl(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE);
+    g_assert_cmphex(value, ==, 0xffffffff);
+
+    qtest_writel(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE, 0x00000000);
+    value = qtest_readl(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE);
+    g_assert_cmphex(value, ==, 0x00000000);
+}
+
 int main(int argc, char **argv)
 {
     QTestState *s;
@@ -56,6 +82,7 @@ int main(int argc, char **argv)
     s = qtest_init("-machine ast2600-evb");
     qtest_add_data_func("/ast2600/gpio/set_colocated_pins", s,
                         test_set_colocated_pins);
+    qtest_add_data_func("/ast2600/gpio/set_input_pins", s, test_set_input_pins);
     r = g_test_run();
     qtest_quit(s);
 
-- 
2.37.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/3] hw/gpio/aspeed: Don't let guests modify input pins
  2022-07-12  2:32 [PATCH v3 0/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
  2022-07-12  2:32 ` [PATCH v3 1/3] qtest/aspeed_gpio: Add input pin modification test Peter Delevoryas
@ 2022-07-12  2:32 ` Peter Delevoryas
  2022-07-13  6:15   ` Cédric Le Goater
  2022-07-12  2:32 ` [PATCH v3 3/3] aspeed: Add fby35-bmc slot GPIO's Peter Delevoryas
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Delevoryas @ 2022-07-12  2:32 UTC (permalink / raw)
  Cc: peter, clg, peter.maydell, andrew, joel, thuth, lvivier, pbonzini,
	qemu-arm, qemu-devel

Up until now, guests could modify input pins by overwriting the data
value register. The guest OS should only be allowed to modify output pin
values, and the QOM property setter should only be permitted to modify
input pins.

This change also updates the gpio input pin test to match this
expectation.

Andrew suggested this particularly refactoring here:

    https://lore.kernel.org/qemu-devel/23523aa1-ba81-412b-92cc-8174faba3612@www.fastmail.com/

Suggested-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Fixes: 4b7f956862dc ("hw/gpio: Add basic Aspeed GPIO model for AST2400 and AST2500")
---
 hw/gpio/aspeed_gpio.c          | 15 ++++++++-------
 tests/qtest/aspeed_gpio-test.c |  2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
index a62a673857..1e267dd482 100644
--- a/hw/gpio/aspeed_gpio.c
+++ b/hw/gpio/aspeed_gpio.c
@@ -268,7 +268,7 @@ static ptrdiff_t aspeed_gpio_set_idx(AspeedGPIOState *s, GPIOSets *regs)
 }
 
 static void aspeed_gpio_update(AspeedGPIOState *s, GPIOSets *regs,
-                               uint32_t value)
+                               uint32_t value, uint32_t mode_mask)
 {
     uint32_t input_mask = regs->input_mask;
     uint32_t direction = regs->direction;
@@ -277,7 +277,8 @@ static void aspeed_gpio_update(AspeedGPIOState *s, GPIOSets *regs,
     uint32_t diff;
     int gpio;
 
-    diff = old ^ new;
+    diff = (old ^ new);
+    diff &= mode_mask;
     if (diff) {
         for (gpio = 0; gpio < ASPEED_GPIOS_PER_SET; gpio++) {
             uint32_t mask = 1 << gpio;
@@ -339,7 +340,7 @@ static void aspeed_gpio_set_pin_level(AspeedGPIOState *s, uint32_t set_idx,
         value &= ~pin_mask;
     }
 
-    aspeed_gpio_update(s, &s->sets[set_idx], value);
+    aspeed_gpio_update(s, &s->sets[set_idx], value, ~s->sets[set_idx].direction);
 }
 
 /*
@@ -653,7 +654,7 @@ static void aspeed_gpio_write_index_mode(void *opaque, hwaddr offset,
         reg_value = update_value_control_source(set, set->data_value,
                                                 reg_value);
         set->data_read = reg_value;
-        aspeed_gpio_update(s, set, reg_value);
+        aspeed_gpio_update(s, set, reg_value, set->direction);
         return;
     case gpio_reg_idx_direction:
         reg_value = set->direction;
@@ -753,7 +754,7 @@ static void aspeed_gpio_write_index_mode(void *opaque, hwaddr offset,
             __func__, offset, data, reg_idx_type);
         return;
     }
-    aspeed_gpio_update(s, set, set->data_value);
+    aspeed_gpio_update(s, set, set->data_value, UINT32_MAX);
     return;
 }
 
@@ -799,7 +800,7 @@ static void aspeed_gpio_write(void *opaque, hwaddr offset, uint64_t data,
         data &= props->output;
         data = update_value_control_source(set, set->data_value, data);
         set->data_read = data;
-        aspeed_gpio_update(s, set, data);
+        aspeed_gpio_update(s, set, data, set->direction);
         return;
     case gpio_reg_direction:
         /*
@@ -875,7 +876,7 @@ static void aspeed_gpio_write(void *opaque, hwaddr offset, uint64_t data,
                       PRIx64"\n", __func__, offset);
         return;
     }
-    aspeed_gpio_update(s, set, set->data_value);
+    aspeed_gpio_update(s, set, set->data_value, UINT32_MAX);
     return;
 }
 
diff --git a/tests/qtest/aspeed_gpio-test.c b/tests/qtest/aspeed_gpio-test.c
index 8f52454099..d38f51d719 100644
--- a/tests/qtest/aspeed_gpio-test.c
+++ b/tests/qtest/aspeed_gpio-test.c
@@ -69,7 +69,7 @@ static void test_set_input_pins(const void *data)
 
     qtest_writel(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE, 0x00000000);
     value = qtest_readl(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE);
-    g_assert_cmphex(value, ==, 0x00000000);
+    g_assert_cmphex(value, ==, 0xffffffff);
 }
 
 int main(int argc, char **argv)
-- 
2.37.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 3/3] aspeed: Add fby35-bmc slot GPIO's
  2022-07-12  2:32 [PATCH v3 0/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
  2022-07-12  2:32 ` [PATCH v3 1/3] qtest/aspeed_gpio: Add input pin modification test Peter Delevoryas
  2022-07-12  2:32 ` [PATCH v3 2/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
@ 2022-07-12  2:32 ` Peter Delevoryas
  2022-07-12 10:10   ` Cédric Le Goater
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Delevoryas @ 2022-07-12  2:32 UTC (permalink / raw)
  Cc: peter, clg, peter.maydell, andrew, joel, thuth, lvivier, pbonzini,
	qemu-arm, qemu-devel

Signed-off-by: Peter Delevoryas <peter@pjd.dev>
---
 hw/arm/aspeed.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 6fe9b13548..0ce9a42c2b 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -1343,11 +1343,23 @@ static void fby35_reset(MachineState *state)
 
     qemu_devices_reset();
 
-    /* Board ID */
+    /* Board ID: 7 (Class-1, 4 slots) */
     object_property_set_bool(OBJECT(gpio), "gpioV4", true, &error_fatal);
     object_property_set_bool(OBJECT(gpio), "gpioV5", true, &error_fatal);
     object_property_set_bool(OBJECT(gpio), "gpioV6", true, &error_fatal);
     object_property_set_bool(OBJECT(gpio), "gpioV7", false, &error_fatal);
+
+    /* Slot presence pins, inverse polarity. (False means present) */
+    object_property_set_bool(OBJECT(gpio), "gpioH4", false, &error_fatal);
+    object_property_set_bool(OBJECT(gpio), "gpioH5", true, &error_fatal);
+    object_property_set_bool(OBJECT(gpio), "gpioH6", true, &error_fatal);
+    object_property_set_bool(OBJECT(gpio), "gpioH7", true, &error_fatal);
+
+    /* Slot 12v power pins, normal polarity. (True means powered-on) */
+    object_property_set_bool(OBJECT(gpio), "gpioB2", true, &error_fatal);
+    object_property_set_bool(OBJECT(gpio), "gpioB3", false, &error_fatal);
+    object_property_set_bool(OBJECT(gpio), "gpioB4", false, &error_fatal);
+    object_property_set_bool(OBJECT(gpio), "gpioB5", false, &error_fatal);
 }
 
 static void aspeed_machine_fby35_class_init(ObjectClass *oc, void *data)
-- 
2.37.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 3/3] aspeed: Add fby35-bmc slot GPIO's
  2022-07-12  2:32 ` [PATCH v3 3/3] aspeed: Add fby35-bmc slot GPIO's Peter Delevoryas
@ 2022-07-12 10:10   ` Cédric Le Goater
  0 siblings, 0 replies; 7+ messages in thread
From: Cédric Le Goater @ 2022-07-12 10:10 UTC (permalink / raw)
  To: Peter Delevoryas
  Cc: peter.maydell, andrew, joel, thuth, lvivier, pbonzini, qemu-arm,
	qemu-devel

On 7/12/22 04:32, Peter Delevoryas wrote:
> Signed-off-by: Peter Delevoryas <peter@pjd.dev>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.


> ---
>   hw/arm/aspeed.c | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index 6fe9b13548..0ce9a42c2b 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -1343,11 +1343,23 @@ static void fby35_reset(MachineState *state)
>   
>       qemu_devices_reset();
>   
> -    /* Board ID */
> +    /* Board ID: 7 (Class-1, 4 slots) */
>       object_property_set_bool(OBJECT(gpio), "gpioV4", true, &error_fatal);
>       object_property_set_bool(OBJECT(gpio), "gpioV5", true, &error_fatal);
>       object_property_set_bool(OBJECT(gpio), "gpioV6", true, &error_fatal);
>       object_property_set_bool(OBJECT(gpio), "gpioV7", false, &error_fatal);
> +
> +    /* Slot presence pins, inverse polarity. (False means present) */
> +    object_property_set_bool(OBJECT(gpio), "gpioH4", false, &error_fatal);
> +    object_property_set_bool(OBJECT(gpio), "gpioH5", true, &error_fatal);
> +    object_property_set_bool(OBJECT(gpio), "gpioH6", true, &error_fatal);
> +    object_property_set_bool(OBJECT(gpio), "gpioH7", true, &error_fatal);
> +
> +    /* Slot 12v power pins, normal polarity. (True means powered-on) */
> +    object_property_set_bool(OBJECT(gpio), "gpioB2", true, &error_fatal);
> +    object_property_set_bool(OBJECT(gpio), "gpioB3", false, &error_fatal);
> +    object_property_set_bool(OBJECT(gpio), "gpioB4", false, &error_fatal);
> +    object_property_set_bool(OBJECT(gpio), "gpioB5", false, &error_fatal);
>   }
>   
>   static void aspeed_machine_fby35_class_init(ObjectClass *oc, void *data)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/3] qtest/aspeed_gpio: Add input pin modification test
  2022-07-12  2:32 ` [PATCH v3 1/3] qtest/aspeed_gpio: Add input pin modification test Peter Delevoryas
@ 2022-07-12 10:15   ` Cédric Le Goater
  0 siblings, 0 replies; 7+ messages in thread
From: Cédric Le Goater @ 2022-07-12 10:15 UTC (permalink / raw)
  To: Peter Delevoryas
  Cc: peter.maydell, andrew, joel, thuth, lvivier, pbonzini, qemu-arm,
	qemu-devel

On 7/12/22 04:32, Peter Delevoryas wrote:
> Verify the current behavior, which is that input pins can be modified by
> guest OS register writes.
> 
> Signed-off-by: Peter Delevoryas <peter@pjd.dev>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.


> ---
>   tests/qtest/aspeed_gpio-test.c | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
> 
> diff --git a/tests/qtest/aspeed_gpio-test.c b/tests/qtest/aspeed_gpio-test.c
> index bac63e8742..8f52454099 100644
> --- a/tests/qtest/aspeed_gpio-test.c
> +++ b/tests/qtest/aspeed_gpio-test.c
> @@ -28,6 +28,11 @@
>   #include "qapi/qmp/qdict.h"
>   #include "libqtest-single.h"
>   
> +#define AST2600_GPIO_BASE 0x1E780000
> +
> +#define GPIO_ABCD_DATA_VALUE 0x000
> +#define GPIO_ABCD_DIRECTION  0x004
> +
>   static void test_set_colocated_pins(const void *data)
>   {
>       QTestState *s = (QTestState *)data;
> @@ -46,6 +51,27 @@ static void test_set_colocated_pins(const void *data)
>       g_assert(!qtest_qom_get_bool(s, "/machine/soc/gpio", "gpioV7"));
>   }
>   
> +static void test_set_input_pins(const void *data)
> +{
> +    QTestState *s = (QTestState *)data;
> +    char name[16];
> +    uint32_t value;
> +
> +    qtest_writel(s, AST2600_GPIO_BASE + GPIO_ABCD_DIRECTION, 0x00000000);
> +    for (char c = 'A'; c <= 'D'; c++) {
> +        for (int i = 0; i < 8; i++) {
> +            sprintf(name, "gpio%c%d", c, i);
> +            qtest_qom_set_bool(s, "/machine/soc/gpio", name, true);
> +        }
> +    }
> +    value = qtest_readl(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE);
> +    g_assert_cmphex(value, ==, 0xffffffff);
> +
> +    qtest_writel(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE, 0x00000000);
> +    value = qtest_readl(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE);
> +    g_assert_cmphex(value, ==, 0x00000000);
> +}
> +
>   int main(int argc, char **argv)
>   {
>       QTestState *s;
> @@ -56,6 +82,7 @@ int main(int argc, char **argv)
>       s = qtest_init("-machine ast2600-evb");
>       qtest_add_data_func("/ast2600/gpio/set_colocated_pins", s,
>                           test_set_colocated_pins);
> +    qtest_add_data_func("/ast2600/gpio/set_input_pins", s, test_set_input_pins);
>       r = g_test_run();
>       qtest_quit(s);
>   



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 2/3] hw/gpio/aspeed: Don't let guests modify input pins
  2022-07-12  2:32 ` [PATCH v3 2/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
@ 2022-07-13  6:15   ` Cédric Le Goater
  0 siblings, 0 replies; 7+ messages in thread
From: Cédric Le Goater @ 2022-07-13  6:15 UTC (permalink / raw)
  To: Peter Delevoryas
  Cc: peter.maydell, andrew, joel, thuth, lvivier, pbonzini, qemu-arm,
	qemu-devel

On 7/12/22 04:32, Peter Delevoryas wrote:
> Up until now, guests could modify input pins by overwriting the data
> value register. The guest OS should only be allowed to modify output pin
> values, and the QOM property setter should only be permitted to modify
> input pins.
> 
> This change also updates the gpio input pin test to match this
> expectation.
> 
> Andrew suggested this particularly refactoring here:
> 
>      https://lore.kernel.org/qemu-devel/23523aa1-ba81-412b-92cc-8174faba3612@www.fastmail.com/
> 
> Suggested-by: Andrew Jeffery <andrew@aj.id.au>
> Signed-off-by: Peter Delevoryas <peter@pjd.dev>
> Fixes: 4b7f956862dc ("hw/gpio: Add basic Aspeed GPIO model for AST2400 and AST2500")
> ---


Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.


>   hw/gpio/aspeed_gpio.c          | 15 ++++++++-------
>   tests/qtest/aspeed_gpio-test.c |  2 +-
>   2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
> index a62a673857..1e267dd482 100644
> --- a/hw/gpio/aspeed_gpio.c
> +++ b/hw/gpio/aspeed_gpio.c
> @@ -268,7 +268,7 @@ static ptrdiff_t aspeed_gpio_set_idx(AspeedGPIOState *s, GPIOSets *regs)
>   }
>   
>   static void aspeed_gpio_update(AspeedGPIOState *s, GPIOSets *regs,
> -                               uint32_t value)
> +                               uint32_t value, uint32_t mode_mask)
>   {
>       uint32_t input_mask = regs->input_mask;
>       uint32_t direction = regs->direction;
> @@ -277,7 +277,8 @@ static void aspeed_gpio_update(AspeedGPIOState *s, GPIOSets *regs,
>       uint32_t diff;
>       int gpio;
>   
> -    diff = old ^ new;
> +    diff = (old ^ new);
> +    diff &= mode_mask;
>       if (diff) {
>           for (gpio = 0; gpio < ASPEED_GPIOS_PER_SET; gpio++) {
>               uint32_t mask = 1 << gpio;
> @@ -339,7 +340,7 @@ static void aspeed_gpio_set_pin_level(AspeedGPIOState *s, uint32_t set_idx,
>           value &= ~pin_mask;
>       }
>   
> -    aspeed_gpio_update(s, &s->sets[set_idx], value);
> +    aspeed_gpio_update(s, &s->sets[set_idx], value, ~s->sets[set_idx].direction);
>   }
>   
>   /*
> @@ -653,7 +654,7 @@ static void aspeed_gpio_write_index_mode(void *opaque, hwaddr offset,
>           reg_value = update_value_control_source(set, set->data_value,
>                                                   reg_value);
>           set->data_read = reg_value;
> -        aspeed_gpio_update(s, set, reg_value);
> +        aspeed_gpio_update(s, set, reg_value, set->direction);
>           return;
>       case gpio_reg_idx_direction:
>           reg_value = set->direction;
> @@ -753,7 +754,7 @@ static void aspeed_gpio_write_index_mode(void *opaque, hwaddr offset,
>               __func__, offset, data, reg_idx_type);
>           return;
>       }
> -    aspeed_gpio_update(s, set, set->data_value);
> +    aspeed_gpio_update(s, set, set->data_value, UINT32_MAX);
>       return;
>   }
>   
> @@ -799,7 +800,7 @@ static void aspeed_gpio_write(void *opaque, hwaddr offset, uint64_t data,
>           data &= props->output;
>           data = update_value_control_source(set, set->data_value, data);
>           set->data_read = data;
> -        aspeed_gpio_update(s, set, data);
> +        aspeed_gpio_update(s, set, data, set->direction);
>           return;
>       case gpio_reg_direction:
>           /*
> @@ -875,7 +876,7 @@ static void aspeed_gpio_write(void *opaque, hwaddr offset, uint64_t data,
>                         PRIx64"\n", __func__, offset);
>           return;
>       }
> -    aspeed_gpio_update(s, set, set->data_value);
> +    aspeed_gpio_update(s, set, set->data_value, UINT32_MAX);
>       return;
>   }
>   
> diff --git a/tests/qtest/aspeed_gpio-test.c b/tests/qtest/aspeed_gpio-test.c
> index 8f52454099..d38f51d719 100644
> --- a/tests/qtest/aspeed_gpio-test.c
> +++ b/tests/qtest/aspeed_gpio-test.c
> @@ -69,7 +69,7 @@ static void test_set_input_pins(const void *data)
>   
>       qtest_writel(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE, 0x00000000);
>       value = qtest_readl(s, AST2600_GPIO_BASE + GPIO_ABCD_DATA_VALUE);
> -    g_assert_cmphex(value, ==, 0x00000000);
> +    g_assert_cmphex(value, ==, 0xffffffff);
>   }
>   
>   int main(int argc, char **argv)



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-13  6:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-12  2:32 [PATCH v3 0/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
2022-07-12  2:32 ` [PATCH v3 1/3] qtest/aspeed_gpio: Add input pin modification test Peter Delevoryas
2022-07-12 10:15   ` Cédric Le Goater
2022-07-12  2:32 ` [PATCH v3 2/3] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
2022-07-13  6:15   ` Cédric Le Goater
2022-07-12  2:32 ` [PATCH v3 3/3] aspeed: Add fby35-bmc slot GPIO's Peter Delevoryas
2022-07-12 10:10   ` Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).