All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Intel-gfx] [PATCH 1/6] drm/i915/gt: Protect signaler walk with RCU
From: Matthew Auld @ 2020-02-20 13:16 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx
In-Reply-To: <158220312908.8112.2646972720625616758@skylake-alporthouse-com>

On 20/02/2020 12:52, Chris Wilson wrote:
> Quoting Matthew Auld (2020-02-20 12:47:28)
>> On 20/02/2020 07:50, Chris Wilson wrote:
>>> While we know that the waiters cannot disappear as we walk our list
>>> (only that they might be added), the same cannot be said for our
>>> signalers as they may be completed by the HW and retired as we process
>>> this request. Ergo we need to use rcu to protect the list iteration and
>>> remember to mark up the list_del_rcu.
>>>
>>> v2: Mark the deps as safe-for-rcu
>>>
>>> Fixes: 793c22617367 ("drm/i915/gt: Protect execlists_hold/unhold from new waiters")
>>> Fixes: 32ff621fd744 ("drm/i915/gt: Allow temporary suspension of inflight requests")
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>>> Cc: Matthew Auld <matthew.auld@intel.com>
>>> ---
>>>    drivers/gpu/drm/i915/gt/intel_lrc.c   | 16 ++++++++++------
>>>    drivers/gpu/drm/i915/i915_scheduler.c |  7 ++++---
>>>    2 files changed, 14 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
>>> index ba31cbe8c68e..47561dc29304 100644
>>> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
>>> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
>>> @@ -1668,9 +1668,9 @@ last_active(const struct intel_engine_execlists *execlists)
>>>                                     wait_link)
>>>    
>>>    #define for_each_signaler(p__, rq__) \
>>> -     list_for_each_entry_lockless(p__, \
>>> -                                  &(rq__)->sched.signalers_list, \
>>> -                                  signal_link)
>>> +     list_for_each_entry_rcu(p__, \
>>> +                             &(rq__)->sched.signalers_list, \
>>> +                             signal_link)
>>>    
>>>    static void defer_request(struct i915_request *rq, struct list_head * const pl)
>>>    {
>>> @@ -2533,11 +2533,13 @@ static bool execlists_hold(struct intel_engine_cs *engine,
>>>    static bool hold_request(const struct i915_request *rq)
>>>    {
>>>        struct i915_dependency *p;
>>> +     bool result = false;
>>>    
>>>        /*
>>>         * If one of our ancestors is on hold, we must also be on hold,
>>>         * otherwise we will bypass it and execute before it.
>>>         */
>>> +     rcu_read_lock();
>>>        for_each_signaler(p, rq) {
>>>                const struct i915_request *s =
>>>                        container_of(p->signaler, typeof(*s), sched);
>>> @@ -2545,11 +2547,13 @@ static bool hold_request(const struct i915_request *rq)
>>>                if (s->engine != rq->engine)
>>>                        continue;
>>>    
>>> -             if (i915_request_on_hold(s))
>>> -                     return true;
>>> +             result = i915_request_on_hold(s);
>>> +             if (result)
>>> +                     break;
>>>        }
>>> +     rcu_read_unlock();
>>>    
>>> -     return false;
>>> +     return result;
>>>    }
>>>    
>>>    static void __execlists_unhold(struct i915_request *rq)
>>> diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
>>> index e19a37a83397..59f70b674665 100644
>>> --- a/drivers/gpu/drm/i915/i915_scheduler.c
>>> +++ b/drivers/gpu/drm/i915/i915_scheduler.c
>>> @@ -486,7 +486,7 @@ void i915_sched_node_fini(struct i915_sched_node *node)
>>>        list_for_each_entry_safe(dep, tmp, &node->signalers_list, signal_link) {
>>>                GEM_BUG_ON(!list_empty(&dep->dfs_link));
>>>    
>>> -             list_del(&dep->wait_link);
>>> +             list_del_rcu(&dep->wait_link);
>>>                if (dep->flags & I915_DEPENDENCY_ALLOC)
>>>                        i915_dependency_free(dep);
>>>        }
>>> @@ -497,7 +497,7 @@ void i915_sched_node_fini(struct i915_sched_node *node)
>>>                GEM_BUG_ON(dep->signaler != node);
>>>                GEM_BUG_ON(!list_empty(&dep->dfs_link));
>>>    
>>> -             list_del(&dep->signal_link);
>>> +             list_del_rcu(&dep->signal_link);
>>>                if (dep->flags & I915_DEPENDENCY_ALLOC)
>>>                        i915_dependency_free(dep);
>>>        }
>>> @@ -526,7 +526,8 @@ static struct i915_global_scheduler global = { {
>>>    int __init i915_global_scheduler_init(void)
>>>    {
>>>        global.slab_dependencies = KMEM_CACHE(i915_dependency,
>>> -                                           SLAB_HWCACHE_ALIGN);
>>> +                                           SLAB_HWCACHE_ALIGN |
>>> +                                           SLAB_TYPESAFE_BY_RCU);
>>
>> So, the claim is that we should be fine if the node is re-used and then
>> initialised, even though there might exist a minuscule window where
>> hold_request might still be able to see it, somehow?
> 
> Yes. That is my claim. The saving grace here is that for the on-hold
> transitions we must go through the engine->active.lock which we are
> holding. Ergo hold_request() is safe.

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> -Chris
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* Re: USB DWC2 stops responding when insert/remove cable multiple times
From: Otavio Salvador @ 2020-02-20 13:16 UTC (permalink / raw)
  To: Minas Harutyunyan
  Cc: Greg Kroah-Hartman, linux-usb@vger.kernel.org, Felipe Balbi,
	Heiko Stuebner, linux-rockchip@lists.infradead.org, Johan Hovold
In-Reply-To: <beddbc55-fd22-96b7-c980-e4ea207a42f5@synopsys.com>

Hello Minas,

Thanks for all your help on this, ...

On Thu, Feb 20, 2020 at 3:59 AM Minas Harutyunyan
<Minas.Harutyunyan@synopsys.com> wrote:
>
> On 2/19/2020 7:10 PM, Otavio Salvador wrote:
...
> > What sequence do you want us to do?
>
> Yes. Can you provide also USB trace?

I can, however, it is not clear to me what you want us to do.

Should we use, on host side, usbmon? or do you want something different?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

^ permalink raw reply

* Re: [PATCH v3 01/20] scripts/git.orderfile: Display Cocci scripts before code modifications
From: Eric Blake @ 2020-02-20 13:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, Matthew Rosato, Michael S. Tsirkin,
	Jason Wang, Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	kvm, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Anthony Perard,
	xen-devel, Aleksandar Rikalo, David Gibson, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Stefan Weil, Alistair Francis,
	Richard Henderson, Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, Richard Henderson,
	Igor Mitsyanko, Cornelia Huck, Michael Walle, qemu-ppc,
	Paolo Bonzini
In-Reply-To: <20200220130548.29974-2-philmd@redhat.com>

On 2/20/20 7:05 AM, Philippe Mathieu-Daudé wrote:
> When we use a Coccinelle semantic script to do automatic
> code modifications, it makes sense to look at the semantic
> patch first.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   scripts/git.orderfile | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/scripts/git.orderfile b/scripts/git.orderfile
> index 1f747b583a..7cf22e0bf5 100644
> --- a/scripts/git.orderfile
> +++ b/scripts/git.orderfile
> @@ -22,6 +22,9 @@ Makefile*
>   qapi/*.json
>   qga/*.json
>   
> +# semantic patches
> +*.cocci
> +
>   # headers
>   *.h
>   
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply

* Re: USB DWC2 stops responding when insert/remove cable multiple times
From: Otavio Salvador @ 2020-02-20 13:16 UTC (permalink / raw)
  To: Minas Harutyunyan
  Cc: Greg Kroah-Hartman,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Felipe Balbi,
	Heiko Stuebner,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Johan Hovold
In-Reply-To: <beddbc55-fd22-96b7-c980-e4ea207a42f5-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>

Hello Minas,

Thanks for all your help on this, ...

On Thu, Feb 20, 2020 at 3:59 AM Minas Harutyunyan
<Minas.Harutyunyan-HKixBCOQz3hWk0Htik3J/w@public.gmane.org> wrote:
>
> On 2/19/2020 7:10 PM, Otavio Salvador wrote:
...
> > What sequence do you want us to do?
>
> Yes. Can you provide also USB trace?

I can, however, it is not clear to me what you want us to do.

Should we use, on host side, usbmon? or do you want something different?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

^ permalink raw reply

* [PATCH RESEND] pinctrl: meson-gxl: fix GPIOX sdio pins
From: Nicolas Belin @ 2020-02-20 13:15 UTC (permalink / raw)
  To: linus.walleij
  Cc: khilman, linux-amlogic, linux-kernel, Nicolas Belin, linux-gpio

In the gxl driver, the sdio cmd and clk pins are inverted. It has not caused
any issue so far because devices using these pins always take both pins
so the resulting configuration is OK.

Fixes: 0f15f500ff2c ("pinctrl: meson: Add GXL pinctrl definitions")
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Nicolas Belin <nbelin@baylibre.com>
---

Hi Linus,

Sorry for the the bad formatting of the first patch, this one should be fine.

Thanks

Nicolas

 drivers/pinctrl/meson/pinctrl-meson-gxl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
index 1b6e8646700f..2ac921c83da9 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
@@ -147,8 +147,8 @@ static const unsigned int sdio_d0_pins[]	= { GPIOX_0 };
 static const unsigned int sdio_d1_pins[]	= { GPIOX_1 };
 static const unsigned int sdio_d2_pins[]	= { GPIOX_2 };
 static const unsigned int sdio_d3_pins[]	= { GPIOX_3 };
-static const unsigned int sdio_cmd_pins[]	= { GPIOX_4 };
-static const unsigned int sdio_clk_pins[]	= { GPIOX_5 };
+static const unsigned int sdio_clk_pins[]	= { GPIOX_4 };
+static const unsigned int sdio_cmd_pins[]	= { GPIOX_5 };
 static const unsigned int sdio_irq_pins[]	= { GPIOX_7 };
 
 static const unsigned int nand_ce0_pins[]	= { BOOT_8 };
-- 
2.7.4


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related

* [PATCH RESEND] pinctrl: meson-gxl: fix GPIOX sdio pins
From: Nicolas Belin @ 2020-02-20 13:15 UTC (permalink / raw)
  To: linus.walleij
  Cc: khilman, linux-gpio, linux-amlogic, linux-kernel, Nicolas Belin

In the gxl driver, the sdio cmd and clk pins are inverted. It has not caused
any issue so far because devices using these pins always take both pins
so the resulting configuration is OK.

Fixes: 0f15f500ff2c ("pinctrl: meson: Add GXL pinctrl definitions")
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Nicolas Belin <nbelin@baylibre.com>
---

Hi Linus,

Sorry for the the bad formatting of the first patch, this one should be fine.

Thanks

Nicolas

 drivers/pinctrl/meson/pinctrl-meson-gxl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
index 1b6e8646700f..2ac921c83da9 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
@@ -147,8 +147,8 @@ static const unsigned int sdio_d0_pins[]	= { GPIOX_0 };
 static const unsigned int sdio_d1_pins[]	= { GPIOX_1 };
 static const unsigned int sdio_d2_pins[]	= { GPIOX_2 };
 static const unsigned int sdio_d3_pins[]	= { GPIOX_3 };
-static const unsigned int sdio_cmd_pins[]	= { GPIOX_4 };
-static const unsigned int sdio_clk_pins[]	= { GPIOX_5 };
+static const unsigned int sdio_clk_pins[]	= { GPIOX_4 };
+static const unsigned int sdio_cmd_pins[]	= { GPIOX_5 };
 static const unsigned int sdio_irq_pins[]	= { GPIOX_7 };
 
 static const unsigned int nand_ce0_pins[]	= { BOOT_8 };
-- 
2.7.4


^ permalink raw reply related

* Re: [RFC PATCH 0/5] Removing support for 32bit KVM/arm host
From: Marc Zyngier @ 2020-02-20 13:15 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Vladimir Murzin, Russell King, kvm, Arnd Bergmann,
	Suzuki K Poulose, Quentin Perret, Christoffer Dall,
	Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz, James Morse,
	Julien Thierry, Paolo Bonzini, Will Deacon, kvmarm,
	linux-arm-kernel
In-Reply-To: <621a0a92-6432-6c3e-cb69-0b601764fa69@samsung.com>

Hi Marek,

On 2020-02-20 12:44, Marek Szyprowski wrote:
> Hi Marc,
> 
> On 10.02.2020 15:13, Marc Zyngier wrote:
>> KVM/arm was merged just over 7 years ago, and has lived a very quiet
>> life so far. It mostly works if you're prepared to deal with its
>> limitations, it has been a good prototype for the arm64 version,
>> but it suffers a few problems:
>> 
>> - It is incomplete (no debug support, no PMU)
>> - It hasn't followed any of the architectural evolutions
>> - It has zero users (I don't count myself here)
>> - It is more and more getting in the way of new arm64 developments
> 
> That is a bit sad information. Mainline Exynos finally got everything
> that was needed to run it on the quite popular Samsung Exynos5422-based
> Odroid XU4/HC1/MC1 boards. According to the Odroid related forums it is
> being used. We also use it internally at Samsung.

Something like "too little, too late" springs to mind, but let's be
constructive. Is anyone using it in a production environment, where
they rely on the latest mainline kernel having KVM support?

The current proposal is to still have KVM support in 5.6, as well as
ongoing support for stable kernels. If that's not enough, can you please
explain your precise use case?

         M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* Re: [RFC PATCH 0/5] Removing support for 32bit KVM/arm host
From: Marc Zyngier @ 2020-02-20 13:15 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Russell King, kvm, Arnd Bergmann, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, Paolo Bonzini, Will Deacon, kvmarm,
	linux-arm-kernel
In-Reply-To: <621a0a92-6432-6c3e-cb69-0b601764fa69@samsung.com>

Hi Marek,

On 2020-02-20 12:44, Marek Szyprowski wrote:
> Hi Marc,
> 
> On 10.02.2020 15:13, Marc Zyngier wrote:
>> KVM/arm was merged just over 7 years ago, and has lived a very quiet
>> life so far. It mostly works if you're prepared to deal with its
>> limitations, it has been a good prototype for the arm64 version,
>> but it suffers a few problems:
>> 
>> - It is incomplete (no debug support, no PMU)
>> - It hasn't followed any of the architectural evolutions
>> - It has zero users (I don't count myself here)
>> - It is more and more getting in the way of new arm64 developments
> 
> That is a bit sad information. Mainline Exynos finally got everything
> that was needed to run it on the quite popular Samsung Exynos5422-based
> Odroid XU4/HC1/MC1 boards. According to the Odroid related forums it is
> being used. We also use it internally at Samsung.

Something like "too little, too late" springs to mind, but let's be
constructive. Is anyone using it in a production environment, where
they rely on the latest mainline kernel having KVM support?

The current proposal is to still have KVM support in 5.6, as well as
ongoing support for stable kernels. If that's not enough, can you please
explain your precise use case?

         M.
-- 
Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply

* Re: [RFC PATCH 0/5] Removing support for 32bit KVM/arm host
From: Marc Zyngier @ 2020-02-20 13:15 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-arm-kernel, kvmarm, kvm, Vladimir Murzin, Russell King,
	Arnd Bergmann, Suzuki K Poulose, Quentin Perret, Christoffer Dall,
	James Morse, Paolo Bonzini, Will Deacon, Julien Thierry,
	Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz
In-Reply-To: <621a0a92-6432-6c3e-cb69-0b601764fa69@samsung.com>

Hi Marek,

On 2020-02-20 12:44, Marek Szyprowski wrote:
> Hi Marc,
> 
> On 10.02.2020 15:13, Marc Zyngier wrote:
>> KVM/arm was merged just over 7 years ago, and has lived a very quiet
>> life so far. It mostly works if you're prepared to deal with its
>> limitations, it has been a good prototype for the arm64 version,
>> but it suffers a few problems:
>> 
>> - It is incomplete (no debug support, no PMU)
>> - It hasn't followed any of the architectural evolutions
>> - It has zero users (I don't count myself here)
>> - It is more and more getting in the way of new arm64 developments
> 
> That is a bit sad information. Mainline Exynos finally got everything
> that was needed to run it on the quite popular Samsung Exynos5422-based
> Odroid XU4/HC1/MC1 boards. According to the Odroid related forums it is
> being used. We also use it internally at Samsung.

Something like "too little, too late" springs to mind, but let's be
constructive. Is anyone using it in a production environment, where
they rely on the latest mainline kernel having KVM support?

The current proposal is to still have KVM support in 5.6, as well as
ongoing support for stable kernels. If that's not enough, can you please
explain your precise use case?

         M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply

* Re: switching ARC to 64-bit time_t (Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64)
From: Lukasz Majewski @ 2020-02-20 13:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Florian Weimer, Helmut Grohne, GNU C Library, Vineet Gupta,
	Palmer Dabbelt, Zong Li, debian-arm, Alistair Francis,
	Adhemerval Zanella, Maciej W. Rozycki, Alistair Francis, arcml,
	Joseph Myers
In-Reply-To: <CAK8P3a1nte0nGMw8_aeS__iJsTvsSGYYuKivAYBdiGH-GjVGew@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4466 bytes --]

Hi Arnd,

> On Thu, Feb 20, 2020 at 10:37 AM Lukasz Majewski <lukma@denx.de>
> wrote:
> > > On Thu, Feb 20, 2020 at 12:11 AM Lukasz Majewski <lukma@denx.de>
> > >
> > > Would it be possible to take a snapshot of your glibc tree  
> >
> > The description of the status of Y2038 supporting glibc on ARM 32
> > can be found here [1].
> >
> > The most recent patches for Y2038 supporting glibc can be always
> > found in the 'y2038_edge' branch [2].  
> 
> Ok.
> 
> > > and start testing this out with debian-rebootstrap [1]?  
> >
> > I've been using OE/Yocto for testing as it allows building glibc
> > sources for x86_64, x86, x86-x32, arm32 (probably also for ppc32 and
> > mips - but not tested).
> >...
> > However, I did not yet tried debian-rebootstrap. I will look if this
> > can be reused as well.  
> 
> The reason I'm asking about debian-rebootstrap is less about testing
> glibc itself than about testing the rest of user space to figure out
> better what needs to be done when rebuilding with _TIME_BITS=64, and
> to start fixing more upstream packages, with the hope of having enough
> of it done in time for the Debian 11 release.

Ok. I see. Thanks for the information.

Validating the packages was one of the reasons to move from some custom
made test images/setup to Yocto/OE (as it is very close to customers
needs).

> 
> > > Are there any glibc issues that prevent it from working
> > > correctly,  
> >
> > I think that the glibc wrappers for most important syscalls are now
> > converted.
> >
> > What is missing:
> >
> > - NTPL (threads)
> > - stat  
> 
> Do you mean that code using these will fail to work correctly with
> -D_TIME_BITS=64 at the moment, or that the interfaces are there
> but they are not y2038 safe? 

For ARM32 (branch [2]):

- Without -D_TIME_BITS=64 defined during compilation (as we do have
  now) the glibc is fully functional, but when you set date after
  03:14:08 UTC on 19.01.2038 you will see the date reset (to 1901) in
  the user space programs (after calling e.g. 'date').

- With -D_TIME_BITS=64 set during compilation - and using branch [2] -
  syscalls listed in [1] will provide correct date after Y2038 32 bit
  overflow. Other (i.e. not converted ones) will use overflow date (1901
  year). The glibc will also be fully functional up till Y2038 overflow.

> Without pthreads or stat, we probably
> wouldn't get too far in rebootstrap, but if the interfaces are there
> and mostly work, then we don't need to rely on them being
> y2038-safe just yet.

According to my above statement the second assumption is correct.

> An obvious next step would be to run the
> resulting code with the RTC set 20 years ahead, and that requires
> it all to work.

Yes. This is what I do for the test setup [3]. I do use
clock_settime syscall (now it is working correctly) or just 'date'
from user space.

> 
> > - In-glibc test coverage when -D_TIME_BITS=64 is used. I do have
> >   some basic tests [4], but this may be not enough.  
> 
> This is probably something where debian-rebootstrap could help,
> as building and testing more user space packages will excercise
> additional code paths in glibc as well. 

Yes this _could_ help. Do you have any tutorial/howto similar to one
from [4]?

I also think that some tests from debian-rebootstrap could be moved to
glibc test framework (test suite). For example tests for
clock_settime/gettime/nanosleep/ etc. In that way the
glibc-many-build.py would run those tests for all supported ports.

Then the debian-rebootstrap could test for more sophisticated bugs
(like dependencies between syscalls, etc).

> There is also some work
> in Linaro to ensure that LTP tests the low-level syscall interfaces
> in both the time32 and time64 variants.

Interesting. Is this work now publicly available?


> 
>       Arnd

Links: 

[1] -
https://github.com/lmajewski/y2038_glibc/commit/4f72f695d1ac428fe945cd7d5e95770180d4a7c1
[2] - https://github.com/lmajewski/y2038_glibc/commits/y2038_edge
[3] - https://github.com/lmajewski/y2038-tests
[4] - https://github.com/lmajewski/meta-y2038/blob/master/README

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply

* Re: [PATCH 08/15] nios2: Use Linux kABI for syscall return
From: Adhemerval Zanella @ 2020-02-20 13:14 UTC (permalink / raw)
  To: Vineet Gupta, libc-alpha@sourceware.org; +Cc: arcml
In-Reply-To: <10265c86-aba3-12f9-9208-4a4c6ad31d28@synopsys.com>



On 19/02/2020 18:40, Vineet Gupta wrote:
> On 2/10/20 11:20 AM, Adhemerval Zanella wrote:
>> It changes the nios INTERNAL_SYSCALL_RAW macro to return a negative
>> value instead of 'r2' register value on 'err' macro argument.
>>
>> The macro INTERNAL_SYSCALL_DECL is no longer required, and the
>> INTERNAL_SYSCALL_ERROR_P follows the other Linux kABIS.
>>
>> Checked with a build against nios2-linux-gnu.
>> ---
>>  sysdeps/unix/sysv/linux/nios2/sysdep.h | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h
>> index b02730bd23..eab888df32 100644
>> --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h
>> +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h
>> @@ -157,13 +157,14 @@
>>       (int) result_var; })
>>  
>>  #undef INTERNAL_SYSCALL_DECL
>> -#define INTERNAL_SYSCALL_DECL(err) unsigned int err __attribute__((unused))
>> +#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
>>  
>>  #undef INTERNAL_SYSCALL_ERROR_P
>> -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (unsigned int) (err))
>> +#define INTERNAL_SYSCALL_ERROR_P(val, err) \
>> +  ((unsigned long) (val) >= (unsigned long) -4095)
>>  
>>  #undef INTERNAL_SYSCALL_ERRNO
>> -#define INTERNAL_SYSCALL_ERRNO(val, err)   ((void) (err), val)
>> +#define INTERNAL_SYSCALL_ERRNO(val, err)     (-(val))
>>  
>>  #undef INTERNAL_SYSCALL_RAW
>>  #define INTERNAL_SYSCALL_RAW(name, err, nr, args...)            \
>> @@ -180,8 +181,7 @@
>>                       : "+r" (_r2), "=r" (_err)                  \
>>                       : ASM_ARGS_##nr				\
>>                       : __SYSCALL_CLOBBERS);                     \
>> -       _sys_result = _r2;                                       \
>> -       err = _err;                                              \
>> +       _sys_result = _err != 0 ? -_r2 : -_r2;                   \
> 
> Is there a typo here ? both cases seem to be -ve

It is, thanks for catching it. I have pushed b790c8c2ed to fix and
double checked nios2 syscall handling (arch/nios2/kernel/entry.S:205)
to certify that the modification does follow nios2 kABI.

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply

* [PATCH v5 6/6] doc: board: add rockchip subfolder
From: Bin Meng @ 2020-02-20 13:14 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <20200212151433.9713-7-igor.opaniuk@gmail.com>

On Wed, Feb 12, 2020 at 11:14 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> This fixes a warning when invoking make htmldocs:
> checking consistency...
> doc/board/rockchip/index.rst: WARNING: document isn't included in any toctree
>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>
>  doc/board/index.rst | 1 +
>  1 file changed, 1 insertion(+)
>

This patch does not apply as there is one already in the mainline.
Heinrich did the same below, but not sure how he gave a RB tag to this
one as well :)

Will drop this patch.

commit 7d92204bc0eb0a775810f887838a93a218a22f96
Author: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date:   Fri Feb 7 21:25:09 2020 +0100

    doc: board: add Rockchip to doc/board/index.rst

    Fix a build error

Regards,
Bin

^ permalink raw reply

* [PATCH v3 13/20] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument
From: Philippe Mathieu-Daudé @ 2020-02-20 13:05 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, kvm, Michael S. Tsirkin, Jason Wang,
	Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	Matthew Rosato, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Anthony Perard,
	xen-devel, Aleksandar Rikalo, Richard Henderson,
	Philippe Mathieu-Daudé, Laurent Vivier, Thomas Huth,
	Eduardo Habkost, Stefan Weil, Alistair Francis, Richard Henderson,
	Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, David Gibson, Igor Mitsyanko,
	Cornelia Huck, Michael Walle, qemu-ppc, Paolo Bonzini
In-Reply-To: <20200220130548.29974-1-philmd@redhat.com>

The 'is_write' argument is either 0 or 1.
Convert it to a boolean type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/virtio/virtio.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 2c5410e981..9d06dbe3ef 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1293,7 +1293,7 @@ static void virtqueue_undo_map_desc(unsigned int out_num, unsigned int in_num,
 
 static void virtqueue_map_iovec(VirtIODevice *vdev, struct iovec *sg,
                                 hwaddr *addr, unsigned int num_sg,
-                                int is_write)
+                                bool is_write)
 {
     unsigned int i;
     hwaddr len;
@@ -1317,8 +1317,9 @@ static void virtqueue_map_iovec(VirtIODevice *vdev, struct iovec *sg,
 
 void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem)
 {
-    virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, elem->in_num, 1);
-    virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, elem->out_num, 0);
+    virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, elem->in_num, true);
+    virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, elem->out_num,
+                                                                        false);
 }
 
 static void *virtqueue_alloc_element(size_t sz, unsigned out_num, unsigned in_num)
-- 
2.21.1



^ permalink raw reply related

* Re: [Xen-devel] [PATCH v3 01/20] scripts/git.orderfile: Display Cocci scripts before code modifications
From: Laurent Vivier @ 2020-02-20 13:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, kvm, Michael S. Tsirkin, Jason Wang,
	Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	Matthew Rosato, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Marcel Apfelbaum,
	Anthony Perard, xen-devel, Aleksandar Rikalo, Richard Henderson,
	Thomas Huth, Eduardo Habkost, Stefan Weil, Alistair Francis,
	Richard Henderson, Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, David Gibson, Igor Mitsyanko,
	Cornelia Huck, Michael Walle, qemu-ppc, Paolo Bonzini
In-Reply-To: <20200220130548.29974-2-philmd@redhat.com>

On 20/02/2020 14:05, Philippe Mathieu-Daudé wrote:
> When we use a Coccinelle semantic script to do automatic
> code modifications, it makes sense to look at the semantic
> patch first.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  scripts/git.orderfile | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/git.orderfile b/scripts/git.orderfile
> index 1f747b583a..7cf22e0bf5 100644
> --- a/scripts/git.orderfile
> +++ b/scripts/git.orderfile
> @@ -22,6 +22,9 @@ Makefile*
>  qapi/*.json
>  qga/*.json
>  
> +# semantic patches
> +*.cocci
> +
>  # headers
>  *.h
>  
> 

Reviewed-by: Laurent Vivier <lvivier@redhat.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply

* [PATCH v3 07/20] hw/net: Avoid casting non-const pointer, use address_space_write()
From: Philippe Mathieu-Daudé @ 2020-02-20 13:05 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, kvm, Michael S. Tsirkin, Jason Wang,
	Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	Matthew Rosato, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Anthony Perard,
	xen-devel, Aleksandar Rikalo, Richard Henderson,
	Philippe Mathieu-Daudé, Laurent Vivier, Thomas Huth,
	Eduardo Habkost, Stefan Weil, Alistair Francis, Richard Henderson,
	Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, David Gibson, Igor Mitsyanko,
	Cornelia Huck, Michael Walle, qemu-ppc, Paolo Bonzini
In-Reply-To: <20200220130548.29974-1-philmd@redhat.com>

The NetReceive prototype gets a const buffer:

  typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);

We already have the address_space_write() method to write a const
buffer to an address space. Use it to avoid:

  hw/net/i82596.c: In function ‘i82596_receive’:
  hw/net/i82596.c:644:54: error: passing argument 4 of ‘address_space_rw’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]

This commit was produced with the included Coccinelle script
scripts/coccinelle/exec_rw_const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 scripts/coccinelle/exec_rw_const.cocci | 14 ++++++++++++++
 hw/net/dp8393x.c                       |  3 +--
 hw/net/i82596.c                        |  4 ++--
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/scripts/coccinelle/exec_rw_const.cocci b/scripts/coccinelle/exec_rw_const.cocci
index a0054f009d..4e459d915b 100644
--- a/scripts/coccinelle/exec_rw_const.cocci
+++ b/scripts/coccinelle/exec_rw_const.cocci
@@ -1,6 +1,20 @@
 // Usage:
 //  spatch --sp-file scripts/coccinelle/exec_rw_const.cocci --dir . --in-place
 
+// Use address_space_write instead of casting to non-const
+@@
+type T;
+const T *V;
+expression E1, E2, E3, E4;
+@@
+(
+- address_space_rw(E1, E2, E3, (T *)V, E4, 1)
++ address_space_write(E1, E2, E3, V, E4)
+|
+- address_space_rw(E1, E2, E3, (void *)V, E4, 1)
++ address_space_write(E1, E2, E3, V, E4)
+)
+
 // Remove useless cast
 @@
 expression E1, E2, E3, E4;
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index a134d431ae..580ae4437e 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -787,8 +787,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, const uint8_t * buf,
     /* Put packet into RBA */
     DPRINTF("Receive packet at %08x\n", dp8393x_crba(s));
     address = dp8393x_crba(s);
-    address_space_rw(&s->as, address,
-        MEMTXATTRS_UNSPECIFIED, (uint8_t *)buf, rx_len, 1);
+    address_space_write(&s->as, address, MEMTXATTRS_UNSPECIFIED, buf, rx_len);
     address += rx_len;
     address_space_rw(&s->as, address,
         MEMTXATTRS_UNSPECIFIED, (uint8_t *)&checksum, 4, 1);
diff --git a/hw/net/i82596.c b/hw/net/i82596.c
index 3a0e1ec4c0..a292984e06 100644
--- a/hw/net/i82596.c
+++ b/hw/net/i82596.c
@@ -640,8 +640,8 @@ ssize_t i82596_receive(NetClientState *nc, const uint8_t *buf, size_t sz)
             }
             rba = get_uint32(rbd + 8);
             /* printf("rba is 0x%x\n", rba); */
-            address_space_rw(&address_space_memory, rba,
-                MEMTXATTRS_UNSPECIFIED, (void *)buf, num, 1);
+            address_space_write(&address_space_memory, rba,
+                                MEMTXATTRS_UNSPECIFIED, buf, num);
             rba += num;
             buf += num;
             len -= num;
-- 
2.21.1



^ permalink raw reply related

* Re: [Intel-gfx] [PATCH v17 3/7] drm/i915: Init obj state in intel_atomic_get_old/new_global_obj_state
From: Lisovskiy, Stanislav @ 2020-02-20 13:14 UTC (permalink / raw)
  To: intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com
In-Reply-To: <87tv3ltos4.fsf@intel.com>

On Thu, 2020-02-20 at 14:40 +0200, Jani Nikula wrote:
> On Thu, 20 Feb 2020, Stanislav Lisovskiy <
> stanislav.lisovskiy@intel.com> wrote:
> > We might be willing to call intel_atomic_get_old_global_obj_state
> > and intel_atomic_get_new_global_obj_state right away, however
> > those are not initializing global obj state as
> > intel_atomic_get_global_obj_state does.
> > Extracted initializing part to separate function and now using this
> > also in intel_atomic_get_old_global_obj_state and
> > intel_atomic_get_new_global_obj_state
> > 
> > v2: - Fixed typo in function call
> > 
> > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_bw.c | 28
> > ++++++++++++++++++++++++-
> >  drivers/gpu/drm/i915/display/intel_bw.h |  9 ++++++++
> >  2 files changed, 36 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_bw.c
> > b/drivers/gpu/drm/i915/display/intel_bw.c
> > index 58b264bc318d..ff57277e8880 100644
> > --- a/drivers/gpu/drm/i915/display/intel_bw.c
> > +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> > @@ -374,7 +374,33 @@ static unsigned int intel_bw_data_rate(struct
> > drm_i915_private *dev_priv,
> >  	return data_rate;
> >  }
> >  
> > -static struct intel_bw_state *
> > +struct intel_bw_state *
> > +intel_atomic_get_old_bw_state(struct intel_atomic_state *state)
> > +{
> > +	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> > +	struct intel_global_state *bw_state;
> > +
> > +	bw_state = intel_atomic_get_old_global_obj_state(state,
> > &dev_priv->bw_obj);
> > +	if (IS_ERR(bw_state))
> > +		return ERR_CAST(bw_state);
> > +
> > +	return to_intel_bw_state(bw_state);
> > +}
> > +
> > +struct intel_bw_state *
> > +intel_atomic_get_new_bw_state(struct intel_atomic_state *state)
> > +{
> > +	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> > +	struct intel_global_state *bw_state;
> > +	bw_state = intel_atomic_get_new_global_obj_state(state,
> > &dev_priv->bw_obj);
> > +
> > +	if (IS_ERR(bw_state))
> > +		return ERR_CAST(bw_state);
> > +
> > +	return to_intel_bw_state(bw_state);
> > +}
> > +
> > +struct intel_bw_state *
> >  intel_atomic_get_bw_state(struct intel_atomic_state *state)
> >  {
> >  	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> > diff --git a/drivers/gpu/drm/i915/display/intel_bw.h
> > b/drivers/gpu/drm/i915/display/intel_bw.h
> > index a8aa7624c5aa..ac004d6f4276 100644
> > --- a/drivers/gpu/drm/i915/display/intel_bw.h
> > +++ b/drivers/gpu/drm/i915/display/intel_bw.h
> > @@ -24,6 +24,15 @@ struct intel_bw_state {
> >  
> >  #define to_intel_bw_state(x) container_of((x), struct
> > intel_bw_state, base)
> >  
> > +struct intel_bw_state *
> > +intel_atomic_get_old_bw_state(struct intel_atomic_state *state);
> > +
> > +struct intel_bw_state *
> > +intel_atomic_get_new_bw_state(struct intel_atomic_state *state);
> > +
> > +struct intel_bw_state *
> > +intel_atomic_get_bw_state(struct intel_atomic_state *state);
> > +
> 
> I'm trying to promote a convention that a module foo_bar.[ch] would
> export functions prefixed foo_bar_. Here, intel_bw_* like below.

I'm fine with that. However most of the functions in this file have
intel_atomic_* prefix, so if I now follow this convention it won't be
consistent with current naming in the file.

Anyway if this is now mandatory, will change it. Just will wait now
first if CI doesn't blow up with this series, as I haven't rebased it
for a while..

Stan

> 
> BR,
> Jani.
> 
> 
> >  void intel_bw_init_hw(struct drm_i915_private *dev_priv);
> >  int intel_bw_init(struct drm_i915_private *dev_priv);
> >  int intel_bw_atomic_check(struct intel_atomic_state *state);
> 
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* Re: [for-next][PATCH 12/26] Documentation: bootconfig: Add a doc for extended boot config
From: Masami Hiramatsu @ 2020-02-20 13:13 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Steven Rostedt, linux-doc, linux-fsdevel, kernel-janitors,
	linux-kernel, Alexey Dobriyan, Andrew Morton,
	Arnaldo Carvalho de Melo, Frank Rowand, Greg Kroah-Hartman,
	Ingo Molnar, Jiri Olsa, Jonathan Corbet, Linus Torvalds,
	Namhyung Kim, Randy Dunlap, Rob Herring, Thomas Gleixner,
	Tim Bird, Tom Zanussi
In-Reply-To: <23e371ca-5df8-3ae3-c685-b01c07b55540@web.de>

Hi,

On Thu, 20 Feb 2020 10:10:20 +0100
Markus Elfring <Markus.Elfring@web.de> wrote:

> I wonder about a few details in the added text.
> 
> 
> …
> > +++ b/Documentation/admin-guide/bootconfig.rst
> …
> > +C onfig File Limitation
> 
> How do you think about to omit a space character at the beginning
> of this line?

That was my mistake. I used restructured text extension for vim
which collapsed all sections and use "space" key to expand.
Accidentally, I run into edit mode and hit "space" to expand it.
(it actually expanded but also put a space there and I missed it...)

Anyway, it has been fixed (pointed by Rundy)

> > +Currently the maximum config size size is 32KB …
> 
> Would you like to avoid a word duplication here?

Oops, still exist. Thanks!


> > +Note: this is not the number of entries but nodes, an entry must consume
> > +more than 2 nodes (a key-word and a value). …
> 
> I find the relevance of the term “nodes” unclear at the moment.

Indeed, "node" is not well defined. What about this?
---
Each key consists of words separated by dot, and value also consists of
values separated by comma. Here, each word and each value is generally
called a "node".
---

> 
> Could an other wording be nicer than the abbreviation “a doc for … config”
> in the commit subject?

OK, I'll try next time. 

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply

* [LTP] [PATCH v2] syscalls/quotactl07: add regresstion test for Q_XQTUOTARM
From: Xiao Yang @ 2020-02-20 13:13 UTC (permalink / raw)
  To: ltp
In-Reply-To: <1575526664-25738-1-git-send-email-xuyang2018.jy@cn.fujitsu.com>

Hi Cyril,

Thank you for pushing it.
Sorry, forgot to review and push the v2 patch.

Thanks,
Xiao Yang
On 2019/12/5 14:17, Yang Xu wrote:
> This is a regresstion test to check Q_XQUOTARM  whether has
> quota flags check.
>
> Signed-off-by: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
>
> ---------------------
> 1.Simplify test code
> 2.add comment for invalid_type,
> ---------------------
> ---
>   include/lapi/quotactl.h                       |  4 ++
>   runtest/syscalls                              |  1 +
>   testcases/kernel/syscalls/quotactl/.gitignore |  1 +
>   .../kernel/syscalls/quotactl/quotactl07.c     | 71 +++++++++++++++++++
>   4 files changed, 77 insertions(+)
>   create mode 100644 testcases/kernel/syscalls/quotactl/quotactl07.c
>
> diff --git a/include/lapi/quotactl.h b/include/lapi/quotactl.h
> index d3223b863..c1ec9d6e1 100644
> --- a/include/lapi/quotactl.h
> +++ b/include/lapi/quotactl.h
> @@ -59,6 +59,10 @@ struct fs_quota_statv {
>   # define PRJQUOTA 2
>   #endif
>
> +#ifndef Q_XQUOTARM
> +# define Q_XQUOTARM XQM_CMD(6)
> +#endif
> +
>   #ifndef Q_XGETQSTATV
>   # define Q_XGETQSTATV XQM_CMD(8)
>   #endif
> diff --git a/runtest/syscalls b/runtest/syscalls
> index 15dbd9971..0f75cf3f6 100644
> --- a/runtest/syscalls
> +++ b/runtest/syscalls
> @@ -958,6 +958,7 @@ quotactl03 quotactl03
>   quotactl04 quotactl04
>   quotactl05 quotactl05
>   quotactl06 quotactl06
> +quotactl07 quotactl07
>
>   read01 read01
>   read02 read02
> diff --git a/testcases/kernel/syscalls/quotactl/.gitignore b/testcases/kernel/syscalls/quotactl/.gitignore
> index 12896d6ad..8d2ef94d9 100644
> --- a/testcases/kernel/syscalls/quotactl/.gitignore
> +++ b/testcases/kernel/syscalls/quotactl/.gitignore
> @@ -4,3 +4,4 @@
>   /quotactl04
>   /quotactl05
>   /quotactl06
> +/quotactl07
> diff --git a/testcases/kernel/syscalls/quotactl/quotactl07.c b/testcases/kernel/syscalls/quotactl/quotactl07.c
> new file mode 100644
> index 000000000..cd9f629ea
> --- /dev/null
> +++ b/testcases/kernel/syscalls/quotactl/quotactl07.c
> @@ -0,0 +1,71 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
> + * Author: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
> + *
> + * This is a regresstion test for kernel commit 3dd4d40b4208
> + * ("xfs: Sanity check flags of Q_XQUOTARM call").
> + */
> +
> +#include "config.h"
> +#include<errno.h>
> +#include<unistd.h>
> +#include<stdio.h>
> +#include<sys/quota.h>
> +#include "lapi/quotactl.h"
> +#include "tst_test.h"
> +
> +#ifdef HAVE_XFS_XQM_H
> +# include<xfs/xqm.h>
> +
> +#define MNTPOINT    "mntpoint"
> +
> +static uint32_t qflag_acct = XFS_QUOTA_UDQ_ACCT;
> +static unsigned int valid_type = XFS_USER_QUOTA;
> +/*Include a valid quota type to avoid other EINVAL error*/
> +static unsigned int invalid_type = XFS_GROUP_QUOTA<<  1 | XFS_USER_QUOTA;
> +
> +static void verify_quota(void)
> +{
> +	TEST(quotactl(QCMD(Q_XQUOTARM, USRQUOTA), tst_device->dev, 0, (void *)&invalid_type));
> +	if (TST_ERR == EINVAL)
> +		tst_res(TPASS, "Q_XQUOTARM has quota type check");
> +	else
> +		tst_res(TFAIL, "Q_XQUOTARM doesn't have quota type check");
> +}
> +
> +static void setup(void)
> +{
> +	TEST(quotactl(QCMD(Q_XQUOTAOFF, USRQUOTA), tst_device->dev, 0, (void *)&qflag_acct));
> +	if (TST_RET == -1)
> +		tst_brk(TBROK | TTERRNO, "quotactl with Q_XQUOTAOFF failed");
> +
> +	TEST(quotactl(QCMD(Q_XQUOTARM, USRQUOTA), tst_device->dev, 0, (void *)&valid_type));
> +	if (TST_ERR == EINVAL) {
> +		tst_res(TCONF, "current system doesn't support Q_XQUOTARM, skip it");
> +		return;
> +	}
> +}
> +
> +static const char *kconfigs[] = {
> +	"CONFIG_XFS_QUOTA",
> +	NULL
> +};
> +
> +static struct tst_test test = {
> +	.setup = setup,
> +	.needs_root = 1,
> +	.needs_kconfigs = kconfigs,
> +	.test_all = verify_quota,
> +	.mount_device = 1,
> +	.dev_fs_type = "xfs",
> +	.mnt_data = "usrquota",
> +	.mntpoint = MNTPOINT,
> +	.tags = (const struct tst_tag[]) {
> +		{"linux-git", "3dd4d40b4208"},
> +		{}
> +	}
> +};
> +#else
> +	TST_TEST_TCONF("System doesn't have<xfs/xqm.h>");
> +#endif




^ permalink raw reply

* [PATCH v3 10/20] Remove unnecessary cast when using the cpu_[physical]_memory API
From: Philippe Mathieu-Daudé @ 2020-02-20 13:05 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, kvm, Michael S. Tsirkin, Jason Wang,
	Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	Matthew Rosato, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Anthony Perard,
	xen-devel, Aleksandar Rikalo, Richard Henderson,
	Philippe Mathieu-Daudé, Laurent Vivier, Thomas Huth,
	Eduardo Habkost, Stefan Weil, Alistair Francis, Richard Henderson,
	Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, David Gibson, Igor Mitsyanko,
	Cornelia Huck, Michael Walle, qemu-ppc, Paolo Bonzini
In-Reply-To: <20200220130548.29974-1-philmd@redhat.com>

This commit was produced with the included Coccinelle script
scripts/coccinelle/exec_rw_const.

Suggested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 scripts/coccinelle/exec_rw_const.cocci | 10 ++++++++++
 hw/display/omap_lcdc.c                 | 10 +++++-----
 hw/dma/etraxfs_dma.c                   | 25 ++++++++++---------------
 hw/scsi/vmw_pvscsi.c                   |  8 +++-----
 target/i386/hax-all.c                  |  6 +++---
 5 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/scripts/coccinelle/exec_rw_const.cocci b/scripts/coccinelle/exec_rw_const.cocci
index 5ed956a834..70cf52d58e 100644
--- a/scripts/coccinelle/exec_rw_const.cocci
+++ b/scripts/coccinelle/exec_rw_const.cocci
@@ -34,6 +34,16 @@ type T;
 + address_space_write_rom(E1, E2, E3, E4, E5)
 |
 
+- cpu_physical_memory_rw(E1, (T *)E2, E3, E4)
++ cpu_physical_memory_rw(E1, E2, E3, E4)
+|
+- cpu_physical_memory_read(E1, (T *)E2, E3)
++ cpu_physical_memory_read(E1, E2, E3)
+|
+- cpu_physical_memory_write(E1, (T *)E2, E3)
++ cpu_physical_memory_write(E1, E2, E3)
+|
+
 - dma_memory_read(E1, E2, (T *)E3, E4)
 + dma_memory_read(E1, E2, E3, E4)
 |
diff --git a/hw/display/omap_lcdc.c b/hw/display/omap_lcdc.c
index 6ad13f2e9e..fa4a381db6 100644
--- a/hw/display/omap_lcdc.c
+++ b/hw/display/omap_lcdc.c
@@ -91,9 +91,9 @@ static void omap_update_display(void *opaque)
 
     frame_offset = 0;
     if (omap_lcd->plm != 2) {
-        cpu_physical_memory_read(omap_lcd->dma->phys_framebuffer[
-                                  omap_lcd->dma->current_frame],
-                                 (void *)omap_lcd->palette, 0x200);
+        cpu_physical_memory_read(
+                omap_lcd->dma->phys_framebuffer[omap_lcd->dma->current_frame],
+                omap_lcd->palette, 0x200);
         switch (omap_lcd->palette[0] >> 12 & 7) {
         case 3 ... 7:
             frame_offset += 0x200;
@@ -244,8 +244,8 @@ static void omap_lcd_update(struct omap_lcd_panel_s *s) {
 
     if (s->plm != 2 && !s->palette_done) {
         cpu_physical_memory_read(
-            s->dma->phys_framebuffer[s->dma->current_frame],
-            (void *)s->palette, 0x200);
+                            s->dma->phys_framebuffer[s->dma->current_frame],
+                            s->palette, 0x200);
         s->palette_done = 1;
         omap_lcd_interrupts(s);
     }
diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c
index 47e1c6df12..c4334e87bf 100644
--- a/hw/dma/etraxfs_dma.c
+++ b/hw/dma/etraxfs_dma.c
@@ -225,9 +225,8 @@ static void channel_load_g(struct fs_dma_ctrl *ctrl, int c)
 	hwaddr addr = channel_reg(ctrl, c, RW_GROUP);
 
 	/* Load and decode. FIXME: handle endianness.  */
-	cpu_physical_memory_read (addr, 
-				  (void *) &ctrl->channels[c].current_g, 
-				  sizeof ctrl->channels[c].current_g);
+    cpu_physical_memory_read(addr, &ctrl->channels[c].current_g,
+                             sizeof(ctrl->channels[c].current_g));
 }
 
 static void dump_c(int ch, struct dma_descr_context *c)
@@ -257,9 +256,8 @@ static void channel_load_c(struct fs_dma_ctrl *ctrl, int c)
 	hwaddr addr = channel_reg(ctrl, c, RW_GROUP_DOWN);
 
 	/* Load and decode. FIXME: handle endianness.  */
-	cpu_physical_memory_read (addr, 
-				  (void *) &ctrl->channels[c].current_c, 
-				  sizeof ctrl->channels[c].current_c);
+    cpu_physical_memory_read(addr, &ctrl->channels[c].current_c,
+                             sizeof(ctrl->channels[c].current_c));
 
 	D(dump_c(c, &ctrl->channels[c].current_c));
 	/* I guess this should update the current pos.  */
@@ -275,9 +273,8 @@ static void channel_load_d(struct fs_dma_ctrl *ctrl, int c)
 
 	/* Load and decode. FIXME: handle endianness.  */
 	D(printf("%s ch=%d addr=" TARGET_FMT_plx "\n", __func__, c, addr));
-	cpu_physical_memory_read (addr,
-				  (void *) &ctrl->channels[c].current_d, 
-				  sizeof ctrl->channels[c].current_d);
+    cpu_physical_memory_read(addr, &ctrl->channels[c].current_d,
+                             sizeof(ctrl->channels[c].current_d));
 
 	D(dump_d(c, &ctrl->channels[c].current_d));
 	ctrl->channels[c].regs[RW_DATA] = addr;
@@ -290,9 +287,8 @@ static void channel_store_c(struct fs_dma_ctrl *ctrl, int c)
 	/* Encode and store. FIXME: handle endianness.  */
 	D(printf("%s ch=%d addr=" TARGET_FMT_plx "\n", __func__, c, addr));
 	D(dump_d(c, &ctrl->channels[c].current_d));
-	cpu_physical_memory_write (addr,
-				  (void *) &ctrl->channels[c].current_c,
-				  sizeof ctrl->channels[c].current_c);
+    cpu_physical_memory_write(addr, &ctrl->channels[c].current_c,
+                              sizeof(ctrl->channels[c].current_c));
 }
 
 static void channel_store_d(struct fs_dma_ctrl *ctrl, int c)
@@ -301,9 +297,8 @@ static void channel_store_d(struct fs_dma_ctrl *ctrl, int c)
 
 	/* Encode and store. FIXME: handle endianness.  */
 	D(printf("%s ch=%d addr=" TARGET_FMT_plx "\n", __func__, c, addr));
-	cpu_physical_memory_write (addr,
-				  (void *) &ctrl->channels[c].current_d, 
-				  sizeof ctrl->channels[c].current_d);
+    cpu_physical_memory_write(addr, &ctrl->channels[c].current_d,
+                              sizeof(ctrl->channels[c].current_d));
 }
 
 static inline void channel_stop(struct fs_dma_ctrl *ctrl, int c)
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index e4ee2e6643..c91352cf46 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -404,8 +404,7 @@ pvscsi_cmp_ring_put(PVSCSIState *s, struct PVSCSIRingCmpDesc *cmp_desc)
 
     cmp_descr_pa = pvscsi_ring_pop_cmp_descr(&s->rings);
     trace_pvscsi_cmp_ring_put(cmp_descr_pa);
-    cpu_physical_memory_write(cmp_descr_pa, (void *)cmp_desc,
-                              sizeof(*cmp_desc));
+    cpu_physical_memory_write(cmp_descr_pa, cmp_desc, sizeof(*cmp_desc));
 }
 
 static void
@@ -415,8 +414,7 @@ pvscsi_msg_ring_put(PVSCSIState *s, struct PVSCSIRingMsgDesc *msg_desc)
 
     msg_descr_pa = pvscsi_ring_pop_msg_descr(&s->rings);
     trace_pvscsi_msg_ring_put(msg_descr_pa);
-    cpu_physical_memory_write(msg_descr_pa, (void *)msg_desc,
-                              sizeof(*msg_desc));
+    cpu_physical_memory_write(msg_descr_pa, msg_desc, sizeof(*msg_desc));
 }
 
 static void
@@ -491,7 +489,7 @@ pvscsi_get_next_sg_elem(PVSCSISGState *sg)
 {
     struct PVSCSISGElement elem;
 
-    cpu_physical_memory_read(sg->elemAddr, (void *)&elem, sizeof(elem));
+    cpu_physical_memory_read(sg->elemAddr, &elem, sizeof(elem));
     if ((elem.flags & ~PVSCSI_KNOWN_FLAGS) != 0) {
         /*
             * There is PVSCSI_SGE_FLAG_CHAIN_ELEMENT flag described in
diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c
index a8b6e5aeb8..a9cc51e6ce 100644
--- a/target/i386/hax-all.c
+++ b/target/i386/hax-all.c
@@ -367,7 +367,7 @@ static int hax_accel_init(MachineState *ms)
 static int hax_handle_fastmmio(CPUArchState *env, struct hax_fastmmio *hft)
 {
     if (hft->direction < 2) {
-        cpu_physical_memory_rw(hft->gpa, (uint8_t *) &hft->value, hft->size,
+        cpu_physical_memory_rw(hft->gpa, &hft->value, hft->size,
                                hft->direction);
     } else {
         /*
@@ -376,8 +376,8 @@ static int hax_handle_fastmmio(CPUArchState *env, struct hax_fastmmio *hft)
          *  hft->direction == 2: gpa ==> gpa2
          */
         uint64_t value;
-        cpu_physical_memory_rw(hft->gpa, (uint8_t *) &value, hft->size, 0);
-        cpu_physical_memory_rw(hft->gpa2, (uint8_t *) &value, hft->size, 1);
+        cpu_physical_memory_rw(hft->gpa, &value, hft->size, 0);
+        cpu_physical_memory_rw(hft->gpa2, &value, hft->size, 1);
     }
 
     return 0;
-- 
2.21.1



^ permalink raw reply related

* Re: [Xen-devel] [PATCH v3 01/20] scripts/git.orderfile: Display Cocci scripts before code modifications
From: Eric Blake @ 2020-02-20 13:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, Matthew Rosato, Michael S. Tsirkin,
	Jason Wang, Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	kvm, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Anthony Perard,
	xen-devel, Aleksandar Rikalo, David Gibson, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Stefan Weil, Alistair Francis,
	Richard Henderson, Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, Richard Henderson,
	Igor Mitsyanko, Cornelia Huck, Michael Walle, qemu-ppc,
	Paolo Bonzini
In-Reply-To: <20200220130548.29974-2-philmd@redhat.com>

On 2/20/20 7:05 AM, Philippe Mathieu-Daudé wrote:
> When we use a Coccinelle semantic script to do automatic
> code modifications, it makes sense to look at the semantic
> patch first.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   scripts/git.orderfile | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/scripts/git.orderfile b/scripts/git.orderfile
> index 1f747b583a..7cf22e0bf5 100644
> --- a/scripts/git.orderfile
> +++ b/scripts/git.orderfile
> @@ -22,6 +22,9 @@ Makefile*
>   qapi/*.json
>   qga/*.json
>   
> +# semantic patches
> +*.cocci
> +
>   # headers
>   *.h
>   
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply

* Re: [for-next][PATCH 12/26] Documentation: bootconfig: Add a doc for extended boot config
From: Masami Hiramatsu @ 2020-02-20 13:13 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Steven Rostedt, linux-doc, linux-fsdevel, kernel-janitors,
	linux-kernel, Alexey Dobriyan, Andrew Morton,
	Arnaldo Carvalho de Melo, Frank Rowand, Greg Kroah-Hartman,
	Ingo Molnar, Jiri Olsa, Jonathan Corbet, Linus Torvalds,
	Namhyung Kim, Randy Dunlap, Rob Herring, Thomas Gleixner,
	Tim Bird, Tom Zanussi
In-Reply-To: <23e371ca-5df8-3ae3-c685-b01c07b55540@web.de>

Hi,

On Thu, 20 Feb 2020 10:10:20 +0100
Markus Elfring <Markus.Elfring@web.de> wrote:

> I wonder about a few details in the added text.
> 
> 
> …
> > +++ b/Documentation/admin-guide/bootconfig.rst
> …
> > +C onfig File Limitation
> 
> How do you think about to omit a space character at the beginning
> of this line?

That was my mistake. I used restructured text extension for vim
which collapsed all sections and use "space" key to expand.
Accidentally, I run into edit mode and hit "space" to expand it.
(it actually expanded but also put a space there and I missed it...)

Anyway, it has been fixed (pointed by Rundy)

> > +Currently the maximum config size size is 32KB …
> 
> Would you like to avoid a word duplication here?

Oops, still exist. Thanks!


> > +Note: this is not the number of entries but nodes, an entry must consume
> > +more than 2 nodes (a key-word and a value). …
> 
> I find the relevance of the term “nodes” unclear at the moment.

Indeed, "node" is not well defined. What about this?
---
Each key consists of words separated by dot, and value also consists of
values separated by comma. Here, each word and each value is generally
called a "node".
---

> 
> Could an other wording be nicer than the abbreviation “a doc for … config”
> in the commit subject?

OK, I'll try next time. 

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply

* Re: [PATCH v3 01/20] scripts/git.orderfile: Display Cocci scripts before code modifications
From: Eric Blake @ 2020-02-20 13:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, kvm, Michael S. Tsirkin, Jason Wang,
	Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	Matthew Rosato, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Anthony Perard,
	xen-devel, Aleksandar Rikalo, Richard Henderson, Laurent Vivier,
	Thomas Huth, Eduardo Habkost, Stefan Weil, Alistair Francis,
	Richard Henderson, Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, David Gibson, Igor Mitsyanko,
	Cornelia Huck, Michael Walle, qemu-ppc, Paolo Bonzini
In-Reply-To: <20200220130548.29974-2-philmd@redhat.com>

On 2/20/20 7:05 AM, Philippe Mathieu-Daudé wrote:
> When we use a Coccinelle semantic script to do automatic
> code modifications, it makes sense to look at the semantic
> patch first.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   scripts/git.orderfile | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/scripts/git.orderfile b/scripts/git.orderfile
> index 1f747b583a..7cf22e0bf5 100644
> --- a/scripts/git.orderfile
> +++ b/scripts/git.orderfile
> @@ -22,6 +22,9 @@ Makefile*
>   qapi/*.json
>   qga/*.json
>   
> +# semantic patches
> +*.cocci
> +
>   # headers
>   *.h
>   
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply

* Re: [PATCH] mm: Fix possible PMD dirty bit lost in set_pmd_migration_entry()
From: Kirill A. Shutemov @ 2020-02-20 13:13 UTC (permalink / raw)
  To: Huang, Ying
  Cc: Andrew Morton, linux-mm, linux-kernel, Zi Yan,
	Kirill A . Shutemov, Andrea Arcangeli, Michal Hocko,
	Vlastimil Babka
In-Reply-To: <20200220075220.2327056-1-ying.huang@intel.com>

On Thu, Feb 20, 2020 at 03:52:20PM +0800, Huang, Ying wrote:
> From: Huang Ying <ying.huang@intel.com>
> 
> In set_pmd_migration_entry(), pmdp_invalidate() is used to change PMD
> atomically.  But the PMD is read before that with an ordinary memory
> reading.  If the THP (transparent huge page) is written between the
> PMD reading and pmdp_invalidate(), the PMD dirty bit may be lost, and
> cause data corruption.  The race window is quite small, but still
> possible in theory, so need to be fixed.
> 
> The race is fixed via using the return value of pmdp_invalidate() to
> get the original content of PMD, which is a read/modify/write atomic
> operation.  So no THP writing can occur in between.
> 
> The race has been introduced when the THP migration support is added
> in the commit 616b8371539a ("mm: thp: enable thp migration in generic
> path").  But this fix depends on the commit d52605d7cb30 ("mm: do not
> lose dirty and accessed bits in pmdp_invalidate()").  So it's easy to
> be backported after v4.16.  But the race window is really small, so it
> may be fine not to backport the fix at all.
> 
> Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
> Cc: Zi Yan <ziy@nvidia.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Vlastimil Babka <vbabka@suse.cz>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov


^ permalink raw reply

* [PATCH v3 11/20] hw/ide/internal: Remove unused DMARestartFunc typedef
From: Philippe Mathieu-Daudé @ 2020-02-20 13:05 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Fam Zheng, Dmitry Fleytman, kvm, Michael S. Tsirkin, Jason Wang,
	Gerd Hoffmann, Edgar E. Iglesias, Stefano Stabellini,
	Matthew Rosato, qemu-block, David Hildenbrand, Halil Pasic,
	Christian Borntraeger, Hervé Poussineau, Anthony Perard,
	xen-devel, Aleksandar Rikalo, Richard Henderson,
	Philippe Mathieu-Daudé, Laurent Vivier, Thomas Huth,
	Eduardo Habkost, Stefan Weil, Alistair Francis, Richard Henderson,
	Paul Durrant, Eric Auger, qemu-s390x, qemu-arm,
	Cédric Le Goater, John Snow, David Gibson, Igor Mitsyanko,
	Cornelia Huck, Michael Walle, qemu-ppc, Paolo Bonzini
In-Reply-To: <20200220130548.29974-1-philmd@redhat.com>

The IDE DMA restart callback has been removed in commit fe09c7c9f0.

Fixes: fe09c7c9f0
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/ide/internal.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 52ec197da0..ce766ac485 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -326,7 +326,6 @@ typedef int DMAIntFunc(IDEDMA *, int);
 typedef int32_t DMAInt32Func(IDEDMA *, int32_t len);
 typedef void DMAu32Func(IDEDMA *, uint32_t);
 typedef void DMAStopFunc(IDEDMA *, bool);
-typedef void DMARestartFunc(void *, int, RunState);
 
 struct unreported_events {
     bool eject_request;
-- 
2.21.1



^ permalink raw reply related

* [igt-dev] [PATCH i-g-t] tools/i915-perf: Fix compiler warning
From: Petri Latvala @ 2020-02-20 13:12 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Use flexible array member in the first struct instead of two structs
and a 0-length array so compiler knows we really meant to read and
write past it.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tools/i915-perf/i915_perf_control.c           | 24 +++++++------------
 tools/i915-perf/i915_perf_recorder.c          |  7 ++++--
 tools/i915-perf/i915_perf_recorder_commands.h |  5 +---
 3 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/tools/i915-perf/i915_perf_control.c b/tools/i915-perf/i915_perf_control.c
index a8d0d30f..3722f2b1 100644
--- a/tools/i915-perf/i915_perf_control.c
+++ b/tools/i915-perf/i915_perf_control.c
@@ -91,28 +91,22 @@ main(int argc, char *argv[])
 		if (dump_file[0] == '/') {
 			uint32_t total_len =
 				sizeof(struct recorder_command_base) + strlen(dump_file) + 1;
-			struct {
-				struct recorder_command_base base;
-				struct recorder_command_dump dump;
-			} *data = malloc(total_len);
+			struct recorder_command_base *data = malloc(total_len);
 
-			data->base.command = RECORDER_COMMAND_DUMP;
-			data->base.size = total_len;
-			snprintf((char *) data->dump.path, strlen(dump_file) + 1, "%s", dump_file);
+			data->command = RECORDER_COMMAND_DUMP;
+			data->size = total_len;
+			snprintf((char *) data->path, strlen(dump_file) + 1, "%s", dump_file);
 
 			fwrite(data, total_len, 1, command_fifo_file);
 		} else {
 			char *cwd = get_current_dir_name();
 			uint32_t path_len = strlen(cwd) + 1 + strlen(dump_file) + 1;
 			uint32_t total_len = sizeof(struct recorder_command_base) + path_len;
-			struct {
-				struct recorder_command_base base;
-				struct recorder_command_dump dump;
-			} *data = malloc(total_len);
-
-			data->base.command = RECORDER_COMMAND_DUMP;
-			data->base.size = total_len;
-			snprintf((char *) data->dump.path, path_len, "%s/%s", cwd, dump_file);
+			struct recorder_command_base *data = malloc(total_len);
+
+			data->command = RECORDER_COMMAND_DUMP;
+			data->size = total_len;
+			snprintf((char *) data->path, path_len, "%s/%s", cwd, dump_file);
 
 			fwrite(data, total_len, 1, command_fifo_file);
 		}
diff --git a/tools/i915-perf/i915_perf_recorder.c b/tools/i915-perf/i915_perf_recorder.c
index 760cabf1..bd477746 100644
--- a/tools/i915-perf/i915_perf_recorder.c
+++ b/tools/i915-perf/i915_perf_recorder.c
@@ -605,12 +605,15 @@ read_command_file(struct recording_context *ctx)
 	switch (header.command) {
 	case RECORDER_COMMAND_DUMP: {
 		uint32_t len = header.size - sizeof(header), offset = 0;
-		struct recorder_command_dump *dump = malloc(len);
+		struct recorder_command_base *dump = malloc(sizeof(header) + len);
 		FILE *file;
 
+		/* Not really needed since current code only accesses dump->path but for completeness... */
+		memcpy(dump, &header, sizeof(header));
+
 		while (offset < len &&
 		       ((ret = read(ctx->command_fifo_fd,
-				    (void *) dump + offset, len - offset)) > 0
+				    (void *) dump->path + offset, len - offset)) > 0
 			|| errno == EAGAIN)) {
 			if (ret > 0)
 				offset += ret;
diff --git a/tools/i915-perf/i915_perf_recorder_commands.h b/tools/i915-perf/i915_perf_recorder_commands.h
index 4855d80f..5d84ca82 100644
--- a/tools/i915-perf/i915_perf_recorder_commands.h
+++ b/tools/i915-perf/i915_perf_recorder_commands.h
@@ -32,8 +32,5 @@ enum recorder_command {
 struct recorder_command_base {
 	uint32_t command;
 	uint32_t size;
-};
-
-struct recorder_command_dump {
-	uint8_t path[0];
+	uint8_t path[];
 };
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related


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.