From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev,
Will Deacon <will@kernel.org>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Andre Przywara <andre.przywara@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH kvmtool 1/5] arm64: Do not abort on register-dump failures
Date: Sat, 12 Sep 2026 20:36:42 +0100 [thread overview]
Message-ID: <c53c18dd-1f4c-4afd-a7e6-bebf4a2af872@arm.com> (raw)
In-Reply-To: <CA+EHjTx5N1x5GzyHK62WqMnxtG3+=qejMZ36Oc1QkwJEUZgRAw@mail.gmail.com>
On 12/09/2026 15:02, Fuad Tabba wrote:
> On Sat, 12 Sept 2026 at 14:54, Fuad Tabba <fuad.tabba@linux.dev> wrote:
>>
>> Hi Suzuki,
>>
>> On Sat, 12 Sept 2026 at 08:33, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>>>
>>> On 31/08/2026 20:24, Fuad Tabba wrote:
>>>> kvm_cpu__show_registers() and kvm_cpu__show_code() read the vCPU's core
>>>> registers with KVM_GET_ONE_REG, and die() if the ioctl fails. Both are
>>>> diagnostics. They run from the KVM_EXIT_DEBUG case in kvm_cpu__start(),
>>>> from the "lkvm debug -d" dump path in handle_sigusr1(), and from the
>>>> panic dump in kvm_cpu_thread().
>>>>
>>>> Once a protected vCPU has run, its registers belong to the guest and
>>>> KVM_GET_ONE_REG returns -EPERM. Dying on that turns a diagnostic into a
>>>> VMM abort.
>>>
>>> Marc once suggested that these could always succeed with junk values for
>>> protected/Realm VMs. Do you think that is an option for pKVM ?
>>
>> It's possible, the host copy is still there, but I'd rather not. Once
>> the vCPU has run that copy is a mix rather than junk: the boot state
>> the VMM wrote, plus what the exit handlers copy out (the PSTATE mode,
>> x0 for an MMIO write, x0 to x2 for a forwarded PSCI call). A dump
>> would show a live PSTATE beside the PC from boot, and the VMM has no
>> way to distinguish them. With the error it prints that the state is
>> unavailable, which is what this patch does.
>>
>> It's also what the tree does for protected state elsewhere: s390
>> returns -EINVAL from KVM_GET/SET_ONE_REG on a protected VM, and x86
>> does the same from the register ioctls for the SEV-ES VM type, SNP and
>> TDX. Legacy SEV-ES is the one place that succeeds silently, kept for
>> backwards compatibility, and the commit that added the errors
>> (517987e3fb19) describes that as a problem. Sean's rationale for TDX:
>> KVM can't provide sane data, so it's userspace's job not to ask for it
>> [1].
>>
Thanks, I am aware of this. I will leave the decision to Marc.
For the record, for CCA we use GET_ONE_REG/SET_ONE_REG to configure
the SVE vector length, PMU Counter and the Debug HW BPRs and watch
points.
>>>
>>> If we go with this approach :
>>>
>>> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>>
>> Thanks, I'll add the tag. :)
>
> Unless I misunderstood what "this" refers to exactly, please shout if
> that's the case, or continue the discussion :)
You got it right. I meant if we are happy to go with approach in the
patch.
next prev parent reply other threads:[~2026-09-12 19:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 19:24 [PATCH kvmtool 0/5] Fix diagnostics and capability probes for protected VMs Fuad Tabba
2026-08-31 19:24 ` [PATCH kvmtool 1/5] arm64: Do not abort on register-dump failures Fuad Tabba
2026-09-12 7:33 ` Suzuki K Poulose
2026-09-12 13:54 ` Fuad Tabba
2026-09-12 14:02 ` Fuad Tabba
2026-09-12 19:36 ` Suzuki K Poulose [this message]
2026-08-31 19:24 ` [PATCH kvmtool 2/5] kvm: Bound-check the exit-reason string lookup Fuad Tabba
2026-09-12 7:35 ` Suzuki K Poulose
2026-08-31 19:24 ` [PATCH kvmtool 3/5] kvm: Name every exit reason the UAPI header defines Fuad Tabba
2026-09-12 7:35 ` Suzuki K Poulose
2026-08-31 19:24 ` [PATCH kvmtool 4/5] arm64: Query steal-time support on the VM fd Fuad Tabba
2026-09-12 7:28 ` Suzuki K Poulose
2026-08-31 19:24 ` [PATCH kvmtool 5/5] arm64: Query counter-offset " Fuad Tabba
2026-09-12 7:29 ` Suzuki K Poulose
2026-10-09 7:10 ` [PATCH kvmtool 0/5] Fix diagnostics and capability probes for protected VMs Fuad Tabba
2026-10-09 7:54 ` Will Deacon
2026-10-09 7:57 ` Fuad Tabba
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=c53c18dd-1f4c-4afd-a7e6-bebf4a2af872@arm.com \
--to=suzuki.poulose@arm.com \
--cc=alexandru.elisei@arm.com \
--cc=andre.przywara@arm.com \
--cc=fuad.tabba@linux.dev \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=will@kernel.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.