diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-28 17:34:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-28 17:34:51 +0300 |
commit | 2957975756291d8dbf4f744dbe68278f319b7de7 (patch) | |
tree | 168367a320bd8d715cea89f6053b14f87bc7735b /arch/loongarch/kvm/intc/pch_pic.c | |
parent | bad0d7a6a7d61f129b9ebffc43acd2056bfb4def (diff) | |
parent | be15dab9a451155bdf3f5278608fe8dc67e07cc1 (diff) | |
download | linux-rolling-stable.tar.xz |
Merge v6.16.4linux-rolling-stable
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/loongarch/kvm/intc/pch_pic.c')
-rw-r--r-- | arch/loongarch/kvm/intc/pch_pic.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/loongarch/kvm/intc/pch_pic.c b/arch/loongarch/kvm/intc/pch_pic.c index 08fce845f668..ef5044796b7a 100644 --- a/arch/loongarch/kvm/intc/pch_pic.c +++ b/arch/loongarch/kvm/intc/pch_pic.c @@ -195,6 +195,11 @@ static int kvm_pch_pic_read(struct kvm_vcpu *vcpu, return -EINVAL; } + if (addr & (len - 1)) { + kvm_err("%s: pch pic not aligned addr %llx len %d\n", __func__, addr, len); + return -EINVAL; + } + /* statistics of pch pic reading */ vcpu->kvm->stat.pch_pic_read_exits++; ret = loongarch_pch_pic_read(s, addr, len, val); @@ -302,6 +307,11 @@ static int kvm_pch_pic_write(struct kvm_vcpu *vcpu, return -EINVAL; } + if (addr & (len - 1)) { + kvm_err("%s: pch pic not aligned addr %llx len %d\n", __func__, addr, len); + return -EINVAL; + } + /* statistics of pch pic writing */ vcpu->kvm->stat.pch_pic_write_exits++; ret = loongarch_pch_pic_write(s, addr, len, val); |