All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Cui <cui.tao@linux.dev>
To: qemu-devel@nongnu.org
Cc: "Song Gao" <gaosong@loongson.cn>,
	"Bibo Mao" <maobibo@loongson.cn>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Qiang Ma" <maqianga@uniontech.com>,
	"Tao Cui" <cuitao@kylinos.cn>
Subject: [PATCH 0/4] target/loongarch/kvm: cpucfg and device attr fixes
Date: Thu, 25 Jun 2026 09:58:30 +0800	[thread overview]
Message-ID: <20260625015835.678819-1-cui.tao@linux.dev> (raw)

From: Tao Cui <cuitao@kylinos.cn>

A few small robustness fixes around cpucfg register sync and kvm device
attribute handling in the LoongArch KVM target.

  1/4: kvm_check_cpucfg2() discarded the return value of
       KVM_GET_DEVICE_ATTR and used an uninitialized val to mask
       cpucfg[2]; check the return value and initialize val.

  2/4: kvm_get_stealtime(), kvm_set_stealtime() and kvm_set_pv_features()
       pass a struct kvm_device_attr by value to the variadic
       kvm_vcpu_ioctl(), which expects a pointer. Pass &attr.

  3/4: drop the redundant trace_kvm_failed_get/put_cpucfg() calls and
       their now-unused trace events; kvm_get/set_one_reg() already trace
       on failure.

  4/4: kvm_loongarch_get/put_cpucfg() overwrite ret on each iteration, so
       only the last register's result is returned and earlier failures
       are lost; on a failed read, get_cpucfg() also stores a stale val.
       Accumulate errors with ret |= and only store on a successful read.

Compiled and boot-tested on a loongarch64 KVM host.

Tao Cui (4):
  target/loongarch/kvm: fix uninitialized val and unchecked GET in
    cpucfg2 check
  target/loongarch/kvm: pass device attr by reference to kvm_vcpu_ioctl
  target/loongarch/kvm: remove redundant cpucfg failure traces
  target/loongarch/kvm: fix cpucfg sync error handling

 target/loongarch/kvm/kvm.c    | 39 ++++++++++++++++++-----------------
 target/loongarch/trace-events |  2 --
 2 files changed, 20 insertions(+), 21 deletions(-)

-- 
2.43.0



             reply	other threads:[~2026-06-25  1:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25  1:58 Tao Cui [this message]
2026-06-25  1:58 ` [PATCH 1/4] target/loongarch/kvm: fix uninitialized val and unchecked GET in cpucfg2 check Tao Cui
2026-06-25  2:48   ` Bibo Mao
2026-06-25  3:24     ` Tao Cui
2026-06-25  1:58 ` [PATCH 2/4] target/loongarch/kvm: pass device attr by reference to kvm_vcpu_ioctl Tao Cui
2026-06-25  2:32   ` Bibo Mao
2026-06-25  1:58 ` [PATCH 3/4] target/loongarch/kvm: remove redundant cpucfg failure traces Tao Cui
2026-06-25  2:38   ` Bibo Mao
2026-06-25  3:33     ` Tao Cui
2026-06-25  3:58       ` Bibo Mao
2026-06-25  1:58 ` [PATCH 4/4] target/loongarch/kvm: fix cpucfg sync error handling Tao Cui

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=20260625015835.678819-1-cui.tao@linux.dev \
    --to=cui.tao@linux.dev \
    --cc=cuitao@kylinos.cn \
    --cc=gaosong@loongson.cn \
    --cc=maobibo@loongson.cn \
    --cc=maqianga@uniontech.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@mailo.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.