All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH 6/6] apic: avoid using CPUState internals
Date: Sun, 06 Jun 2010 09:36:01 +0200	[thread overview]
Message-ID: <4C0B4FE1.9070608@web.de> (raw)
In-Reply-To: <AANLkTikMjEneitQJy0ABsx_sSYxCC3R2K95hXZ-J37zs@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1719 bytes --]

Blue Swirl wrote:
> Use only an opaque CPUState pointer and move the actual CPUState
> contents handling to cpu.h and cpuid.c.
> 
> Set env->halted in pc.c and add a function to get the local APIC state
> of the current CPU for the MMIO.
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
>  hw/apic.c           |   40 +++++++++++++++-------------------------
>  hw/apic.h           |    9 ++++++++-
>  hw/pc.c             |   12 +++++++++++-
>  target-i386/cpu.h   |   27 ++++++++++++++++-----------
>  target-i386/cpuid.c |    6 ++++++
>  5 files changed, 56 insertions(+), 38 deletions(-)
> 
> diff --git a/hw/apic.c b/hw/apic.c
> index 91c8d93..332c66e 100644
> --- a/hw/apic.c
> +++ b/hw/apic.c
> @@ -95,7 +95,7 @@
>  #define MSI_ADDR_SIZE                   0x100000
> 
>  struct APICState {
> -    CPUState *cpu_env;
> +    void *cpu_env;
>      uint32_t apicbase;
>      uint8_t id;
>      uint8_t arb_id;
> @@ -320,7 +320,7 @@ void cpu_set_apic_base(APICState *s, uint64_t val)
>      /* if disabled, cannot be enabled again */
>      if (!(val & MSR_IA32_APICBASE_ENABLE)) {
>          s->apicbase &= ~MSR_IA32_APICBASE_ENABLE;
> -        s->cpu_env->cpuid_features &= ~CPUID_APIC;
> +        cpu_clear_apic_feature(s->cpu_env);
>          s->spurious_vec &= ~APIC_SV_ENABLE;
>      }
>  }
> @@ -508,8 +508,6 @@ void apic_init_reset(APICState *s)
>      s->initial_count_load_time = 0;
>      s->next_time = 0;
>      s->wait_for_sipi = 1;
> -
> -    s->cpu_env->halted = !(s->apicbase & MSR_IA32_APICBASE_BSP);

We are now lacking 'halted' initialization after system reset. Could be
addressed by a special reset handler in hw/pc.c, I guess.

Jan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2010-06-06  7:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05 21:31 [Qemu-devel] [PATCH 6/6] apic: avoid using CPUState internals Blue Swirl
2010-06-06  7:36 ` Jan Kiszka [this message]
2010-06-06  7:42   ` [Qemu-devel] " Blue Swirl
2010-06-06 17:39 ` Paolo Bonzini
2010-06-07  6:35   ` Markus Armbruster
2010-06-09 19:59   ` Blue Swirl
2010-06-10 10:14     ` Paolo Bonzini

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=4C0B4FE1.9070608@web.de \
    --to=jan.kiszka@web.de \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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.