Skip to contentSkip to conversation

minios: Correct HYPERVISOR_physdev_op()

PATCH In review Andrew Cooper 4 participants 6 messages Jan 24, 2014 – Jan 28, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios: Correct HYPERVISOR_physdev_op()

A physdev_op is a two argument hypercall, taking a command paramter and an optional pointer to a structure.

CC Stefano Stabellini <[email protected]>
CC Samuel Thibault <[email protected]>
---
 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h |    4 ++--
 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +2 -2
index ef52ecd..dcfbe41 100644
@@ -255,9 +255,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
extras/mini-os/include/x86/x86_64/hypercall-x86_64.h +2 -2
index 513d74e..7083763 100644
@@ -256,9 +256,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 1 line · Andrew Cooper

A physdev_op is a two argument hypercall, taking a command paramter and an

                                                             ^^^^^^^- parameter
Quoted 50 lines

optional pointer to a structure.

CC Stefano Stabellini <[email protected]>
CC Samuel Thibault <[email protected]>
---
 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h |    4 ++--
 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +2 -2
index ef52ecd..dcfbe41 100644
@@ -255,9 +255,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
extras/mini-os/include/x86/x86_64/hypercall-x86_64.h +2 -2
index 513d74e..7083763 100644
@@ -256,9 +256,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 1/1
#2 lore raw
In reply to Andrew Cooper
Quoted 2 lines · Andrew Cooper, le Fri 24 Jan 2014 18:28:11 +0000, a écrit :

A physdev_op is a two argument hypercall, taking a command paramter and an optional pointer to a structure.

Mmm, this this a remnant of the old hypercall which was taking one parameter only, indeed.

Quoted 3 lines
CC Stefano Stabellini <[email protected]>
CC Samuel Thibault <[email protected]>
Quoted 40 lines
---
 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h |    4 ++--
 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +2 -2
index ef52ecd..dcfbe41 100644
@@ -255,9 +255,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
extras/mini-os/include/x86/x86_64/hypercall-x86_64.h +2 -2
index 513d74e..7083763 100644
@@ -256,9 +256,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
Signature · 1 line
1.7.10.4
Signature · 2 lines
Samuel
#include <culture.h>
#3 lore raw
In reply to Andrew Cooper
Quoted 6 lines · Andrew Cooper

A physdev_op is a two argument hypercall, taking a command paramter and an optional pointer to a structure.

CC Stefano Stabellini <[email protected]>
CC Samuel Thibault <[email protected]>

This hypercall is unused in minios and stubdoms I think? (Trying to gauge how critical the error is).

Quoted 37 lines
---
 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h |    4 ++--
 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +2 -2
index ef52ecd..dcfbe41 100644
@@ -255,9 +255,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
extras/mini-os/include/x86/x86_64/hypercall-x86_64.h +2 -2
index 513d74e..7083763 100644
@@ -256,9 +256,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
#4 lore raw
Quoted 9 lines · Ian Campbell
Quoted 6 lines · Andrew Cooper

A physdev_op is a two argument hypercall, taking a command paramter and an optional pointer to a structure.

CC Stefano Stabellini <[email protected]>
CC Samuel Thibault <[email protected]>

This hypercall is unused in minios and stubdoms I think? (Trying to gauge how critical the error is).

Correct. I suppose it is more of a "nice to fix" than "must fix" at this stage, although I was quite surprised that I needed to fix it.

~Andrew

Quoted 39 lines
Quoted 38 lines
---
 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h |    4 ++--
 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +2 -2
index ef52ecd..dcfbe41 100644
@@ -255,9 +255,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
extras/mini-os/include/x86/x86_64/hypercall-x86_64.h +2 -2
index 513d74e..7083763 100644
@@ -256,9 +256,9 @@ HYPERVISOR_console_io(
 
 static inline int
 HYPERVISOR_physdev_op(
-	void *physdev_op)
+	int cmd, void *physdev_op)
 {
-	return _hypercall1(int, physdev_op, physdev_op);
+	return _hypercall2(int, physdev_op, cmd, physdev_op);
 }
 
 static inline int
#5 lore raw
Quoted 5 lines · Andrew Cooper
Quoted 4 lines · Ian Campbell
Quoted 3 lines · Andrew Cooper

A physdev_op is a two argument hypercall, taking a command paramter and an optional pointer to a structure.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
CC Stefano Stabellini <[email protected]>
CC Samuel Thibault <[email protected]>

This hypercall is unused in minios and stubdoms I think? (Trying to gauge how critical the error is).

Correct. I suppose it is more of a "nice to fix" than "must fix" at this stage, although I was quite surprised that I needed to fix it.

Given that the function is just wrong and that it appears to be unused in tree I think a simple compile test to confirm is sufficient to take it into 4.4. Since that succeeded I have acked + applied.

Ian.