Skip to contentSkip to conversation

ocaml: fix arm build

PATCH In review Wei Liu 3 participants 6 messages Jan 17, 2018 – Jan 18, 2018

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 ocaml: fix arm build

ARM doesn't have emulation_flags in the arch_domainconfig.

---
Cc: Ian Jackson <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/ocaml/libs/xc/xenctrl_stubs.c +6 -0
index 0b5a2361c0..fd128778b3 100644
@@ -175,11 +175,15 @@ CAMLprim value stub_xc_domain_create(value xch, value ssidref,
 		caml_failwith("Unhandled: ARM");
 		break;
 
+#if defined(__i386__) || defined(__x86_64__)
 	case 1: /* X86 - emulation flags in the block */
 		for (l = Field(Field(domconfig, 0), 0);
 		     l != Val_none;
 		     l = Field(l, 1))
 			config.emulation_flags |= 1u << Int_val(Field(l, 0));
+#else
+		caml_failwith("Unhandled: x86");
+#endif
 		break;
 
 	default:
@@ -320,6 +324,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 
 	Store_field(result, 15, tmp);
 
+#if defined(__i386__) || defined(__x86_64__)
 	/* emulation_flags: x86_arch_emulation_flags list; */
 	tmp = emul_list = Val_emptylist;
 	for (i = 0; i < 10; i++) {
@@ -341,6 +346,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 	Store_field(arch_config, 0, x86_arch_config);
 
 	Store_field(result, 16, arch_config);
+#endif
 
 	CAMLreturn(result);
 }
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw

Hi Wei,

Quoted 3 lines · Wei Liu

ARM doesn't have emulation_flags in the arch_domainconfig.

Cheers,

Quoted 45 lines

---
Cc: Ian Jackson <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
  tools/ocaml/libs/xc/xenctrl_stubs.c | 6 ++++++
  1 file changed, 6 insertions(+)
tools/ocaml/libs/xc/xenctrl_stubs.c +6 -0
index 0b5a2361c0..fd128778b3 100644
@@ -175,11 +175,15 @@ CAMLprim value stub_xc_domain_create(value xch, value ssidref,
  		caml_failwith("Unhandled: ARM");
  		break;
 
+#if defined(__i386__) || defined(__x86_64__)
  	case 1: /* X86 - emulation flags in the block */
  		for (l = Field(Field(domconfig, 0), 0);
  		     l != Val_none;
  		     l = Field(l, 1))
  			config.emulation_flags |= 1u << Int_val(Field(l, 0));
+#else
+		caml_failwith("Unhandled: x86");
+#endif
  		break;
 
  	default:
@@ -320,6 +324,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 
  	Store_field(result, 15, tmp);
 
+#if defined(__i386__) || defined(__x86_64__)
  	/* emulation_flags: x86_arch_emulation_flags list; */
  	tmp = emul_list = Val_emptylist;
  	for (i = 0; i < 10; i++) {
@@ -341,6 +346,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
  	Store_field(arch_config, 0, x86_arch_config);
 
  	Store_field(result, 16, arch_config);
+#endif
 
  	CAMLreturn(result);
  }
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
author
#2 lore raw
In reply to Wei Liu

CC Ocaml experts

Quoted 50 lines · Wei Liu

ARM doesn't have emulation_flags in the arch_domainconfig.

---
Cc: Ian Jackson <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/ocaml/libs/xc/xenctrl_stubs.c +6 -0
index 0b5a2361c0..fd128778b3 100644
@@ -175,11 +175,15 @@ CAMLprim value stub_xc_domain_create(value xch, value ssidref,
 		caml_failwith("Unhandled: ARM");
 		break;
 
+#if defined(__i386__) || defined(__x86_64__)
 	case 1: /* X86 - emulation flags in the block */
 		for (l = Field(Field(domconfig, 0), 0);
 		     l != Val_none;
 		     l = Field(l, 1))
 			config.emulation_flags |= 1u << Int_val(Field(l, 0));
+#else
+		caml_failwith("Unhandled: x86");
+#endif
 		break;
 
 	default:
@@ -320,6 +324,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 
 	Store_field(result, 15, tmp);
 
+#if defined(__i386__) || defined(__x86_64__)
 	/* emulation_flags: x86_arch_emulation_flags list; */
 	tmp = emul_list = Val_emptylist;
 	for (i = 0; i < 10; i++) {
@@ -341,6 +346,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 	Store_field(arch_config, 0, x86_arch_config);
 
 	Store_field(result, 16, arch_config);
+#endif
 
 	CAMLreturn(result);
 }
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

This looks good to me. I don't think conditional compilation can be avoided here.

-- Christian

Quoted 47 lines · Wei Liu

CC Ocaml experts

Quoted 42 lines · Wei Liu

ARM doesn't have emulation_flags in the arch_domainconfig.

---
Cc: Ian Jackson <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Andrew Cooper <[email protected]>
---
tools/ocaml/libs/xc/xenctrl_stubs.c | 6 ++++++

1 file changed, 6 insertions(+)
tools/ocaml/libs/xc/xenctrl_stubs.c +5 -0
index 0b5a2361c0..fd128778b3 100644
@@ -175,11 +175,15 @@ CAMLprim value stub_xc_domain_create(value xch, value ssidref,
 		caml_failwith("Unhandled: ARM");
 		break;
 
+#if defined(__i386__) || defined(__x86_64__)
 	case 1: /* X86 - emulation flags in the block */
 		for (l = Field(Field(domconfig, 0), 0);
 		     l != Val_none;
 		     l = Field(l, 1))
 			config.emulation_flags |= 1u << Int_val(Field(l, 0));
+#else
+		caml_failwith("Unhandled: x86");
+#endif
 		break;
 
 	default:
@@ -320,6 +324,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 
 	Store_field(result, 15, tmp);
 
+#if defined(__i386__) || defined(__x86_64__)
 	/* emulation_flags: x86_arch_emulation_flags list; */
 	tmp = emul_list = Val_emptylist;
 	for (i = 0; i < 10; i++) {
@@ -341,6 +346,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 	Store_field(arch_config, 0, x86_arch_config);
 
Quoted 8 lines
Quoted 8 lines
tools/ocaml/libs/xc/xenctrl_stubs.c +1 -0
 	Store_field(result, 16, arch_config);
+#endif
 
 	CAMLreturn(result);
 }
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#4 lore raw
In reply to Wei Liu
Quoted 16 lines · Wei Liu

ARM doesn't have emulation_flags in the arch_domainconfig.

---
Cc: Ian Jackson <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/ocaml/libs/xc/xenctrl_stubs.c +0 -0
index 0b5a2361c0..fd128778b3 100644

tools/ocaml/libs/xc/xenctrl_stubs.c CAMLprim value stub_xc_domain_create(value xch, value ssidref, · line 179

Quoted 5 lines
tools/ocaml/libs/xc/xenctrl_stubs.c +1 -0
@@ -175,11 +175,15 @@ CAMLprim value stub_xc_domain_create(value xch, value ssidref,
 		caml_failwith("Unhandled: ARM");
 		break;
 
+#if defined(__i386__) || defined(__x86_64__)
 	case 1: /* X86 - emulation flags in the block */

The label will be moved outside of the #ifdef.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#5 lore raw
Quoted 20 lines · Wei Liu
Quoted 19 lines · Wei Liu

ARM doesn't have emulation_flags in the arch_domainconfig.

---
Cc: Ian Jackson <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/ocaml/libs/xc/xenctrl_stubs.c +0 -0
index 0b5a2361c0..fd128778b3 100644
@@ -175,11 +175,15 @@ CAMLprim value stub_xc_domain_create(value xch, value ssidref,
 		caml_failwith("Unhandled: ARM");
 		break;
 
Quoted 4 lines

tools/ocaml/libs/xc/xenctrl_stubs.c CAMLprim value stub_xc_domain_create(value xch, value ssidref, · line 179

Quoted 2 lines
tools/ocaml/libs/xc/xenctrl_stubs.c +1 -0
+#if defined(__i386__) || defined(__x86_64__)
 	case 1: /* X86 - emulation flags in the block */

The label will be moved outside of the #ifdef.

In the interest of unblocking things I have pushed a version of this patch to staging.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel