From: gengdongjiu <gengdongjiu@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Shannon Zhao <zhaoshenglong@huawei.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Eduardo Habkost <ehabkost@redhat.com>,
James Morse <james.morse@arm.com>,
Christoffer Dall <christoffer.dall@linaro.org>,
Marc Zyngier <marc.zyngier@arm.com>,
kvm-devel <kvm@vger.kernel.org>,
QEMU Developers <qemu-devel@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>,
Huangshaoyu <huangshaoyu@huawei.com>,
"Zhengqiang (turing)" <zhengqiang10@huawei.com>,
Xu Wei <xuwei5@hisilicon.com>
Subject: Re: [Qemu-devel] [PATCH v14 5/9] target-arm: kvm64: inject synchronous External Abort
Date: Sat, 13 Jan 2018 16:27:33 +0800 [thread overview]
Message-ID: <bf79cd19-c1d0-16db-7d6b-36784bc8aa02@huawei.com> (raw)
In-Reply-To: <f6853acc-ca07-9627-32e6-91240c6669b7@huawei.com>
Hi Peter,
On 2018/1/13 13:24, gengdongjiu wrote:
>>> +
>>> + /* For the AArch64, instruction length is 32-bit */
>>> + esr |= ARM_EL_IL;
>>> + env->exception.syndrome = esr;
>>> +
>>> + cc->do_interrupt(c);
>>> +
>>> + /* set ESR_EL1 */
>>> + ret = kvm_arm_cpreg_value(cpu, offsetof(CPUARMState, cp15.esr_el[1]));
>> Breakpoint injection doesn't need to do this. Neither should this code.
> As my above explanation, in the KVM mode, it needs to set the ESR_ELx in extra method.
> the cc->do_interrupt(c) does not set ESR_ELx. so I use kvm_arm_cpreg_value()
> to set it. whether you have better method to set the ESR_Elx except for my method? Thanks.
If QEMU changes the KVM's registers, it needs to call write_list_to_kvmstate() to write the cpu->cpreg_values[] list
to KVM through KVM_SET_ONE_REG IOCTL[1]. In Qemu, now it should not have software path to change the cpu->cpreg_values[] list
except write_cpustate_to_list(). Here I can also call write_cpustate_to_list() instead of kvm_arm_cpreg_value() to change
cpu->cpreg_values[] list, but the write_cpustate_to_list() will write all the coprocessor state to the cpu->cpreg_values[] list,
we can not sure all the coprocessor states are right, so here I only change corresponding index value in this list using kvm_arm_cpreg_value().
Breakpoint injection that you mentioned should not change KVM register or not in the KVM mode.
[1]:
kvm_arch_put_registers()
-> write_list_to_kvmstate()
-> write cpu->cpreg_values[] to the kernel KVM through KVM_SET_ONE_REG
>
>
>>> + if (ret) {
>>> + fprintf(stderr, "<%s> failed to set esr_el1\n", __func__);
>>> + abort();
>>> + }
>>> +}
>>> +
>>> #define AARCH64_CORE_REG(x) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
>>> KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(x))
>>>
>>> --
>>> 1.8.3.1
next prev parent reply other threads:[~2018-01-13 8:30 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-28 5:54 [Qemu-devel] [PATCH v14 0/9] Add ARMv8 RAS virtualization support in QEMU Dongjiu Geng
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 1/9] ACPI: add some GHES structures and macros definition Dongjiu Geng
2017-12-28 12:29 ` Igor Mammedov
2018-01-03 10:29 ` gengdongjiu
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 2/9] ACPI: Add APEI GHES table generation and CPER record support Dongjiu Geng
2017-12-28 14:18 ` Igor Mammedov
2017-12-29 6:33 ` gengdongjiu
2018-01-03 2:21 ` gengdongjiu
2018-01-03 13:31 ` Igor Mammedov
2018-01-04 4:21 ` gengdongjiu
2018-01-09 16:51 ` Peter Maydell
2018-01-10 5:22 ` gengdongjiu
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 3/9] docs: APEI GHES generation and CPER record description Dongjiu Geng
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 4/9] ACPI: enable APEI GHES in the configure file Dongjiu Geng
2018-01-09 17:16 ` Peter Maydell
2018-01-10 12:20 ` gengdongjiu
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 5/9] target-arm: kvm64: inject synchronous External Abort Dongjiu Geng
2017-12-28 13:49 ` Igor Mammedov
2017-12-29 6:27 ` gengdongjiu
2018-01-09 17:30 ` Peter Maydell
2018-01-11 5:59 ` gengdongjiu
2018-01-11 9:53 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-01-11 10:33 ` gengdongjiu
2018-01-13 5:24 ` [Qemu-devel] " gengdongjiu
2018-01-13 8:27 ` gengdongjiu [this message]
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 6/9] Move related hwpoison page functions to accel/kvm/ folder Dongjiu Geng
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 7/9] ARM: ACPI: Add GPIO notification type for hardware RAS error Dongjiu Geng
2017-12-28 14:53 ` Igor Mammedov
2018-01-03 3:48 ` gengdongjiu
2018-01-03 13:36 ` Igor Mammedov
2018-01-04 4:55 ` gengdongjiu
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 8/9] hw/arm/virt: Add RAS platform version for migration Dongjiu Geng
2017-12-28 14:58 ` Igor Mammedov
2018-01-03 4:02 ` gengdongjiu
2018-01-09 15:42 ` Peter Maydell
2017-12-28 5:54 ` [Qemu-devel] [PATCH v14 9/9] target-arm: kvm64: handle SIGBUS signal from kernel or KVM Dongjiu Geng
2017-12-28 15:07 ` Igor Mammedov
2018-01-03 9:13 ` gengdongjiu
2018-01-03 13:44 ` Igor Mammedov
2018-01-04 6:31 ` gengdongjiu
2018-01-09 17:14 ` Peter Maydell
2018-01-10 11:56 ` gengdongjiu
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=bf79cd19-c1d0-16db-7d6b-36784bc8aa02@huawei.com \
--to=gengdongjiu@huawei.com \
--cc=christoffer.dall@linaro.org \
--cc=ehabkost@redhat.com \
--cc=huangshaoyu@huawei.com \
--cc=imammedo@redhat.com \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=xuwei5@hisilicon.com \
--cc=zhaoshenglong@huawei.com \
--cc=zhengqiang10@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).