Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Keqian Zhu
On 2021/3/10 0:08, Peter Xu wrote: > On Tue, Mar 09, 2021 at 02:57:53PM +, Dr. David Alan Gilbert wrote: >> * Thomas Huth (th...@redhat.com) wrote: >>> On 09/03/2021 15.05, Keqian Zhu wrote: On 2021/3/9 21:48, Thomas Huth wrote: > On 17/12/2020 02.49, Keqian Zhu wrote: [..

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Paolo Bonzini
On 09/03/21 17:26, Peter Maydell wrote: The documentation comment for memory_region_snapshot_and_clear_dirty() says: * The dirty bitmap region which gets copyed into the snapshot (and * cleared afterwards) can be larger than requested. The boundaries * are rounded up/down That is, it is t

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Peter Maydell
On Tue, 9 Mar 2021 at 16:20, Thomas Huth wrote: > The vga code basically does this: > > region_start = (s->start_addr * 4); > region_end = region_start + (ram_addr_t)s->line_offset * height; > region_end += width * depth / 8; /* scanline length */ > region_end -= s->line_offset

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Thomas Huth
On 09/03/2021 15.57, Dr. David Alan Gilbert wrote: * Thomas Huth (th...@redhat.com) wrote: On 09/03/2021 15.05, Keqian Zhu wrote: On 2021/3/9 21:48, Thomas Huth wrote: On 17/12/2020 02.49, Keqian Zhu wrote: The parameters start and size are transfered from QEMU memory emulation layer. It ca

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Peter Xu
On Tue, Mar 09, 2021 at 02:57:53PM +, Dr. David Alan Gilbert wrote: > * Thomas Huth (th...@redhat.com) wrote: > > On 09/03/2021 15.05, Keqian Zhu wrote: > > > > > > > > > On 2021/3/9 21:48, Thomas Huth wrote: > > > > On 17/12/2020 02.49, Keqian Zhu wrote: > > > > > The parameters start and si

RE: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread zhukeqian
Thanks for your bug report. I was just off work, will dig into it tomorrow. thanks :) Keqian On 09/03/2021 15.05, Keqian Zhu wrote: > > > On 2021/3/9 21:48, Thomas Huth wrote: >> On 17/12/2020 02.49, Keqian Zhu wrote: >>> The parameters start and size are transfered from QEMU memory >>> emula

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Dr. David Alan Gilbert
* Thomas Huth (th...@redhat.com) wrote: > On 09/03/2021 15.05, Keqian Zhu wrote: > > > > > > On 2021/3/9 21:48, Thomas Huth wrote: > > > On 17/12/2020 02.49, Keqian Zhu wrote: > > > > The parameters start and size are transfered from QEMU memory > > > > emulation layer. It can promise that they a

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Thomas Huth
On 09/03/2021 15.05, Keqian Zhu wrote: On 2021/3/9 21:48, Thomas Huth wrote: On 17/12/2020 02.49, Keqian Zhu wrote: The parameters start and size are transfered from QEMU memory emulation layer. It can promise that they are TARGET_PAGE_SIZE aligned. However, KVM needs they are qemu_real_page_

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Keqian Zhu
On 2021/3/9 21:48, Thomas Huth wrote: > On 17/12/2020 02.49, Keqian Zhu wrote: >> The parameters start and size are transfered from QEMU memory >> emulation layer. It can promise that they are TARGET_PAGE_SIZE >> aligned. However, KVM needs they are qemu_real_page_size aligned. >> >> Though no c

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Thomas Huth
On 17/12/2020 02.49, Keqian Zhu wrote: The parameters start and size are transfered from QEMU memory emulation layer. It can promise that they are TARGET_PAGE_SIZE aligned. However, KVM needs they are qemu_real_page_size aligned. Though no caller breaks this aligned requirement currently, we'd b

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-02-01 Thread Keqian Zhu
Hi Philippe, On 2021/2/1 23:14, Philippe Mathieu-Daudé wrote: > Hi, > > On 12/17/20 2:49 AM, Keqian Zhu wrote: >> The parameters start and size are transfered from QEMU memory >> emulation layer. It can promise that they are TARGET_PAGE_SIZE >> aligned. However, KVM needs they are qemu_real_page_

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-02-01 Thread Philippe Mathieu-Daudé
Hi, On 12/17/20 2:49 AM, Keqian Zhu wrote: > The parameters start and size are transfered from QEMU memory > emulation layer. It can promise that they are TARGET_PAGE_SIZE > aligned. However, KVM needs they are qemu_real_page_size aligned. > > Though no caller breaks this aligned requirement curr

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2020-12-17 Thread Peter Xu
On Thu, Dec 17, 2020 at 09:49:41AM +0800, Keqian Zhu wrote: > The parameters start and size are transfered from QEMU memory > emulation layer. It can promise that they are TARGET_PAGE_SIZE > aligned. However, KVM needs they are qemu_real_page_size aligned. > > Though no caller breaks this aligned

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2020-12-17 Thread Andrew Jones
On Thu, Dec 17, 2020 at 09:49:41AM +0800, Keqian Zhu wrote: > The parameters start and size are transfered from QEMU memory > emulation layer. It can promise that they are TARGET_PAGE_SIZE > aligned. However, KVM needs they are qemu_real_page_size aligned. > > Though no caller breaks this aligned

[PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2020-12-16 Thread Keqian Zhu
The parameters start and size are transfered from QEMU memory emulation layer. It can promise that they are TARGET_PAGE_SIZE aligned. However, KVM needs they are qemu_real_page_size aligned. Though no caller breaks this aligned requirement currently, we'd better add an explicit assert to avoid fut