add ACPI Embedded Controller
cover add ACPI Embedded Controller
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"
EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave system state(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute _Qxx method which defined by yourself.
So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 > /sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
PATCH 1/4 acpi: add ACPI Embedded Controller support
this work implemented Embedded Controller chip emulation which was defined at ACPI SEPC v5 chapter 12:
"ACPI Embedded Controller Interface Specification"
commonly Embedded Controller will emulate keyboard, mouse, handle ACPI defined operations and some low-speed devices like SMbus.
--- default-configs/x86_64-softmmu.mak | 1 + hw/acpi/Makefile.objs | 1 + hw/acpi/ec.c | 192 ++++++++++++++++++++++++++++++++++++ include/hw/acpi/ec.h | 29 ++++++ 4 files changed, 223 insertions(+), 0 deletions(-) create mode 100644 hw/acpi/ec.c create mode 100644 include/hw/acpi/ec.h
default-configs/x86_64-softmmu.mak +1 -0
@@ -46,3 +46,4 @@ CONFIG_APIC=y CONFIG_IOAPIC=y CONFIG_ICC_BUS=y CONFIG_PVPANIC=y +CONFIG_ACPI_EC=y
hw/acpi/Makefile.objs +1 -0
@@ -1,2 +1,3 @@ common-obj-$(CONFIG_ACPI) += core.o piix4.o ich9.o +common-obj-$(CONFIG_ACPI_EC) += ec.o
hw/acpi/ec.c new file +192 -0
192 lines not on this page · raw message
include/hw/acpi/ec.h new file +29 -0
@@ -0,0 +1,29 @@ +#ifndef __EC_H +#define __EC_H + +#include "hw/i386/pc.h" +#include "qemu/notify.h" + +#define EC_ACPI_SPACE_SIZE 0x80 + +#define EC_ACPI_CMD_PORT 0x66 +#define EC_ACPI_DATA_PORT 0x62 + +#define EC_ACPI_OBF 0x1 +#define EC_ACPI_IBF 0x2 +#define EC_ACPI_CMD 0x8 +#define EC_ACPI_BST 0x10 +#define EC_ACPI_SCI 0x20 + +#define EC_ACPI_CMD_READ 0x80 +#define EC_ACPI_CMD_WRITE 0x81 +#define EC_ACPI_BURST_EN 0x82 +#define EC_ACPI_BURST_DN 0x83 +#define EC_ACPI_CMD_QUERY 0x84 + +void qemu_register_ec_sci_notifier (Notifier *notifier); +bool qemu_ec_enabled (void ); +void ec_dev_init (ISABus *isabus); +void ec_acpi_event (uint8_t evt); + +#endif
Signature · 1 line
1.7.2.5
PATCH 2/4 acpi/gpe: expand bits of gpe register
In reply to liguang--- hw/acpi/core.c | 8 ++++---- hw/acpi/ich9.c | 2 +- hw/acpi/piix4.c | 2 +- include/hw/acpi/acpi.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
hw/acpi/core.c +4 -4
@@ -575,9 +575,9 @@ void acpi_gpe_reset(ACPIREGS *ar)memset (ar->gpe.en,0 , ar->gpe.len /2 ); } -static uint8_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) +static uint32_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur =NULL ; +uint32_t *cur =NULL ;if (addr < ar->gpe.len /2 ) { cur = ar->gpe.sts + addr;
@@ -592,7 +592,7 @@ static uint8_t *acpi_gpe_ioport_get_ptr(ACPIREGS *ar, uint32_t addr)void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val) { -uint8_t *cur; +uint32_t *cur; cur =acpi_gpe_ioport_get_ptr (ar, addr);if (addr < ar->gpe.len /2 ) {
@@ -608,7 +608,7 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val)uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur; +uint32_t *cur;uint32_t val; cur =acpi_gpe_ioport_get_ptr (ar, addr);
hw/acpi/ich9.c +1 -1
@@ -153,7 +153,7 @@ static int ich9_pm_post_load(void *opaque, int version_id) .info = &vmstate_info_uint8, \ .size = sizeof(uint8_t), \ .flags = VMS_ARRAY | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }const VMStateDescription vmstate_ich9_pm = {
hw/acpi/piix4.c +1 -1
@@ -205,7 +205,7 @@ static int vmstate_acpi_post_load(void *opaque, int version_id) .info = &vmstate_info_uint16, \ .size = sizeof(uint16_t), \ .flags = VMS_SINGLE | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }static const VMStateDescription vmstate_gpe = {
include/hw/acpi/acpi.h +2 -2
@@ -112,8 +112,8 @@ struct ACPIPM1CNT {struct ACPIGPE {uint8_t len; -uint8_t *sts; -uint8_t *en; +uint32_t *sts; +uint32_t *en; };struct ACPIREGS {
Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register
Why?
And it breaks pointer operation like
Quoted 1 line
cur = ar->gpe.sts + addr;
thanks,
Quoted 86 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/core.c | 8 ++++---- hw/acpi/ich9.c | 2 +- hw/acpi/piix4.c | 2 +- include/hw/acpi/acpi.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)hw/acpi/core.c +4
-4@@ -575,9 +575,9 @@ void acpi_gpe_reset(ACPIREGS *ar)memset (ar->gpe.en,0 , ar->gpe.len /2 ); } -static uint8_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) +static uint32_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur =NULL ; +uint32_t *cur =NULL ;if (addr < ar->gpe.len /2 ) { cur = ar->gpe.sts + addr;@@ -592,7 +592,7 @@ static uint8_t *acpi_gpe_ioport_get_ptr(ACPIREGS *ar, uint32_t addr)void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val) { -uint8_t *cur; +uint32_t *cur; cur =acpi_gpe_ioport_get_ptr (ar, addr);if (addr < ar->gpe.len /2 ) {@@ -608,7 +608,7 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val)uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur; +uint32_t *cur;uint32_t val; cur =acpi_gpe_ioport_get_ptr (ar, addr);hw/acpi/ich9.c +1
-1@@ -153,7 +153,7 @@ static int ich9_pm_post_load(void *opaque, int version_id) .info = &vmstate_info_uint8, \ .size = sizeof(uint8_t), \ .flags = VMS_ARRAY | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }const VMStateDescription vmstate_ich9_pm = {hw/acpi/piix4.c +1
-1@@ -205,7 +205,7 @@ static int vmstate_acpi_post_load(void *opaque, int version_id) .info = &vmstate_info_uint16, \ .size = sizeof(uint16_t), \ .flags = VMS_SINGLE | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }static const VMStateDescription vmstate_gpe = {include/hw/acpi/acpi.h +2
-2@@ -112,8 +112,8 @@ struct ACPIPM1CNT {struct ACPIGPE {uint8_t len; -uint8_t *sts; -uint8_t *en; +uint32_t *sts; +uint32_t *en; };struct ACPIREGS {Signature · 1 line
1.7.2.5
Signature · 1 line
yamahata
Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register
Quoted 2 lines · 在 2013-05-22三的 14:28 +0900,Isaku Yamahata写道:
Why?
And it breaks pointer operation like
the fact is I can't guess why gpe->sts is defined uint8_t but the real hardware is 32-bit width.
I expand it to 32 because the future usage for me will access bit beyond 8.
of course, I can keep it, but I don't if I can violate the bit usage indication of this register.
Quoted 93 lines
Quoted 2 lines
cur = ar->gpe.sts + addr;thanks,
Quoted 86 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/core.c | 8 ++++---- hw/acpi/ich9.c | 2 +- hw/acpi/piix4.c | 2 +- include/hw/acpi/acpi.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)hw/acpi/core.c +4
-4@@ -575,9 +575,9 @@ void acpi_gpe_reset(ACPIREGS *ar)memset (ar->gpe.en,0 , ar->gpe.len /2 ); } -static uint8_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) +static uint32_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur =NULL ; +uint32_t *cur =NULL ;if (addr < ar->gpe.len /2 ) { cur = ar->gpe.sts + addr;@@ -592,7 +592,7 @@ static uint8_t *acpi_gpe_ioport_get_ptr(ACPIREGS *ar, uint32_t addr)void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val) { -uint8_t *cur; +uint32_t *cur; cur =acpi_gpe_ioport_get_ptr (ar, addr);if (addr < ar->gpe.len /2 ) {@@ -608,7 +608,7 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val)uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur; +uint32_t *cur;uint32_t val; cur =acpi_gpe_ioport_get_ptr (ar, addr);hw/acpi/ich9.c +1
-1@@ -153,7 +153,7 @@ static int ich9_pm_post_load(void *opaque, int version_id) .info = &vmstate_info_uint8, \ .size = sizeof(uint8_t), \ .flags = VMS_ARRAY | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }const VMStateDescription vmstate_ich9_pm = {hw/acpi/piix4.c +1
-1@@ -205,7 +205,7 @@ static int vmstate_acpi_post_load(void *opaque, int version_id) .info = &vmstate_info_uint16, \ .size = sizeof(uint16_t), \ .flags = VMS_SINGLE | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }static const VMStateDescription vmstate_gpe = {include/hw/acpi/acpi.h +2
-2@@ -112,8 +112,8 @@ struct ACPIPM1CNT {struct ACPIGPE {uint8_t len; -uint8_t *sts; -uint8_t *en; +uint32_t *sts; +uint32_t *en; };struct ACPIREGS {Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register
Quoted 6 lines · li guang
Quoted 2 lines · 在 2013-05-22三的 14:28 +0900,Isaku Yamahata写道:
Why?
And it breaks pointer operation likethe fact is I can't guess why
gpe->stsis defineduint8_tbut the real hardware is 32-bit width.
Which section of ACPI spec?
Quoted 4 lines
I expand it to 32 because the future usage for me will access bit beyond 8.
of course, I can keep it, but I don't if I can violate the bit usage indication of this register.
I don't have strong opinion wheter uint8_t or uint32_t. But the current patch is broken as the pointer offset operation needs to be fixed.
thanks,
Quoted 94 lines
Quoted 92 lines
Quoted 1 line
cur = ar->gpe.sts + addr;thanks,
Quoted 86 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/core.c | 8 ++++---- hw/acpi/ich9.c | 2 +- hw/acpi/piix4.c | 2 +- include/hw/acpi/acpi.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)hw/acpi/core.c +4
-4@@ -575,9 +575,9 @@ void acpi_gpe_reset(ACPIREGS *ar)memset (ar->gpe.en,0 , ar->gpe.len /2 ); } -static uint8_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) +static uint32_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur =NULL ; +uint32_t *cur =NULL ;if (addr < ar->gpe.len /2 ) { cur = ar->gpe.sts + addr;@@ -592,7 +592,7 @@ static uint8_t *acpi_gpe_ioport_get_ptr(ACPIREGS *ar, uint32_t addr)void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val) { -uint8_t *cur; +uint32_t *cur; cur =acpi_gpe_ioport_get_ptr (ar, addr);if (addr < ar->gpe.len /2 ) {@@ -608,7 +608,7 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val)uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur; +uint32_t *cur;uint32_t val; cur =acpi_gpe_ioport_get_ptr (ar, addr);hw/acpi/ich9.c +1
-1@@ -153,7 +153,7 @@ static int ich9_pm_post_load(void *opaque, int version_id) .info = &vmstate_info_uint8, \ .size = sizeof(uint8_t), \ .flags = VMS_ARRAY | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }const VMStateDescription vmstate_ich9_pm = {hw/acpi/piix4.c +1
-1@@ -205,7 +205,7 @@ static int vmstate_acpi_post_load(void *opaque, int version_id) .info = &vmstate_info_uint16, \ .size = sizeof(uint16_t), \ .flags = VMS_SINGLE | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }static const VMStateDescription vmstate_gpe = {include/hw/acpi/acpi.h +2
-2@@ -112,8 +112,8 @@ struct ACPIPM1CNT {struct ACPIGPE {uint8_t len; -uint8_t *sts; -uint8_t *en; +uint32_t *sts; +uint32_t *en; };struct ACPIREGS {Signature · 1 line
1.7.2.5
Signature · 1 line
yamahata
Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register
Quoted 9 lines · 在 2013-05-24五的 10:24 +0900,Isaku Yamahata写道:
Quoted 6 lines · li guang
Quoted 2 lines · 在 2013-05-22三的 14:28 +0900,Isaku Yamahata写道:
Why?
And it breaks pointer operation likethe fact is I can't guess why
gpe->stsis defineduint8_tbut the real hardware is 32-bit width.Which section of ACPI spec?
seems ACPI SPEC does not define the length,
but, real hardware does, e.g. ICH9.
Quoted 10 lines
Quoted 6 lines
I expand it to 32 because the future usage for me will access bit beyond 8.
of course, I can keep it, but I don't if I can violate the bit usage indication of this register.I don't have strong opinion wheter
uint8_toruint32_t. But the current patch is broken as the pointer offset operation needs to be fixed.
Yes, I'll fix later
Thanks!
Quoted 96 lines
Quoted 95 lines
Quoted 93 lines
Quoted 2 lines
cur = ar->gpe.sts + addr;thanks,
Quoted 86 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/core.c | 8 ++++---- hw/acpi/ich9.c | 2 +- hw/acpi/piix4.c | 2 +- include/hw/acpi/acpi.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)hw/acpi/core.c +4
-4@@ -575,9 +575,9 @@ void acpi_gpe_reset(ACPIREGS *ar)memset (ar->gpe.en,0 , ar->gpe.len /2 ); } -static uint8_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) +static uint32_t *acpi_gpe_ioport_get_ptr (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur =NULL ; +uint32_t *cur =NULL ;if (addr < ar->gpe.len /2 ) { cur = ar->gpe.sts + addr;@@ -592,7 +592,7 @@ static uint8_t *acpi_gpe_ioport_get_ptr(ACPIREGS *ar, uint32_t addr)void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val) { -uint8_t *cur; +uint32_t *cur; cur =acpi_gpe_ioport_get_ptr (ar, addr);if (addr < ar->gpe.len /2 ) {@@ -608,7 +608,7 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val)uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr) { -uint8_t *cur; +uint32_t *cur;uint32_t val; cur =acpi_gpe_ioport_get_ptr (ar, addr);hw/acpi/ich9.c +1
-1@@ -153,7 +153,7 @@ static int ich9_pm_post_load(void *opaque, int version_id) .info = &vmstate_info_uint8, \ .size = sizeof(uint8_t), \ .flags = VMS_ARRAY | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }const VMStateDescription vmstate_ich9_pm = {hw/acpi/piix4.c +1
-1@@ -205,7 +205,7 @@ static int vmstate_acpi_post_load(void *opaque, int version_id) .info = &vmstate_info_uint16, \ .size = sizeof(uint16_t), \ .flags = VMS_SINGLE | VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ + .offset = vmstate_offset_pointer(_state, _field, uint32_t), \ }static const VMStateDescription vmstate_gpe = {include/hw/acpi/acpi.h +2
-2@@ -112,8 +112,8 @@ struct ACPIPM1CNT {struct ACPIGPE {uint8_t len; -uint8_t *sts; -uint8_t *en; +uint32_t *sts; +uint32_t *en; };struct ACPIREGS {Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register
Quoted 6 lines · li guang
Quoted 5 lines · 在 2013-05-24五的 10:24 +0900,Isaku Yamahata写道:
Quoted 4 lines · li guang
Quoted 2 lines · 在 2013-05-22三的 14:28 +0900,Isaku Yamahata写道:
Why?
And it breaks pointer operation like
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
the fact is I can't guess why
gpe->stsis defineduint8_tbut the real hardware is 32-bit width.Which section of ACPI spec?
seems ACPI SPEC does not define the length,
but, real hardware does, e.g. ICH9.
Still fail to see what exactly you are trying to fix.
qemu can continue work with uint8_t internally just fine. memory api will split dword access by guests into 4 byte accesses. ich9_gpe_ops looks correct.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I expand it to 32 because the future usage for me will access bit beyond 8.
gpe->sts is an array, so you already have more than 8 bits.
Quoted 3 lines
Quoted 3 lines
I don't have strong opinion wheter
uint8_toruint32_t. But the current patch is broken as the pointer offset operation needs to be fixed.
Oh, and it breaks live migration too.
cheers,
Gerd
Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register
Quoted 24 lines · 在 2013-05-27一的 11:00 +0200,Gerd Hoffmann写道:
Quoted 6 lines · li guang
Quoted 5 lines · 在 2013-05-24五的 10:24 +0900,Isaku Yamahata写道:
Quoted 4 lines · li guang
Quoted 2 lines · 在 2013-05-22三的 14:28 +0900,Isaku Yamahata写道:
Why?
And it breaks pointer operation likeQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
the fact is I can't guess why
gpe->stsis defineduint8_tbut the real hardware is 32-bit width.Which section of ACPI spec?
seems ACPI SPEC does not define the length,
but, real hardware does, e.g. ICH9.Still fail to see what exactly you are trying to fix.
qemu can continue work with
uint8_tinternally just fine. memory api will split dword access by guests into 4 byte accesses.ich9_gpe_opslooks correct.Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I expand it to 32 because the future usage for me will access bit beyond 8.
Quoted 8 lines
gpe->stsis an array, so you already have more than 8 bits.Quoted 3 lines
Quoted 3 lines
I don't have strong opinion wheter
uint8_toruint32_t. But the current patch is broken as the pointer offset operation needs to be fixed.Oh, and it breaks live migration too.
Yes, I will re-consider this.
Thanks!
Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register
In reply to li guangQuoted 6 lines · li guang
Quoted 5 lines · 在 2013-05-24五的 10:24 +0900,Isaku Yamahata写道:
Quoted 4 lines · li guang
Quoted 2 lines · 在 2013-05-22三的 14:28 +0900,Isaku Yamahata写道:
Why?
And it breaks pointer operation like
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
the fact is I can't guess why
gpe->stsis defineduint8_tbut the real hardware is 32-bit width.Which section of ACPI spec?
seems ACPI SPEC does not define the length,
but, real hardware does, e.g. ICH9.
Still fail to see what exactly you are trying to fix.
qemu can continue work with uint8_t internally just fine. memory api will split dword access by guests into 4 byte accesses. ich9_gpe_ops looks correct.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I expand it to 32 because the future usage for me will access bit beyond 8.
gpe->sts is an array, so you already have more than 8 bits.
Quoted 3 lines
Quoted 3 lines
I don't have strong opinion wheter
uint8_toruint32_t. But the current patch is broken as the pointer offset operation needs to be fixed.
Oh, and it breaks live migration too.
cheers,
Gerd
PATCH 3/4 ich9: add notifer for ec to generate sci
In reply to liguang--- hw/acpi/ich9.c | 15 +++++++++++++++ include/hw/acpi/ich9.h | 1 + 2 files changed, 16 insertions(+), 0 deletions(-)
hw/acpi/ich9.c +15 -0
@@ -33,6 +33,7 @@#include "exec/address-spaces.h" #include "hw/i386/ich9.h" +#include "hw/acpi/ec.h" //#define DEBUG
@@ -43,6 +44,8 @@ do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)#define ICH9_DEBUG (fmt, ...) do { } while (0)#endif +#define GPE_EC_SCI_STATUS (0x1 << (16 + 1)) +static void pm_update_sci (ICH9LPCPMRegs *pm) {int sci_level, pm1a_sts;
@@ -202,6 +205,15 @@ static void pm_powerdown_req(Notifier *n, void *opaque)acpi_pm1_evt_power_down (&pm->acpi_regs); } +static void pm_ec_sci_req (Notifier *n,void *opaque) +{ +ICH9LPCPMRegs *pm =container_of (n, ICH9LPCPMRegs, ec_sci_notifier); +ACPIGPE *gpe = &pm->acpi_regs.gpe; + + *gpe->sts |=GPE_EC_SCI_STATUS ; +pm_update_sci (pm); +} +void ich9_pm_init (PCIDevice *lpc_pci,ICH9LPCPMRegs *pm,qemu_irq sci_irq) {
@@ -227,4 +239,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,qemu_register_reset (pm_reset, pm); pm->powerdown_notifier.notify = pm_powerdown_req;qemu_register_powerdown_notifier (&pm->powerdown_notifier); + + pm->ec_sci_notifier.notify = pm_ec_sci_req; +qemu_register_ec_sci_notifier (&pm->ec_sci_notifier); }
include/hw/acpi/ich9.h +1 -0
@@ -42,6 +42,7 @@ typedef struct ICH9LPCPMRegs {uint32_t pm_io_base;Notifier powerdown_notifier; +Notifier ec_sci_notifier; } ICH9LPCPMRegs; void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 3/4] ich9: add notifer for ec to generate sci
Quoted 11 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/ich9.c | 15 +++++++++++++++ include/hw/acpi/ich9.h | 1 + 2 files changed, 16 insertions(+), 0 deletions(-)hw/acpi/ich9.c +0
-0
hw/acpi/ich9.c line 39
Quoted 7 lines
hw/acpi/ich9.c +1
-0@@ -33,6 +33,7 @@#include "exec/address-spaces.h" #include "hw/i386/ich9.h" +#include "hw/acpi/ec.h" //#define DEBUG
Which symbols does this patch use from ec.h?
Quoted 47 lines
hw/acpi/ich9.c +14
-0@@ -43,6 +44,8 @@ do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)#define ICH9_DEBUG (fmt, ...) do { } while (0)#endif +#define GPE_EC_SCI_STATUS (0x1 << (16 + 1)) +static void pm_update_sci (ICH9LPCPMRegs *pm) {int sci_level, pm1a_sts;@@ -202,6 +205,15 @@ static void pm_powerdown_req(Notifier *n, void *opaque)acpi_pm1_evt_power_down (&pm->acpi_regs); } +static void pm_ec_sci_req (Notifier *n,void *opaque) +{ +ICH9LPCPMRegs *pm =container_of (n, ICH9LPCPMRegs, ec_sci_notifier); +ACPIGPE *gpe = &pm->acpi_regs.gpe; + + *gpe->sts |=GPE_EC_SCI_STATUS ; +pm_update_sci (pm); +} +void ich9_pm_init (PCIDevice *lpc_pci,ICH9LPCPMRegs *pm,qemu_irq sci_irq) {@@ -227,4 +239,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,qemu_register_reset (pm_reset, pm); pm->powerdown_notifier.notify = pm_powerdown_req;qemu_register_powerdown_notifier (&pm->powerdown_notifier); + + pm->ec_sci_notifier.notify = pm_ec_sci_req; +qemu_register_ec_sci_notifier (&pm->ec_sci_notifier); }include/hw/acpi/ich9.h +1
-0@@ -42,6 +42,7 @@ typedef struct ICH9LPCPMRegs {uint32_t pm_io_base;Notifier powerdown_notifier; +Notifier ec_sci_notifier; } ICH9LPCPMRegs; void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 3/4] ich9: add notifer for ec to generate sci
Quoted 14 lines · 在 2013-05-27一的 23:21 +0300,Michael S. Tsirkin写道:
Quoted 13 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/ich9.c | 15 +++++++++++++++ include/hw/acpi/ich9.h | 1 + 2 files changed, 16 insertions(+), 0 deletions(-)hw/acpi/ich9.c +0
-0@@ -33,6 +33,7 @@#include "exec/address-spaces.h"
Quoted 7 lines
hw/acpi/ich9.c line 39
Quoted 5 lines
hw/acpi/ich9.c +1
-0#include "hw/i386/ich9.h" +#include "hw/acpi/ec.h" //#define DEBUG Which symbols does this patch use from
ec.h?
qemu_register_ec_sci_notifier
Quoted 48 lines
Quoted 48 lines
hw/acpi/ich9.c +14
-0@@ -43,6 +44,8 @@ do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)#define ICH9_DEBUG (fmt, ...) do { } while (0)#endif +#define GPE_EC_SCI_STATUS (0x1 << (16 + 1)) +static void pm_update_sci (ICH9LPCPMRegs *pm) {int sci_level, pm1a_sts;@@ -202,6 +205,15 @@ static void pm_powerdown_req(Notifier *n, void *opaque)acpi_pm1_evt_power_down (&pm->acpi_regs); } +static void pm_ec_sci_req (Notifier *n,void *opaque) +{ +ICH9LPCPMRegs *pm =container_of (n, ICH9LPCPMRegs, ec_sci_notifier); +ACPIGPE *gpe = &pm->acpi_regs.gpe; + + *gpe->sts |=GPE_EC_SCI_STATUS ; +pm_update_sci (pm); +} +void ich9_pm_init (PCIDevice *lpc_pci,ICH9LPCPMRegs *pm,qemu_irq sci_irq) {@@ -227,4 +239,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,qemu_register_reset (pm_reset, pm); pm->powerdown_notifier.notify = pm_powerdown_req;qemu_register_powerdown_notifier (&pm->powerdown_notifier); + + pm->ec_sci_notifier.notify = pm_ec_sci_req; +qemu_register_ec_sci_notifier (&pm->ec_sci_notifier); }include/hw/acpi/ich9.h +1
-0@@ -42,6 +42,7 @@ typedef struct ICH9LPCPMRegs {uint32_t pm_io_base;Notifier powerdown_notifier; +Notifier ec_sci_notifier; } ICH9LPCPMRegs; void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 3/4] ich9: add notifer for ec to generate sci
In reply to liguangQuoted 44 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/ich9.c | 15 +++++++++++++++ include/hw/acpi/ich9.h | 1 + 2 files changed, 16 insertions(+), 0 deletions(-)hw/acpi/ich9.c +12
-0@@ -33,6 +33,7 @@#include "exec/address-spaces.h" #include "hw/i386/ich9.h" +#include "hw/acpi/ec.h" //#define DEBUG @@ -43,6 +44,8 @@ do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)#define ICH9_DEBUG (fmt, ...) do { } while (0)#endif +#define GPE_EC_SCI_STATUS (0x1 << (16 + 1)) +static void pm_update_sci (ICH9LPCPMRegs *pm) {int sci_level, pm1a_sts;@@ -202,6 +205,15 @@ static void pm_powerdown_req(Notifier *n, void *opaque)acpi_pm1_evt_power_down (&pm->acpi_regs); } +static void pm_ec_sci_req (Notifier *n,void *opaque) +{ +ICH9LPCPMRegs *pm =container_of (n, ICH9LPCPMRegs, ec_sci_notifier); +ACPIGPE *gpe = &pm->acpi_regs.gpe; + + *gpe->sts |=GPE_EC_SCI_STATUS ; +pm_update_sci (pm); +} +void ich9_pm_init (PCIDevice *lpc_pci,ICH9LPCPMRegs *pm,qemu_irq sci_irq) {
hw/acpi/ich9.c void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, · line 245
Quoted 7 lines
hw/acpi/ich9.c +3
-0@@ -227,4 +239,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,qemu_register_reset (pm_reset, pm); pm->powerdown_notifier.notify = pm_powerdown_req;qemu_register_powerdown_notifier (&pm->powerdown_notifier); + + pm->ec_sci_notifier.notify = pm_ec_sci_req; +qemu_register_ec_sci_notifier (&pm->ec_sci_notifier); }
So an EC is using ICH9 to send SCI to guest,
but ICH9 should not worry about EC that's connected to it. So it should be something like qemu_register_sci_notifier
and not make ich9 depend on ec.
Quoted 14 lines
include/hw/acpi/ich9.h +1
-0@@ -42,6 +42,7 @@ typedef struct ICH9LPCPMRegs {uint32_t pm_io_base;Notifier powerdown_notifier; +Notifier ec_sci_notifier; } ICH9LPCPMRegs; void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 3/4] ich9: add notifer for ec to generate sci
Quoted 50 lines · 在 2013-05-28二的 09:40 +0300,Michael S. Tsirkin写道:
Quoted 49 lines · liguang
Signed-off-by liguang <[email protected]>--- hw/acpi/ich9.c | 15 +++++++++++++++ include/hw/acpi/ich9.h | 1 + 2 files changed, 16 insertions(+), 0 deletions(-)hw/acpi/ich9.c +14
-0@@ -33,6 +33,7 @@#include "exec/address-spaces.h" #include "hw/i386/ich9.h" +#include "hw/acpi/ec.h" //#define DEBUG @@ -43,6 +44,8 @@ do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)#define ICH9_DEBUG (fmt, ...) do { } while (0)#endif +#define GPE_EC_SCI_STATUS (0x1 << (16 + 1)) +static void pm_update_sci (ICH9LPCPMRegs *pm) {int sci_level, pm1a_sts;@@ -202,6 +205,15 @@ static void pm_powerdown_req(Notifier *n, void *opaque)acpi_pm1_evt_power_down (&pm->acpi_regs); } +static void pm_ec_sci_req (Notifier *n,void *opaque) +{ +ICH9LPCPMRegs *pm =container_of (n, ICH9LPCPMRegs, ec_sci_notifier); +ACPIGPE *gpe = &pm->acpi_regs.gpe; + + *gpe->sts |=GPE_EC_SCI_STATUS ; +pm_update_sci (pm); +} +void ich9_pm_init (PCIDevice *lpc_pci,ICH9LPCPMRegs *pm,qemu_irq sci_irq) {@@ -227,4 +239,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,qemu_register_reset (pm_reset, pm); pm->powerdown_notifier.notify = pm_powerdown_req;qemu_register_powerdown_notifier (&pm->powerdown_notifier); + + pm->ec_sci_notifier.notify = pm_ec_sci_req;
Quoted 8 lines
hw/acpi/ich9.c void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, · line 245
Quoted 2 lines
hw/acpi/ich9.c +1
-0+qemu_register_ec_sci_notifier (&pm->ec_sci_notifier); }So an EC is using ICH9 to send SCI to guest,
but ICH9 should not worry about EC that's connected to it. So it should be something likeqemu_register_sci_notifier
and not make ich9 depend on ec.
OK, let me think about it.
Thanks!
Quoted 15 lines
Quoted 15 lines
include/hw/acpi/ich9.h +1
-0@@ -42,6 +42,7 @@ typedef struct ICH9LPCPMRegs {uint32_t pm_io_base;Notifier powerdown_notifier; +Notifier ec_sci_notifier; } ICH9LPCPMRegs; void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,Signature · 1 line
1.7.2.5
PATCH 4/4 ec: add ASL for ACPI Embedded Controller
In reply to liguang--- src/acpi-dsdt.dsl | 1 + src/ec.dsl | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ src/q35-acpi-dsdt.dsl | 1 + 3 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 src/ec.dsl
src/acpi-dsdt.dsl +1 -0
@@ -112,6 +112,7 @@ DefinitionBlock ( } Name(FDEN, 1) } +#include "ec.dsl" } #include "acpi-dsdt-isa.dsl"
src/ec.dsl new file +51 -0
51 lines not on this page · raw message
src/q35-acpi-dsdt.dsl +1 -0
@@ -167,6 +167,7 @@ DefinitionBlock ( FDEN, 1 } } +#include "ec.dsl" } #include "acpi-dsdt-isa.dsl"
Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 4/4][seabios] ec: add ASL for ACPI Embedded Controller
Add seabios mail-list
Quoted 89 lines · 在 2013-05-22三的 11:46 +0800,liguang写道:
Signed-off-by liguang <[email protected]>--- src/acpi-dsdt.dsl | 1 + src/ec.dsl | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ src/q35-acpi-dsdt.dsl | 1 + 3 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 src/ec.dslsrc/acpi-dsdt.dsl +1
-0@@ -112,6 +112,7 @@ DefinitionBlock ( } Name(FDEN, 1) } +#include "ec.dsl" } #include "acpi-dsdt-isa.dsl"src/ec.dsl new file +51
-0@@ -0,0 +1,51 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +Device (EC0) +{ + Name(_HID, EISAID ("PNP0C09")) + Name(_UID, 1) + + Method(_CRS, 0) + { + Name(BFFR, ResourceTemplate() + { + IO(Decode16, 0x62, 0x62, 0, 1) // ACPI DATA IN/OUT + IO(Decode16, 0x66, 0x66, 0, 1) // CMD/STS + }) + Return(BFFR) + } + + OperationRegion(ECFD, EmbeddedControl, 0, 0xFF) + Field(ECFD, ByteAcc, Lock, Preserve) + { Offset(1), + CPUS, 8, // 1, CPU status + CPUN, 8, // 2, CPU index + } + + Name(_GPE, 17) + + Method(_Q01) + { + If(LEqual(1, CPUS)) + { + Store(0, CPUS) + } + Else + { + Store(1, CPUS) + } + } +}src/q35-acpi-dsdt.dsl +1
-0@@ -167,6 +167,7 @@ DefinitionBlock ( FDEN, 1 } } +#include "ec.dsl" } #include "acpi-dsdt-isa.dsl"
Hi, Andreas, Paolo
As you have commented on the raw RFC patch before, can you also give some comments on these?
and all who are interested in this topic(ACPI EC),
waiting for you comments
Thanks a lot!
Quoted 25 lines · 在 2013-05-22三的 11:46 +0800,liguang写道:
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.
Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Signature · 1 line
MST
Quoted 20 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.
Quoted 7 lines
Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
In fact, any OSes support ACPI will support this device. so, windows will.
Quoted 24 lines · li guang
Quoted 23 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 22 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
Regards,
Anthony Liguori
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's drivers/acpi/ec.c
Quoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger 'cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.
and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.
Quoted 46 lines · On Mon, 27 May 2013 09:22:59 +0800 li guang <[email protected]> wrote:
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 1 line
Quoted 7 lines
Quoted 3 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.
it is up to guest OS policy to decide if CPU should be onlined or not, at least I've seen this rationale on LKML when topic was discussed and automatic cpu_up on hotplug was rejected.
Quoted 49 lines · 在 2013-05-27一的 13:45 +0200,Igor Mammedov写道:
Quoted 46 lines · On Mon, 27 May 2013 09:22:59 +0800 li guang <[email protected]> wrote:
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.it is up to guest OS policy to decide if CPU should be onlined or not,
Yep, but I think it's a favor to do cpu online.
Quoted 2 lines
at least I've seen this rationale on LKML when topic was discussed and automatic
cpu_upon hotplug was rejected.
Oh, and the reason is?
can you give me a link?
Oh, Igor,
I remember that you said you can give me some your considerations on the further development of cpu hotplug feature, but I haven't got them :-)
Thanks!
Quoted 54 lines · On Tue, 28 May 2013 08:28:09 +0800 li guang <[email protected]> wrote:
Quoted 53 lines · 在 2013-05-27一的 13:45 +0200,Igor Mammedov写道:
Quoted 50 lines · On Mon, 27 May 2013 09:22:59 +0800 li guang <[email protected]> wrote:
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.it is up to guest OS policy to decide if CPU should be onlined or not,
Yep, but I think it's a favor to do cpu online.
Then you have to teach kernel driver (EC) to do cpu_up on _Q02 event, the question is why would you do this when there is ACPI processor driver already that handles CPU hotplug in kernel.
You can try add cpu_up() there and perhaps with good enough reasoning it would be accepted.
Quoted 5 lines
Quoted 3 lines
at least I've seen this rationale on LKML when topic was discussed and automatic
cpu_upon hotplug was rejected.Oh, and the reason is?
Reason was to let guest decide whether online new CPU or nor instead of doing it unconditionally.
Quoted 1 line
can you give me a link?
I'm sorry but I can't find link quickly.
Quoted 5 lines
Oh, Igor,
I remember that you said you can give me some your considerations on the further development of cpu hotplug feature, but I haven't got them :-)
I'm sorry, I haven't time yet to update TODO list on wiki page:
But here some items that need some attention:
* try to introduce generic QOM interface for CPU topology introspection
something like /machine/node/socket[xxx]/{(core[yyy]/thread[zzz])|thread[zzz]}* allow to specify at CLI specific CPUs to be created at start-up time
- important for hot-adding/removing an arbitrary CPU
- probably depends on previous item so that each CPU could be specified by socket/core/thread numbers
* extend/rework -numa CLI option to support socket to node binding
- goal is to obsolete node to thread biding which allows specify incorrect topology.
Quoted 5 lines
Thanks!
Quoted 57 lines · 在 2013-05-28二的 10:16 +0200,Igor Mammedov写道:
Quoted 54 lines · On Tue, 28 May 2013 08:28:09 +0800 li guang <[email protected]> wrote:
Quoted 53 lines · 在 2013-05-27一的 13:45 +0200,Igor Mammedov写道:
Quoted 50 lines · On Mon, 27 May 2013 09:22:59 +0800 li guang <[email protected]> wrote:
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.it is up to guest OS policy to decide if CPU should be onlined or not,
Yep, but I think it's a favor to do cpu online.
Then you have to teach kernel driver (EC) to do
cpu_upon_Q02event,
I think it's not necessary to do this.
we can also add another platform driver to listen cpu plug/unplug event and query EC's ACPI space to decide what to do next.
Quoted 4 lines
the question is why would you do this when there is ACPI processor driver already that handles CPU hotplug in kernel.
You can try addcpu_up()there and perhaps with good enough reasoning it would be accepted.
it's not so convenient to trigger cpu_up/down process for ACPI processor driver as far as I can see, it seems like informal or hack there. so I'd like to make a bridge between them.
but, anyway, it's a good point to think about or even try to do.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
at least I've seen this rationale on LKML when topic was discussed and automatic
cpu_upon hotplug was rejected.Oh, and the reason is?
Reason was to let guest decide whether online new CPU or nor instead of doing it unconditionally.
can this be a Kconfig option?
or it's strongly recommended to let guest decide?
Quoted 13 lines
Quoted 1 line
can you give me a link?
I'm sorry but I can't find link quickly.
Quoted 5 lines
Oh, Igor,
I remember that you said you can give me some your considerations on the further development of cpu hotplug feature, but I haven't got them :-)I'm sorry, I haven't time yet to update TODO list on wiki page:
But here some items that need some attention:
* try to introduce generic QOM interface for CPU topology introspection
Quoted 9 lines
something like /machine/node/socket[xxx]/{(core[yyy]/thread[zzz])|thread[zzz]}* allow to specify at CLI specific CPUs to be created at start-up time
- important for hot-adding/removing an arbitrary CPU
- probably depends on previous item so that each CPU could be specified by socket/core/thread numbers* extend/rework -numa CLI option to support socket to node binding
- goal is to obsolete node to thread biding which allows specify incorrect topology.
OK, thank you so much!
Quoted 86 lines · On Tue, 28 May 2013 16:34:42 +0800 li guang <[email protected]> wrote:
Quoted 57 lines · 在 2013-05-28二的 10:16 +0200,Igor Mammedov写道:
Quoted 54 lines · On Tue, 28 May 2013 08:28:09 +0800 li guang <[email protected]> wrote:
Quoted 53 lines · 在 2013-05-27一的 13:45 +0200,Igor Mammedov写道:
Quoted 50 lines · On Mon, 27 May 2013 09:22:59 +0800 li guang <[email protected]> wrote:
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.it is up to guest OS policy to decide if CPU should be onlined or not,
Yep, but I think it's a favor to do cpu online.
Then you have to teach kernel driver (EC) to do
cpu_upon_Q02event,I think it's not necessary to do this.
we can also add another platform driver to listen cpu plug/unplug event and query EC's ACPI space to decide what to do next.Quoted 4 lines
the question is why would you do this when there is ACPI processor driver already that handles CPU hotplug in kernel.
You can try addcpu_up()there and perhaps with good enough reasoning it would be accepted.it's not so convenient to trigger cpu_up/down process for ACPI processor driver as far as I can see, it seems like informal or hack there. so I'd like to make a bridge between them.
but, anyway, it's a good point to think about or even try to do.
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
at least I've seen this rationale on LKML when topic was discussed and automatic
cpu_upon hotplug was rejected.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Oh, and the reason is?
Reason was to let guest decide whether online new CPU or nor instead of doing it unconditionally.
can this be a
Kconfigoption?
or it's strongly recommended to let guest decide?
Probably there is no harm in trying to post patch to LKML and get feedback.
Quoted 90 lines · 在 2013-05-28二的 11:38 +0200,Igor Mammedov写道:
Quoted 87 lines · On Tue, 28 May 2013 16:34:42 +0800 li guang <[email protected]> wrote:
Quoted 57 lines · 在 2013-05-28二的 10:16 +0200,Igor Mammedov写道:
Quoted 54 lines · On Tue, 28 May 2013 08:28:09 +0800 li guang <[email protected]> wrote:
Quoted 53 lines · 在 2013-05-27一的 13:45 +0200,Igor Mammedov写道:
Quoted 50 lines · On Mon, 27 May 2013 09:22:59 +0800 li guang <[email protected]> wrote:
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.it is up to guest OS policy to decide if CPU should be onlined or not,
Yep, but I think it's a favor to do cpu online.
Then you have to teach kernel driver (EC) to do
cpu_upon_Q02event,I think it's not necessary to do this.
we can also add another platform driver to listen cpu plug/unplug event and query EC's ACPI space to decide what to do next.Quoted 4 lines
the question is why would you do this when there is ACPI processor driver already that handles CPU hotplug in kernel.
You can try addcpu_up()there and perhaps with good enough reasoning it would be accepted.it's not so convenient to trigger cpu_up/down process for ACPI processor driver as far as I can see, it seems like informal or hack there. so I'd like to make a bridge between them.
but, anyway, it's a good point to think about or even try to do.
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
at least I've seen this rationale on LKML when topic was discussed and automatic
cpu_upon hotplug was rejected.Oh, and the reason is?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Reason was to let guest decide whether online new CPU or nor instead of doing it unconditionally.
can this be a
Kconfigoption?
or it's strongly recommended to let guest decide?Probably there is no harm in trying to post patch to LKML and get feedback.
Yep, I'll do that,
Thanks!
Quoted 50 lines · li guang
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
Quoted 10 lines
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.
So just to clarify: this patchset doesn't do anything useful itself, it's some infrastructure that you want to build on top of?
Signature · 1 line
MST
Quoted 63 lines · 在 2013-05-27一的 23:23 +0300,Michael S. Tsirkin写道:
Quoted 50 lines · li guang
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
Quoted 10 lines
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.
Quoted 2 lines
So just to clarify: this patchset doesn't do anything useful itself,
the first patch is pure EC implementation which is useful.
Quoted 2 lines
it's some infrastructure that you want to build on top of?
Yes, I'd like to use EC as infrastructure for my further development.
Quoted 64 lines · li guang
Quoted 63 lines · 在 2013-05-27一的 23:23 +0300,Michael S. Tsirkin写道:
Quoted 60 lines · li guang
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.
Quoted 4 lines
Quoted 2 lines
So just to clarify: this patchset doesn't do anything useful itself,
the first patch is pure EC implementation which is useful.
Sorry, I didn't mean to imply that this is not useful, merely that it is not yet directly useful for users.
Quoted 5 lines
Quoted 2 lines
it's some infrastructure that you want to build on top of?
Yes, I'd like to use EC as infrastructure for my further development.
I (and apparently others in this thread) would like to know some more about planned use for this code before deciding on inclusion.
Signature · 1 line
MST
Hi, Michael
Quoted 65 lines · 在 2013-05-28二的 09:31 +0300,Michael S. Tsirkin写道:
Quoted 64 lines · li guang
Quoted 63 lines · 在 2013-05-27一的 23:23 +0300,Michael S. Tsirkin写道:
Quoted 60 lines · li guang
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
So just to clarify: this patchset doesn't do anything useful itself,
the first patch is pure EC implementation which is useful.
Sorry, I didn't mean to imply that this is not useful, merely that it is not yet directly useful for users.
Yep, by now, of course, only 1 user, that's me. :-)
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
it's some infrastructure that you want to build on top of?
Yes, I'd like to use EC as infrastructure for my further development.
I (and apparently others in this thread) would like to know some more about planned use for this code before deciding on inclusion.
OK,
currently, I am using EC to pass cpu hotplug event between QEMU and linux kernel, and I'll post these patches later.
then, I'll query usages like this in QEMU, and convert them to use EC's acpi approach if possible.
Thanks!
Quoted 89 lines · li guang
Hi, Michael
Quoted 65 lines · 在 2013-05-28二的 09:31 +0300,Michael S. Tsirkin写道:
Quoted 64 lines · li guang
Quoted 63 lines · 在 2013-05-27一的 23:23 +0300,Michael S. Tsirkin写道:
Quoted 60 lines · li guang
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
So just to clarify: this patchset doesn't do anything useful itself,
the first patch is pure EC implementation which is useful.
Sorry, I didn't mean to imply that this is not useful, merely that it is not yet directly useful for users.
Yep, by now, of course, only 1 user, that's me. :-)
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
it's some infrastructure that you want to build on top of?
Yes, I'd like to use EC as infrastructure for my further development.
I (and apparently others in this thread) would like to know some more about planned use for this code before deciding on inclusion.
Quoted 8 lines
OK,
currently, I am using EC to pass cpu hotplug event between QEMU and linux kernel, and I'll post these patches later.
then, I'll query usages like this in QEMU, and convert them to use EC's acpi approach if possible.Thanks!
Okay, that needs an ack from Igor then I think :)
Signature · 1 line
MST
Quoted 89 lines · On Tue, 28 May 2013 14:40:30 +0800 li guang <[email protected]> wrote:
Hi, Michael
Quoted 65 lines · 在 2013-05-28二的 09:31 +0300,Michael S. Tsirkin写道:
Quoted 64 lines · li guang
Quoted 63 lines · 在 2013-05-27一的 23:23 +0300,Michael S. Tsirkin写道:
Quoted 60 lines · li guang
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
So just to clarify: this patchset doesn't do anything useful itself,
the first patch is pure EC implementation which is useful.
Sorry, I didn't mean to imply that this is not useful, merely that it is not yet directly useful for users.
Yep, by now, of course, only 1 user, that's me. :-)
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
it's some infrastructure that you want to build on top of?
Yes, I'd like to use EC as infrastructure for my further development.
I (and apparently others in this thread) would like to know some more about planned use for this code before deciding on inclusion.
Quoted 5 lines
OK,
currently, I am using EC to pass cpu hotplug event between QEMU and linux kernel, and I'll post these patches later.
then, I'll query usages like this in QEMU, and convert them to use EC's acpi approach if possible.
When I see these patches for qemu/seebios/kernel, I probably would be able to comment on them. But right now I don't see benefits in switching CPU hot-plug to EC.
Quoted 6 lines
Thanks!
Hi, Igor
Quoted 92 lines · 在 2013-05-28二的 10:26 +0200,Igor Mammedov写道:
Quoted 89 lines · On Tue, 28 May 2013 14:40:30 +0800 li guang <[email protected]> wrote:
Hi, Michael
Quoted 65 lines · 在 2013-05-28二的 09:31 +0300,Michael S. Tsirkin写道:
Quoted 64 lines · li guang
Quoted 63 lines · 在 2013-05-27一的 23:23 +0300,Michael S. Tsirkin写道:
Quoted 60 lines · li guang
Quoted 31 lines · 在 2013-05-26日的 19:51 -0500,Anthony Liguori写道:
Quoted 29 lines · li guang
Quoted 27 lines · 在 2013-05-24五的 14:45 +0300,Michael S. Tsirkin写道:
Quoted 19 lines · liguang
These patches try to add ACPI Embedded Controller (EC), refer-to:
ACPI SPEC v5 chapter 5
"ACPI Embedded Controller Interface Specification"EC is a standard ACPI device, it plays flexible roles, e.g.
power controller, it can control power sequence for platform to enter or leave systemstate(0,1,3,4,5), it can controller CPU fan by the temperature of sensor. event carrier, it can pass events between platform and OS, so OS can execute_Qxxmethod which defined by yourself.So, I want to deliver CPU online/offline event between OS and QEMU for CPU hotplug feature, then we will don't need to "echo 1 >
/sys/devices/system/cpu/cpu1/online" again after 'cpu-add'.Quoted 4 lines
patches for online/offline event handler of QEUM and linux kernel are writing, and will send once finished.
since EC is a common device, so I send pathes separately.
Do any non-linux guests support this device?
Quoted 8 lines
Quoted 2 lines
In fact, any OSes support ACPI will support this device. so, windows will.
When you say "any OSes supporting ACPI" I think what you really mean is that we can provide bytecode that interacts with the embedded controller.
There is not explicit driver in Linux or Windows AFAIK.
Hmm, yep, mostly there's no special driver for EC, because it is directly embedded in code for ACPI for linux kernel, it's
drivers/acpi/ec.cQuoted 4 lines
I still don't get the point of this. We can make ACPI hotplug work without introducing a new device like this.
when you 'cpu-add' a cpu, acpi driver for cpu will not trigger '
cpu_up' for linux kernel AFAIK, unless you add a user space program to listen it's uevent and tigger 'cpu_up'.and EC is not only for ACPI hotplug
for example, the 'pvpanic', if there's a EC,
we can pass pvpanic event by EC's ACPI space or Q-event, then we will not need this kind of special devices anymore.Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
So just to clarify: this patchset doesn't do anything useful itself,
the first patch is pure EC implementation which is useful.
Sorry, I didn't mean to imply that this is not useful, merely that it is not yet directly useful for users.
Yep, by now, of course, only 1 user, that's me. :-)
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
it's some infrastructure that you want to build on top of?
Yes, I'd like to use EC as infrastructure for my further development.
I (and apparently others in this thread) would like to know some more about planned use for this code before deciding on inclusion.
Quoted 7 lines
Quoted 5 lines
OK,
currently, I am using EC to pass cpu hotplug event between QEMU and linux kernel, and I'll post these patches later.
then, I'll query usages like this in QEMU, and convert them to use EC's acpi approach if possible.When I see these patches for qemu/seebios/kernel, I probably would be able to comment on them.
I'll send a RFC patch-set which will include all my work tomorrow.
Quoted 2 lines
But right now I don't see benefits in switching
CPU hot-plug to EC.
sorry, maybe a mistake here, I am not trying to switching CPU hot-plug to EC, but just make EC as a helper to do CPU hot-plug, like pass plug/unplug event between OS and platform, it's convenient.