All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Sergio Lopez <slp@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: Re: [PATCH] hw/i386: Use device_cold_reset() to reset the APIC
Date: Thu, 13 Oct 2022 13:33:25 -0400	[thread overview]
Message-ID: <20221013133311-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20221013171926.1447899-1-peter.maydell@linaro.org>

On Thu, Oct 13, 2022 at 06:19:26PM +0100, Peter Maydell wrote:
> The semantic difference between the deprecated device_legacy_reset()
> function and the newer device_cold_reset() function is that the new
> function resets both the device itself and any qbuses it owns,
> whereas the legacy function resets just the device itself and nothing
> else.
> 
> The pc_machine_reset() and microvm_machine_reset() functions use
> device_legacy_reset() to reset the APIC; this is an APICCommonState
> and does not have any qbuses, so for this purpose the two functions
> behave identically and we can stop using the deprecated one.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
> NB: tested only with 'make check' and 'make check-avocado'
> 
>  hw/i386/microvm.c | 2 +-
>  hw/i386/pc.c      | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
> index 7fe8cce03e9..0b08010bf0a 100644
> --- a/hw/i386/microvm.c
> +++ b/hw/i386/microvm.c
> @@ -486,7 +486,7 @@ static void microvm_machine_reset(MachineState *machine)
>          cpu = X86_CPU(cs);
>  
>          if (cpu->apic_state) {
> -            device_legacy_reset(cpu->apic_state);
> +            device_cold_reset(cpu->apic_state);
>          }
>      }
>  }
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 566accf7e60..2b2d0bc2b33 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1860,7 +1860,7 @@ static void pc_machine_reset(MachineState *machine)
>          cpu = X86_CPU(cs);
>  
>          if (cpu->apic_state) {
> -            device_legacy_reset(cpu->apic_state);
> +            device_cold_reset(cpu->apic_state);
>          }
>      }
>  }
> -- 
> 2.25.1



  reply	other threads:[~2022-10-13 17:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 17:19 [PATCH] hw/i386: Use device_cold_reset() to reset the APIC Peter Maydell
2022-10-13 17:33 ` Michael S. Tsirkin [this message]
2022-10-13 20:43 ` 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=20221013133311-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=slp@redhat.com \
    /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.