* [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field
@ 2020-08-06 15:07 Philippe Mathieu-Daudé
2020-08-07 10:02 ` Stefan Hajnoczi
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-06 15:07 UTC (permalink / raw)
To: qemu-devel
Cc: David Hildenbrand, Alex Bennée, Richard Henderson,
Alexander Bulekov, Stefan Hajnoczi, Paolo Bonzini,
Philippe Mathieu-Daudé,
Richard Henderson
Last uses of memory_region_clear_global_locking() have been
removed in commit 7070e085d4 ("acpi: mark PMTIMER as unlocked")
and commit 08565552f7 ("cputlb: Move NOTDIRTY handling from I/O
path to TLB path").
Remove memory_region_clear_global_locking() and the now unused
'global_locking' field in MemoryRegion.
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/exec/memory.h | 14 --------------
accel/tcg/cputlb.c | 4 ++--
exec.c | 2 +-
softmmu/memory.c | 6 ------
4 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 307e527835..bb84283376 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -377,7 +377,6 @@ struct MemoryRegion {
bool nonvolatile;
bool rom_device;
bool flush_coalesced_mmio;
- bool global_locking;
uint8_t dirty_log_mask;
bool is_iommu;
RAMBlock *ram_block;
@@ -1711,19 +1710,6 @@ void memory_region_set_flush_coalesced(MemoryRegion *mr);
*/
void memory_region_clear_flush_coalesced(MemoryRegion *mr);
-/**
- * memory_region_clear_global_locking: Declares that access processing does
- * not depend on the QEMU global lock.
- *
- * By clearing this property, accesses to the memory region will be processed
- * outside of QEMU's global lock (unless the lock is held on when issuing the
- * access request). In this case, the device model implementing the access
- * handlers is responsible for synchronization of concurrency.
- *
- * @mr: the memory region to be updated.
- */
-void memory_region_clear_global_locking(MemoryRegion *mr);
-
/**
* memory_region_add_eventfd: Request an eventfd to be triggered when a word
* is written to a location.
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 5698292749..9ddf2b8dfa 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1053,7 +1053,7 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
cpu_io_recompile(cpu, retaddr);
}
- if (mr->global_locking && !qemu_mutex_iothread_locked()) {
+ if (!qemu_mutex_iothread_locked()) {
qemu_mutex_lock_iothread();
locked = true;
}
@@ -1114,7 +1114,7 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
*/
save_iotlb_data(cpu, iotlbentry->addr, section, mr_offset);
- if (mr->global_locking && !qemu_mutex_iothread_locked()) {
+ if (!qemu_mutex_iothread_locked()) {
qemu_mutex_lock_iothread();
locked = true;
}
diff --git a/exec.c b/exec.c
index 6f381f98e2..05cfc34b6c 100644
--- a/exec.c
+++ b/exec.c
@@ -3135,7 +3135,7 @@ static bool prepare_mmio_access(MemoryRegion *mr)
bool unlocked = !qemu_mutex_iothread_locked();
bool release_lock = false;
- if (unlocked && mr->global_locking) {
+ if (unlocked) {
qemu_mutex_lock_iothread();
unlocked = false;
release_lock = true;
diff --git a/softmmu/memory.c b/softmmu/memory.c
index af25987518..2303747feb 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1221,7 +1221,6 @@ static void memory_region_initfn(Object *obj)
mr->ops = &unassigned_mem_ops;
mr->enabled = true;
mr->romd_mode = true;
- mr->global_locking = true;
mr->destructor = memory_region_destructor_none;
QTAILQ_INIT(&mr->subregions);
QTAILQ_INIT(&mr->coalesced);
@@ -2277,11 +2276,6 @@ void memory_region_clear_flush_coalesced(MemoryRegion *mr)
}
}
-void memory_region_clear_global_locking(MemoryRegion *mr)
-{
- mr->global_locking = false;
-}
-
static bool userspace_eventfd_warning;
void memory_region_add_eventfd(MemoryRegion *mr,
--
2.21.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field
2020-08-06 15:07 [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field Philippe Mathieu-Daudé
@ 2020-08-07 10:02 ` Stefan Hajnoczi
2020-08-07 10:16 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-08-07 10:02 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: David Hildenbrand, Richard Henderson, qemu-devel,
Alexander Bulekov, Paolo Bonzini, Alex Bennée,
Richard Henderson
[-- Attachment #1: Type: text/plain, Size: 924 bytes --]
On Thu, Aug 06, 2020 at 05:07:26PM +0200, Philippe Mathieu-Daudé wrote:
> Last uses of memory_region_clear_global_locking() have been
> removed in commit 7070e085d4 ("acpi: mark PMTIMER as unlocked")
> and commit 08565552f7 ("cputlb: Move NOTDIRTY handling from I/O
> path to TLB path").
> Remove memory_region_clear_global_locking() and the now unused
> 'global_locking' field in MemoryRegion.
>
> Reported-by: Alexander Bulekov <alxndr@bu.edu>
> Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> include/exec/memory.h | 14 --------------
> accel/tcg/cputlb.c | 4 ++--
> exec.c | 2 +-
> softmmu/memory.c | 6 ------
> 4 files changed, 3 insertions(+), 23 deletions(-)
It can be added back in later, if necessary. For now let's drop the dead
code.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field
2020-08-07 10:02 ` Stefan Hajnoczi
@ 2020-08-07 10:16 ` Paolo Bonzini
2020-08-22 20:13 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2020-08-07 10:16 UTC (permalink / raw)
To: Stefan Hajnoczi, Philippe Mathieu-Daudé
Cc: David Hildenbrand, Richard Henderson, qemu-devel,
Alexander Bulekov, Alex Bennée, Richard Henderson
[-- Attachment #1.1: Type: text/plain, Size: 1123 bytes --]
On 07/08/20 12:02, Stefan Hajnoczi wrote:
> On Thu, Aug 06, 2020 at 05:07:26PM +0200, Philippe Mathieu-Daudé wrote:
>> Last uses of memory_region_clear_global_locking() have been
>> removed in commit 7070e085d4 ("acpi: mark PMTIMER as unlocked")
>> and commit 08565552f7 ("cputlb: Move NOTDIRTY handling from I/O
>> path to TLB path").
>> Remove memory_region_clear_global_locking() and the now unused
>> 'global_locking' field in MemoryRegion.
>>
>> Reported-by: Alexander Bulekov <alxndr@bu.edu>
>> Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> include/exec/memory.h | 14 --------------
>> accel/tcg/cputlb.c | 4 ++--
>> exec.c | 2 +-
>> softmmu/memory.c | 6 ------
>> 4 files changed, 3 insertions(+), 23 deletions(-)
>
> It can be added back in later, if necessary. For now let's drop the dead
> code.
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>
I expect it will come back since Linaro is working on BQL-free interrupt
handling for TCG, but no objections.
Paolo
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field
2020-08-07 10:16 ` Paolo Bonzini
@ 2020-08-22 20:13 ` Philippe Mathieu-Daudé
2020-08-23 15:02 ` Robert Foley
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-22 20:13 UTC (permalink / raw)
To: Paolo Bonzini, Stefan Hajnoczi, Robert Foley
Cc: David Hildenbrand, Richard Henderson, qemu-devel,
Alexander Bulekov, Alex Bennée, Richard Henderson
+Robert
On 8/7/20 12:16 PM, Paolo Bonzini wrote:
> On 07/08/20 12:02, Stefan Hajnoczi wrote:
>> On Thu, Aug 06, 2020 at 05:07:26PM +0200, Philippe Mathieu-Daudé wrote:
>>> Last uses of memory_region_clear_global_locking() have been
>>> removed in commit 7070e085d4 ("acpi: mark PMTIMER as unlocked")
>>> and commit 08565552f7 ("cputlb: Move NOTDIRTY handling from I/O
>>> path to TLB path").
>>> Remove memory_region_clear_global_locking() and the now unused
>>> 'global_locking' field in MemoryRegion.
>>>
>>> Reported-by: Alexander Bulekov <alxndr@bu.edu>
>>> Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>> include/exec/memory.h | 14 --------------
>>> accel/tcg/cputlb.c | 4 ++--
>>> exec.c | 2 +-
>>> softmmu/memory.c | 6 ------
>>> 4 files changed, 3 insertions(+), 23 deletions(-)
>>
>> It can be added back in later, if necessary. For now let's drop the dead
>> code.
>>
>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>>
>
> I expect it will come back since Linaro is working on BQL-free interrupt
> handling for TCG, but no objections.
Robert, any comment on this patch?
Thanks,
Phil.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field
2020-08-22 20:13 ` Philippe Mathieu-Daudé
@ 2020-08-23 15:02 ` Robert Foley
0 siblings, 0 replies; 5+ messages in thread
From: Robert Foley @ 2020-08-23 15:02 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: David Hildenbrand, Richard Henderson, QEMU Developers,
Alexander Bulekov, Stefan Hajnoczi, Paolo Bonzini,
Alex Bennée, Richard Henderson
On Sat, 22 Aug 2020 at 16:13, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> +Robert
>
> On 8/7/20 12:16 PM, Paolo Bonzini wrote:
> > On 07/08/20 12:02, Stefan Hajnoczi wrote:
> >> On Thu, Aug 06, 2020 at 05:07:26PM +0200, Philippe Mathieu-Daudé wrote:
> >>> Last uses of memory_region_clear_global_locking() have been
> >>> removed in commit 7070e085d4 ("acpi: mark PMTIMER as unlocked")
> >>> and commit 08565552f7 ("cputlb: Move NOTDIRTY handling from I/O
> >>> path to TLB path").
> >>> Remove memory_region_clear_global_locking() and the now unused
> >>> 'global_locking' field in MemoryRegion.
> >>>
> >>> Reported-by: Alexander Bulekov <alxndr@bu.edu>
> >>> Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
> >>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >>> ---
> >>> include/exec/memory.h | 14 --------------
> >>> accel/tcg/cputlb.c | 4 ++--
> >>> exec.c | 2 +-
> >>> softmmu/memory.c | 6 ------
> >>> 4 files changed, 3 insertions(+), 23 deletions(-)
> >>
> >> It can be added back in later, if necessary. For now let's drop the dead
> >> code.
> >>
> >> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> >>
> >
> > I expect it will come back since Linaro is working on BQL-free interrupt
> > handling for TCG, but no objections.
>
> Robert, any comment on this patch?
>
> Thanks,
>
> Phil.
>
Phil, Thanks for the heads up on this !
No objections to removing this. We can easily re-add it if/when needed.
Thanks,
-Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-08-23 15:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 15:07 [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field Philippe Mathieu-Daudé
2020-08-07 10:02 ` Stefan Hajnoczi
2020-08-07 10:16 ` Paolo Bonzini
2020-08-22 20:13 ` Philippe Mathieu-Daudé
2020-08-23 15:02 ` Robert Foley
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).