Skip to contentSkip to conversation

pc: fixes broken compat logic

PATCH In review Igor Mammedov 5 participants 12 messages Sep 14, 2016 – Sep 18, 2016

lore
Share & tools
lore
#0 lore raw

cover pc: fixes broken compat logic

fixes mistakes made by:

targte-i386: Add virtual L3 cache support
https://www.mail-archive.com/[email protected]/msg395418.html

Igor Mammedov (2):
pc: fix regression introduced by adding 2.8 machine
target-i386: turn off CPU.l3-cache only for 2.7 and older machine
types

 include/hw/i386/pc.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 pc: fix regression introduced by adding 2.8 machine

commit (a4d3c834 pc: Add 2.8 machine) didn't ammend PC_COMPAT_2_6 to include PC_COMPAT_2_7 which results in

    {\
        .driver   = "virtio-pci",\
        .property = "page-per-vq",\
        .value    = "on",\
    },

and

    {\
        .driver   = TYPE_X86_CPU,\
        .property = "l3-cache",\
        .value    = "off",\
    },

being ignored and as result change PC_COMPAT_2_6 behaviour.

---
 include/hw/i386/pc.h | 1 +
 1 file changed, 1 insertion(+)
include/hw/i386/pc.h +1 -0
index ebba151..d5654ab 100644
@@ -381,6 +381,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
     HW_COMPAT_2_7
 
 #define PC_COMPAT_2_6 \
+    PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
     {\
         .driver   = "fw_cfg_io",\
Signature · 1 line
2.7.4
Reviewed-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] pc: fix regression introduced by adding 2.8 machine

Quoted 30 lines · Igor Mammedov

commit (a4d3c834 pc: Add 2.8 machine) didn't ammend PC_COMPAT_2_6 to include PC_COMPAT_2_7 which results in

    {\
        .driver   = "virtio-pci",\
        .property = "page-per-vq",\
        .value    = "on",\
    },

and

    {\
        .driver   = TYPE_X86_CPU,\
        .property = "l3-cache",\
        .value    = "off",\
    },

being ignored and as result change PC_COMPAT_2_6 behaviour.

---
 include/hw/i386/pc.h | 1 +
 1 file changed, 1 insertion(+)
include/hw/i386/pc.h +0 -0
index ebba151..d5654ab 100644

include/hw/i386/pc.h bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); · line 387

Quoted 7 lines
include/hw/i386/pc.h +1 -0
@@ -381,6 +381,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
     HW_COMPAT_2_7
 
 #define PC_COMPAT_2_6 \
+    PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
     {\
         .driver   = "fw_cfg_io",\

Thanks,
Marcel

#3 lore raw

Re: [Qemu-devel] [PATCH 1/2] pc: fix regression introduced by adding 2.8 machine

In reply to Igor Mammedov
Quoted 19 lines · Igor Mammedov

commit (a4d3c834 pc: Add 2.8 machine) didn't ammend PC_COMPAT_2_6 to include PC_COMPAT_2_7 which results in

    {\
        .driver   = "virtio-pci",\
        .property = "page-per-vq",\
        .value    = "on",\
    },

and

    {\
        .driver   = TYPE_X86_CPU,\
        .property = "l3-cache",\
        .value    = "off",\
    },

being ignored and as result change PC_COMPAT_2_6 behaviour.

[...]

Quoted 5 lines

#define PC_COMPAT_2_6 \

+    PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
     {\
         .driver   = "fw_cfg_io",\

Isn't this supposed to be unnecessary since commit bacc344c ("machine: add properties to compat_props incrementaly")?

Signature · 1 line
Eduardo
#4 lore raw

Re: [Qemu-devel] [PATCH 1/2] pc: fix regression introduced by adding 2.8 machine

Quoted 21 lines · Eduardo Habkost
Quoted 19 lines · Igor Mammedov

commit (a4d3c834 pc: Add 2.8 machine) didn't ammend PC_COMPAT_2_6 to include PC_COMPAT_2_7 which results in

    {\
        .driver   = "virtio-pci",\
        .property = "page-per-vq",\
        .value    = "on",\
    },

and

    {\
        .driver   = TYPE_X86_CPU,\
        .property = "l3-cache",\
        .value    = "off",\
    },

being ignored and as result change PC_COMPAT_2_6 behaviour.

[...]

Quoted 11 lines
Quoted 5 lines

#define PC_COMPAT_2_6 \

+    PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
     {\
         .driver   = "fw_cfg_io",\

Isn't this supposed to be unnecessary since commit bacc344c ("machine: add properties to compat_props incrementaly")?

Signature · 1 line
Eduardo

Indeed, I tested page-per-vq and it seems on for 2.6. Igor, Marcel, could you comment pls?

Signature · 1 line
MST
#5 lore raw

Re: [Qemu-devel] [PATCH 1/2] pc: fix regression introduced by adding 2.8 machine

Quoted 31 lines · On Thu, 15 Sep 2016 18:18:46 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 30 lines · Eduardo Habkost
Quoted 19 lines · Igor Mammedov

commit (a4d3c834 pc: Add 2.8 machine) didn't ammend PC_COMPAT_2_6 to include PC_COMPAT_2_7 which results in

    {\
        .driver   = "virtio-pci",\
        .property = "page-per-vq",\
        .value    = "on",\
    },

and

    {\
        .driver   = TYPE_X86_CPU,\
        .property = "l3-cache",\
        .value    = "off",\
    },

being ignored and as result change PC_COMPAT_2_6 behaviour.

[...]

Quoted 5 lines

#define PC_COMPAT_2_6 \

+    PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
     {\
         .driver   = "fw_cfg_io",\  

Isn't this supposed to be unnecessary since commit bacc344c ("machine: add properties to compat_props incrementaly")?

Quoted 6 lines
Quoted 2 lines
Signature · 1 line
Eduardo  

Indeed, I tested page-per-vq and it seems on for 2.6. Igor, Marcel, could you comment pls?

You are right, I think inconsistency in

#define PC_COMPAT_2_5 \                                                          
    PC_COMPAT_2_6 \                                                              
    HW_COMPAT_2_5  

and

#define PC_COMPAT_2_7 \                                                          
    PC_COMPAT_2_8 \                                                              
    HW_COMPAT_2_7

made me think that we still need it.

I'd better clean-up PC_COMPAT_2_5 and PC_COMPAT_2_7

#6 lore raw

PATCH 2/2 target-i386: turn off CPU.l3-cache only for 2.7 and older machine types

In reply to Igor Mammedov

commit (14c985cff target-i386: present virtual L3 cache info for vcpus) misplaced compat property putting it in new 2.8 machine type which would effectively to disable feature until 2.9 is released. Intent of commit probably should be to disable feature for 2.7 and older while allowing not yet released 2.8 to have feature enabled by default.

---
 include/hw/i386/pc.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
include/hw/i386/pc.h +4 -5
index d5654ab..1c5fd08 100644
@@ -369,17 +369,16 @@ int e820_get_num_entries(void);
 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
 
 #define PC_COMPAT_2_8 \
+
+#define PC_COMPAT_2_7 \
+    PC_COMPAT_2_8 \
+    HW_COMPAT_2_7 \
     {\
         .driver   = TYPE_X86_CPU,\
         .property = "l3-cache",\
         .value    = "off",\
     },
 
-
-#define PC_COMPAT_2_7 \
-    PC_COMPAT_2_8 \
-    HW_COMPAT_2_7
-
 #define PC_COMPAT_2_6 \
     PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
Signature · 1 line
2.7.4
Reviewed-by on v1 2/2
#7 lore raw

Re: [Qemu-devel] [PATCH 2/2] target-i386: turn off CPU.l3-cache only for 2.7 and older machine types

Quoted 6 lines · Igor Mammedov

commit (14c985cff target-i386: present virtual L3 cache info for vcpus) misplaced compat property putting it in new 2.8 machine type which would effectively to disable feature until 2.9 is released. Intent of commit probably should be to disable feature for 2.7 and older while allowing not yet released 2.8 to have feature enabled by default.

Thanks,
Marcel

Quoted 33 lines
---
 include/hw/i386/pc.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
include/hw/i386/pc.h +4 -5
index d5654ab..1c5fd08 100644
@@ -369,17 +369,16 @@ int e820_get_num_entries(void);
 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
 
 #define PC_COMPAT_2_8 \
+
+#define PC_COMPAT_2_7 \
+    PC_COMPAT_2_8 \
+    HW_COMPAT_2_7 \
     {\
         .driver   = TYPE_X86_CPU,\
         .property = "l3-cache",\
         .value    = "off",\
     },
 
-
-#define PC_COMPAT_2_7 \
-    PC_COMPAT_2_8 \
-    HW_COMPAT_2_7
-
 #define PC_COMPAT_2_6 \
     PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
#8 lore raw

Re: [Qemu-devel] [PATCH 2/2] target-i386: turn off CPU.l3-cache only for 2.7 and older machine types

In reply to Igor Mammedov
Quoted 17 lines · Igor Mammedov

commit (14c985cff target-i386: present virtual L3 cache info for vcpus) misplaced compat property putting it in new 2.8 machine type which would effectively to disable feature until 2.9 is released. Intent of commit probably should be to disable feature for 2.7 and older while allowing not yet released 2.8 to have feature enabled by default.

---
 include/hw/i386/pc.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
include/hw/i386/pc.h +0 -0
index d5654ab..1c5fd08 100644

include/hw/i386/pc.h int e820_get_num_entries(void); · line 374

Quoted 6 lines
include/hw/i386/pc.h +3 -0
@@ -369,17 +369,16 @@ int e820_get_num_entries(void);
 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
 
 #define PC_COMPAT_2_8 \
+
+#define PC_COMPAT_2_7 \
+    PC_COMPAT_2_8 \

Same as patch 1/2: this doesn't seem to be necessary since commit bacc344c548ce165a0001276ece56ee4b0bddae3.

Quoted 18 lines
include/hw/i386/pc.h +1 -5
+    HW_COMPAT_2_7 \
     {\
         .driver   = TYPE_X86_CPU,\
         .property = "l3-cache",\
         .value    = "off",\
     },
 
-
-#define PC_COMPAT_2_7 \
-    PC_COMPAT_2_8 \
-    HW_COMPAT_2_7
-
 #define PC_COMPAT_2_6 \
     PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
Signature · 1 line
2.7.4
Signature · 1 line
Eduardo
#9 lore raw

Re: [Qemu-devel] [PATCH 2/2] target-i386: turn off CPU.l3-cache only for 2.7 and older machine types

Quoted 20 lines · On Thu, 15 Sep 2016 11:23:47 -0300 Eduardo Habkost <[email protected]> wrote:
Quoted 19 lines · Igor Mammedov

commit (14c985cff target-i386: present virtual L3 cache info for vcpus) misplaced compat property putting it in new 2.8 machine type which would effectively to disable feature until 2.9 is released. Intent of commit probably should be to disable feature for 2.7 and older while allowing not yet released 2.8 to have feature enabled by default.

---
 include/hw/i386/pc.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
include/hw/i386/pc.h +0 -0
index d5654ab..1c5fd08 100644
@@ -369,17 +369,16 @@ int e820_get_num_entries(void);
 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
 
Quoted 7 lines

include/hw/i386/pc.h int e820_get_num_entries(void); · line 374

Quoted 4 lines
include/hw/i386/pc.h +3 -0
 #define PC_COMPAT_2_8 \
+
+#define PC_COMPAT_2_7 \
+    PC_COMPAT_2_8 \  

Same as patch 1/2: this doesn't seem to be necessary since commit bacc344c548ce165a0001276ece56ee4b0bddae3.

"l3-cache" is off for 2.8 regardless of bacc344c while it should be off only for 2.7 and older.

Anyway, I'll respin because of 1/2 should be rewritten.

Quoted 20 lines
Quoted 19 lines
include/hw/i386/pc.h +1 -5
+    HW_COMPAT_2_7 \
     {\
         .driver   = TYPE_X86_CPU,\
         .property = "l3-cache",\
         .value    = "off",\
     },
 
-
-#define PC_COMPAT_2_7 \
-    PC_COMPAT_2_8 \
-    HW_COMPAT_2_7
-
 #define PC_COMPAT_2_6 \
     PC_COMPAT_2_7 \
     HW_COMPAT_2_6 \
Signature · 1 line
2.7.4
#10 lore raw

Re: [Qemu-devel] [PATCH 2/2] target-i386: turn off CPU.l3-cache only for 2.7 and older machine types

Quoted 31 lines · Igor Mammedov
Quoted 20 lines · On Thu, 15 Sep 2016 11:23:47 -0300 Eduardo Habkost <[email protected]> wrote:
Quoted 19 lines · Igor Mammedov

commit (14c985cff target-i386: present virtual L3 cache info for vcpus) misplaced compat property putting it in new 2.8 machine type which would effectively to disable feature until 2.9 is released. Intent of commit probably should be to disable feature for 2.7 and older while allowing not yet released 2.8 to have feature enabled by default.

---
 include/hw/i386/pc.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
include/hw/i386/pc.h +0 -0
index d5654ab..1c5fd08 100644
@@ -369,17 +369,16 @@ int e820_get_num_entries(void);
 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
 
Quoted 7 lines

include/hw/i386/pc.h int e820_get_num_entries(void); · line 374

Quoted 4 lines
include/hw/i386/pc.h +3 -0
 #define PC_COMPAT_2_8 \
+
+#define PC_COMPAT_2_7 \
+    PC_COMPAT_2_8 \  

Same as patch 1/2: this doesn't seem to be necessary since commit bacc344c548ce165a0001276ece56ee4b0bddae3.

Quoted 4 lines

"l3-cache" is off for 2.8 regardless of bacc344c while it should be off only for 2.7 and older.

Anyway, I'll respin because of 1/2 should be rewritten.

Yes, l3-cache on PC_COMPAT_2_7 is necessary. I was only talking about the PC_COMPAT_2_8 line above, because it looked like a newly added line (but now I see it was just the line from patch 1/2 being moved, sorry for the confusion).

Signature · 1 line
Eduardo
#11 lore raw
In reply to Igor Mammedov

Hi Igor,

Quoted 5 lines · Igor Mammedov

fixes mistakes made by:

targte-i386: Add virtual L3 cache support
https://www.mail-archive.com/[email protected]/msg395418.html

Quoted 8 lines

Igor Mammedov (2):
pc: fix regression introduced by adding 2.8 machine
target-i386: turn off CPU.l3-cache only for 2.7 and older machine
types

 include/hw/i386/pc.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

You're right, thank you for correcting my mistakes :)

Signature · 2 lines
Regards,
Longpeng(Mike)