From patchwork Mon Mar 12 16:24:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 7235 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id F3FA123E0E for ; Mon, 12 Mar 2012 16:24:51 +0000 (UTC) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id D616FA181AC for ; Mon, 12 Mar 2012 16:24:51 +0000 (UTC) Received: by eekd4 with SMTP id d4so1361257eek.11 for ; Mon, 12 Mar 2012 09:24:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=9zU7Aj5VlYguBYowqZeEOLg8vdNwFHE3+KcgfURi5S0=; b=iXp7LxRB2AcJBCU1MijNp0c3IF0tE9sNdncLY4v3/tx1FJdW9D0d8bH+GFAAyE2Www mTVe7hOZ7J3kT1yqxQCXAortNuWt5Y3RgGddleZvxvNUOv+Kl7ZVZttTsUX3dvXxTZak y6Mt3uo5Da3T5nc1vG3rvf0q59ini+FcEZiXhPnZPiXlhhoAq4d5vmtq+Nh1kAIboEIf ID7QxrqnSlsr3ewaZqHtRtQ7OqG5p+ZnILca47XJBGhgi3iLgpDA7o/MOKfMIDFpJPBu bJ8F6ymWy8bu2d8wyUi/jAL1oItIhkOIpBOgl6MkU9YBq93je6M7/bbdO9fVS4lXwBjo DyUA== Received: by 10.50.222.233 with SMTP id qp9mr9061120igc.58.1331569490943; Mon, 12 Mar 2012 09:24:50 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp44910ibg; Mon, 12 Mar 2012 09:24:50 -0700 (PDT) Received: by 10.216.135.103 with SMTP id t81mr7611561wei.113.1331569489121; Mon, 12 Mar 2012 09:24:49 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id r65si18529279weq.131.2012.03.12.09.24.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Mar 2012 09:24:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1S783B-0000vq-JK; Mon, 12 Mar 2012 16:24:45 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Christoffer Dall , Alexander Graf Subject: [PATCH] gdbstub: Synchronize CPU state unconditionally in gdb_set_cpu_pc Date: Mon, 12 Mar 2012 16:24:45 +0000 Message-Id: <1331569485-3559-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQnv6T3hNn5a/IZbU1sja6bv95FVQzn/L/Ntl7srWjPyRHVI6uZiOOpyukmIFroIyofHZoI3 Synchronize the CPU state via cpu_sychronize_state() unconditionally in gdb_set_cpu_pc() rather than only in some of the target ifdef ladder cases. We can divide the CPUs into three categories: * non-KVM targets: no change of behaviour since we will use the kvm-stub.c no-op function. * i386 and s390: no change of behaviour since they were already calling this function * PPC (in KVM mode): this fixes an error: failing to synchronise was accidental and probably a bug. This also paves the way for other targets (specifically ARM) which can add KVM support in future without having to add another target specific change to this bit of code. Signed-off-by: Peter Maydell --- Alex: could you test the KVM PPC case, please, since that's the only one where we actually change behaviour here? gdbstub.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index ef95ac2..776dcc5 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1904,8 +1904,8 @@ static void gdb_breakpoint_remove_all(void) static void gdb_set_cpu_pc(GDBState *s, target_ulong pc) { -#if defined(TARGET_I386) cpu_synchronize_state(s->c_cpu); +#if defined(TARGET_I386) s->c_cpu->eip = pc; #elif defined (TARGET_PPC) s->c_cpu->nip = pc; @@ -1930,7 +1930,6 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc) #elif defined (TARGET_ALPHA) s->c_cpu->pc = pc; #elif defined (TARGET_S390X) - cpu_synchronize_state(s->c_cpu); s->c_cpu->psw.addr = pc; #elif defined (TARGET_LM32) s->c_cpu->pc = pc;