Skip to contentSkip to conversation

drivers: xen: events: fix build issues with disabled Xen HVC

PATCH In review Dmytro Firsov 3 participants 8 messages Jul 4, 2022 – Aug 4, 2022 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: xen: events: fix build issues with disabled Xen HVC

Some setups do not use Xen hypervisor console for logging, e.g. they use emulated PL011 hardware or shared peripherals (real UART). In such cases Xen HVC will be disabled on a build time and will cause issues in current driver implementation.

This commit fixes build issues in Xen event channel driver, caused by absense of console event channel, that is not available when console config is disabled. Now console related code will be removed when Xen HVC is turned off.

---
 drivers/xen/events.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/xen/events.c +5 -0
index 5e90a65846..532216fece 100644
@@ -23,7 +23,9 @@
 #include <xen/events.h>
 #include <xen/hvm.h>
 
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
 extern u32 console_evtchn;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
 
 #define NR_EVS 1024
 
@@ -51,8 +53,11 @@ void unbind_all_ports(void)
 	struct vcpu_info *vcpu_info = &s->vcpu_info[cpu];
 
 	for (i = 0; i < NR_EVS; i++) {
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
 		if (i == console_evtchn)
 			continue;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
+
 		if (test_and_clear_bit(i, bound_ports)) {
 			printf("port %d still bound!\n", i);
 			unbind_evtchn(i);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 44 lines · Dmytro Firsov

Some setups do not use Xen hypervisor console for logging, e.g. they use emulated PL011 hardware or shared peripherals (real UART). In such cases Xen HVC will be disabled on a build time and will cause issues in current driver implementation.

This commit fixes build issues in Xen event channel driver, caused by absense of console event channel, that is not available when console config is disabled. Now console related code will be removed when Xen HVC is turned off.

---
 drivers/xen/events.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/xen/events.c +5 -1
index 5e90a65846..532216fece 100644
@@ -23,7 +23,9 @@
 #include <xen/events.h>
 #include <xen/hvm.h>
 
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
 extern u32 console_evtchn;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
 
 #define NR_EVS 1024
 
@@ -51,8 +53,11 @@ void unbind_all_ports(void)
        struct vcpu_info *vcpu_info = &s->vcpu_info[cpu];
 
        for (i = 0; i < NR_EVS; i++) {
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
                if (i == console_evtchn)
                        continue;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
+
                if (test_and_clear_bit(i, bound_ports)) {
                        printf("port %d still bound!\n", i);
                        unbind_evtchn(i);
--

2.25.1

author Reviewed-by Anastasiia Lukianenko
#2 lore raw

Can moderators, please, take a look on this patch?

On 20.07.22 23:43, Nastya Vicodin wrote:

On Mon, Jul 4, 2022 at 3:05 PM Dmytro Firsov <[email protected]<mailto:[email protected]>> wrote:
Some setups do not use Xen hypervisor console for logging, e.g. they
use emulated PL011 hardware or shared peripherals (real UART). In such
cases Xen HVC will be disabled on a build time and will cause issues in
current driver implementation.

This commit fixes build issues in Xen event channel driver, caused by absense of console event channel, that is not available when console config is disabled. Now console related code will be removed when Xen HVC is turned off.

---
 drivers/xen/events.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/xen/events.c +5 -0
index 5e90a65846..532216fece 100644
@@ -23,7 +23,9 @@
 #include <xen/events.h>
 #include <xen/hvm.h>
 
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
 extern u32 console_evtchn;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
 
 #define NR_EVS 1024
 
@@ -51,8 +53,11 @@ void unbind_all_ports(void)
        struct vcpu_info *vcpu_info = &s->vcpu_info[cpu];
 
        for (i = 0; i < NR_EVS; i++) {
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
                if (i == console_evtchn)
                        continue;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
+
                if (test_and_clear_bit(i, bound_ports)) {
                        printf("port %d still bound!\n", i);
                        unbind_evtchn(i);

--
2.25.1

#3 lore raw
Quoted 1 line · Dmytro Firsov

Can moderators, please, take a look on this patch?

What about it?

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 48 lines · Nastya Vicodin

On Mon, Jul 4, 2022 at 3:05 PM Dmytro Firsov <[email protected]<mailto:[email protected]>> wrote:
Some setups do not use Xen hypervisor console for logging, e.g. they
use emulated PL011 hardware or shared peripherals (real UART). In such
cases Xen HVC will be disabled on a build time and will cause issues in
current driver implementation.

This commit fixes build issues in Xen event channel driver, caused by absense of console event channel, that is not available when console config is disabled. Now console related code will be removed when Xen HVC is turned off.

---
 drivers/xen/events.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/xen/events.c +5 -1
index 5e90a65846..532216fece 100644
@@ -23,7 +23,9 @@
 #include <xen/events.h>
 #include <xen/hvm.h>
 
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
 extern u32 console_evtchn;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
 
 #define NR_EVS 1024
 
@@ -51,8 +53,11 @@ void unbind_all_ports(void)
        struct vcpu_info *vcpu_info = &s->vcpu_info[cpu];
 
        for (i = 0; i < NR_EVS; i++) {
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
                if (i == console_evtchn)
                        continue;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
+
                if (test_and_clear_bit(i, bound_ports)) {
                        printf("port %d still bound!\n", i);
                        unbind_evtchn(i);
--

2.25.1

Signature · 1 line
Tom
#4 lore raw

It received reviewed-by from code maintainer. Does anything else needed to take it to u-boot/master?

Quoted 53 lines · Tom Rini
Quoted 1 line · Dmytro Firsov

Can moderators, please, take a look on this patch?

What about it?

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 47 lines · Nastya Vicodin

On Mon, Jul 4, 2022 at 3:05 PM Dmytro Firsov <[email protected]<mailto:[email protected]>> wrote:
Some setups do not use Xen hypervisor console for logging, e.g. they
use emulated PL011 hardware or shared peripherals (real UART). In such
cases Xen HVC will be disabled on a build time and will cause issues in
current driver implementation.

This commit fixes build issues in Xen event channel driver, caused by absense of console event channel, that is not available when console config is disabled. Now console related code will be removed when Xen HVC is turned off.

---
  drivers/xen/events.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/xen/events.c +5 -1
index 5e90a65846..532216fece 100644
@@ -23,7 +23,9 @@
  #include <xen/events.h>
  #include <xen/hvm.h>
 
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
  extern u32 console_evtchn;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
 
  #define NR_EVS 1024
 
@@ -51,8 +53,11 @@ void unbind_all_ports(void)
         struct vcpu_info *vcpu_info = &s->vcpu_info[cpu];
 
         for (i = 0; i < NR_EVS; i++) {
+#if CONFIG_IS_ENABLED(XEN_SERIAL)
                 if (i == console_evtchn)
                         continue;
+#endif /* CONFIG_IS_ENABLED(XEN_SERIAL) */
+
                 if (test_and_clear_bit(i, bound_ports)) {
                         printf("port %d still bound!\n", i);
                         unbind_evtchn(i);
--

2.25.1

#5 lore raw
Quoted 2 lines · Dmytro Firsov

It received reviewed-by from code maintainer. Does anything else needed to take it to u-boot/master?

Ah. I'll probably pick it up soon.

Signature · 1 line
Tom
#6 lore raw
Quoted 6 lines · Tom Rini
Quoted 2 lines · Dmytro Firsov

It received reviewed-by from code maintainer. Does anything else needed to take it to u-boot/master?

Ah. I'll probably pick it up soon.

Thanks!

#7 lore raw
In reply to Dmytro Firsov
Quoted 10 lines · Dmytro Firsov

Some setups do not use Xen hypervisor console for logging, e.g. they use emulated PL011 hardware or shared peripherals (real UART). In such cases Xen HVC will be disabled on a build time and will cause issues in current driver implementation.

This commit fixes build issues in Xen event channel driver, caused by absense of console event channel, that is not available when console config is disabled. Now console related code will be removed when Xen HVC is turned off.

Quoted 4 lines

Applied to u-boot/master, thanks!

Signature · 1 line
Tom