From: Jan Kiszka <jan.kiszka@siemens.com>
To: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Cc: kvm@vger.kernel.org, gleb@redhat.com, seabios@seabios.org,
qemu-devel@nongnu.org, kernelfans@gmail.com,
yamahata@valinux.co.jp, avi@redhat.com
Subject: Re: [PATCH 3/3] acpi_piix4: Call KVM_SETSTATE_VCPU ioctl on cpu ejection
Date: Fri, 13 Jan 2012 12:58:53 +0100 [thread overview]
Message-ID: <4F101C7D.8070506@siemens.com> (raw)
In-Reply-To: <1326453092-4256-4-git-send-email-vasilis.liaskovitis@profitbricks.com>
On 2012-01-13 12:11, Vasilis Liaskovitis wrote:
> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
> ---
> hw/acpi_piix4.c | 21 +++++++++++++++++++++
> 1 files changed, 21 insertions(+), 0 deletions(-)
>
> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index 8bf30dd..12eef55 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -502,6 +502,27 @@ static uint32_t cpuej_read(void *opaque, uint32_t addr)
>
> static void cpuej_write(void *opaque, uint32_t addr, uint32_t val)
> {
> + struct kvm_vcpu_state state;
> + CPUState *env;
> + int cpu;
> + int ret;
> +
> + cpu = ffs(val);
> + /* zero means no bit was set, i.e. no CPU ejection happened */
> + if (!cpu)
> + return;
> + cpu--;
> + env = cpu_phyid_to_cpu((uint64_t)cpu);
> + if (env != NULL) {
> + if (env->state == CPU_STATE_ZAPREQ) {
> + state.vcpu_id = env->cpu_index;
> + state.state = 1;
> + ret = kvm_vm_ioctl(env->kvm_state, KVM_SETSTATE_VCPU, &state);
That breaks in the absence of KVM or if it is not enabled.
Also, where was this IOCTL introduced? Where are the linux header changes?
> + if (ret)
> + fprintf(stderr, "KVM_SETSTATE_VCPU failed: %s\n",
> + strerror(ret));
> + }
> + }
> PIIX4_DPRINTF("cpuej write %x <== %d\n", addr, val);
> }
>
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Cc: kvm@vger.kernel.org, gleb@redhat.com, seabios@seabios.org,
qemu-devel@nongnu.org, kernelfans@gmail.com,
yamahata@valinux.co.jp, avi@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/3] acpi_piix4: Call KVM_SETSTATE_VCPU ioctl on cpu ejection
Date: Fri, 13 Jan 2012 12:58:53 +0100 [thread overview]
Message-ID: <4F101C7D.8070506@siemens.com> (raw)
In-Reply-To: <1326453092-4256-4-git-send-email-vasilis.liaskovitis@profitbricks.com>
On 2012-01-13 12:11, Vasilis Liaskovitis wrote:
> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
> ---
> hw/acpi_piix4.c | 21 +++++++++++++++++++++
> 1 files changed, 21 insertions(+), 0 deletions(-)
>
> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index 8bf30dd..12eef55 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -502,6 +502,27 @@ static uint32_t cpuej_read(void *opaque, uint32_t addr)
>
> static void cpuej_write(void *opaque, uint32_t addr, uint32_t val)
> {
> + struct kvm_vcpu_state state;
> + CPUState *env;
> + int cpu;
> + int ret;
> +
> + cpu = ffs(val);
> + /* zero means no bit was set, i.e. no CPU ejection happened */
> + if (!cpu)
> + return;
> + cpu--;
> + env = cpu_phyid_to_cpu((uint64_t)cpu);
> + if (env != NULL) {
> + if (env->state == CPU_STATE_ZAPREQ) {
> + state.vcpu_id = env->cpu_index;
> + state.state = 1;
> + ret = kvm_vm_ioctl(env->kvm_state, KVM_SETSTATE_VCPU, &state);
That breaks in the absence of KVM or if it is not enabled.
Also, where was this IOCTL introduced? Where are the linux header changes?
> + if (ret)
> + fprintf(stderr, "KVM_SETSTATE_VCPU failed: %s\n",
> + strerror(ret));
> + }
> + }
> PIIX4_DPRINTF("cpuej write %x <== %d\n", addr, val);
> }
>
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2012-01-13 11:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-13 11:11 [PATCH 0/3] acpi_piix4: Add CPU eject handling Vasilis Liaskovitis
2012-01-13 11:11 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-13 11:11 ` [PATCH 1/3][Seabios] Add bitmap for cpu _EJ0 callback Vasilis Liaskovitis
2012-01-13 11:11 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-14 0:27 ` Kevin O'Connor
2012-01-14 0:27 ` [Qemu-devel] " Kevin O'Connor
2012-01-16 11:33 ` Vasilis Liaskovitis
2012-01-16 11:33 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-19 14:02 ` Vasilis Liaskovitis
2012-01-19 14:02 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-20 1:08 ` Kevin O'Connor
2012-01-20 1:08 ` [Qemu-devel] " Kevin O'Connor
2012-01-13 11:11 ` [PATCH 2/3] acpi_piix4: Add stub functions for CPU eject callback Vasilis Liaskovitis
2012-01-13 11:11 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-15 12:38 ` Avi Kivity
2012-01-15 12:38 ` [Qemu-devel] " Avi Kivity
2012-01-16 11:32 ` Vasilis Liaskovitis
2012-01-16 11:32 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-16 12:26 ` Avi Kivity
2012-01-16 12:26 ` [Qemu-devel] " Avi Kivity
2012-01-13 11:11 ` [PATCH 3/3] acpi_piix4: Call KVM_SETSTATE_VCPU ioctl on cpu ejection Vasilis Liaskovitis
2012-01-13 11:11 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-13 11:58 ` Jan Kiszka [this message]
2012-01-13 11:58 ` Jan Kiszka
2012-01-13 12:48 ` Vasilis Liaskovitis
2012-01-13 12:48 ` [Qemu-devel] " Vasilis Liaskovitis
2012-01-13 11:58 ` [PATCH 0/3] acpi_piix4: Add CPU eject handling Jan Kiszka
2012-01-13 11:58 ` [Qemu-devel] " Jan Kiszka
2012-01-13 12:49 ` Vasilis Liaskovitis
2012-01-13 12:49 ` [Qemu-devel] " Vasilis Liaskovitis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F101C7D.8070506@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kernelfans@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
--cc=vasilis.liaskovitis@profitbricks.com \
--cc=yamahata@valinux.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.