* Re: [Intel-gfx] [PATCH 49/52] drm/mipi-dbi: Drop explicit drm_mode_config_cleanup call
From: Noralf Trønnes @ 2020-02-20 16:22 UTC (permalink / raw)
To: Daniel Vetter, DRI Development
Cc: David Airlie, Intel Graphics Development, Maxime Ripard,
Eric Anholt, Thomas Zimmermann, Daniel Vetter, Kamlesh Gurudasani,
Sam Ravnborg, David Lechner
In-Reply-To: <20200219102122.1607365-50-daniel.vetter@ffwll.ch>
Den 19.02.2020 11.21, skrev Daniel Vetter:
> Allows us to drop the drm_driver.release callback from all
> drivers, and remove the mipi_dbi_release() function.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: David Lechner <david@lechnology.com>
> Cc: Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH 49/52] drm/mipi-dbi: Drop explicit drm_mode_config_cleanup call
From: Noralf Trønnes @ 2020-02-20 16:22 UTC (permalink / raw)
To: Daniel Vetter, DRI Development
Cc: David Airlie, Intel Graphics Development, Thomas Zimmermann,
Daniel Vetter, Kamlesh Gurudasani, Sam Ravnborg, David Lechner
In-Reply-To: <20200219102122.1607365-50-daniel.vetter@ffwll.ch>
Den 19.02.2020 11.21, skrev Daniel Vetter:
> Allows us to drop the drm_driver.release callback from all
> drivers, and remove the mipi_dbi_release() function.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: David Lechner <david@lechnology.com>
> Cc: Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [RFC PATCH v3 07/27] qcow2: Add subcluster-related fields to BDRVQcow2State
From: Max Reitz @ 2020-02-20 16:15 UTC (permalink / raw)
To: Alberto Garcia, qemu-devel
Cc: Kevin Wolf, Anton Nefedov, qemu-block,
Vladimir Sementsov-Ogievskiy, Denis V . Lunev
In-Reply-To: <b04e7e26cea16892a7f209b37d931c489ef17bd9.1577014346.git.berto@igalia.com>
[-- Attachment #1.1: Type: text/plain, Size: 629 bytes --]
On 22.12.19 12:36, Alberto Garcia wrote:
> This patch adds the following new fields to BDRVQcow2State:
>
> - subclusters_per_cluster: Number of subclusters in a cluster
> - subcluster_size: The size of each subcluster, in bytes
> - subcluster_bits: No. of bits so 1 << subcluster_bits = subcluster_size
>
> Images without subclusters are treated as if they had exactly one,
> with subcluster_size = cluster_size.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> block/qcow2.c | 5 +++++
> block/qcow2.h | 5 +++++
> 2 files changed, 10 insertions(+)
Reviewed-by: Max Reitz <mreitz@redhat.com>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* [PATCH] maint: Include top-level *.rst files early in git diff
From: Eric Blake @ 2020-02-20 16:22 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, peter.maydell
We are converting more doc files to *.rst rather than *.texi. Most
doc files are already listed early in diffs due to our catchall
docs/*, but a few top-level files get missed by that glob.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
Both *.texi and *.rst entries make sense while we are still converting
things, but we'll need a followup to drop *.texi when the conversion
is complete...
scripts/git.orderfile | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/git.orderfile b/scripts/git.orderfile
index 1f747b583a9e..abd8a67a2b4e 100644
--- a/scripts/git.orderfile
+++ b/scripts/git.orderfile
@@ -11,6 +11,7 @@
# Documentation
docs/*
+*.rst
*.texi
# build system
--
2.24.1
^ permalink raw reply related
* Re: [PATCH v3 22/22] x86/int3: Ensure that poke_int3_handler() is not sanitized
From: Dmitry Vyukov @ 2020-02-20 16:22 UTC (permalink / raw)
To: Peter Zijlstra
Cc: LKML, linux-arch, Steven Rostedt, Ingo Molnar, Joel Fernandes,
Greg Kroah-Hartman, Gustavo A. R. Silva, Thomas Gleixner,
Paul E. McKenney, Josh Triplett, Mathieu Desnoyers, Lai Jiangshan,
Andy Lutomirski, tony.luck, Frederic Weisbecker, Dan Carpenter,
Masami Hiramatsu, Andrey Ryabinin, kasan-dev
In-Reply-To: <20200220120631.GX18400@hirez.programming.kicks-ass.net>
On Thu, Feb 20, 2020 at 1:06 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Thu, Feb 20, 2020 at 11:37:32AM +0100, Dmitry Vyukov wrote:
> > On Wed, Feb 19, 2020 at 6:20 PM Peter Zijlstra <peterz@infradead.org> wrote:
> > >
> > > On Wed, Feb 19, 2020 at 05:30:25PM +0100, Peter Zijlstra wrote:
> > >
> > > > By inlining everything in poke_int3_handler() (except bsearch :/) we can
> > > > mark the whole function off limits to everything and call it a day. That
> > > > simplicity has been the guiding principle so far.
> > > >
> > > > Alternatively we can provide an __always_inline variant of bsearch().
> > >
> > > This reduces the __no_sanitize usage to just the exception entry
> > > (do_int3) and the critical function: poke_int3_handler().
> > >
> > > Is this more acceptible?
> >
> > Let's say it's more acceptable.
> >
> > Acked-by: Dmitry Vyukov <dvyukov@google.com>
>
> Thanks, I'll go make it happen.
>
> > I guess there is no ideal solution here.
> >
> > Just a straw man proposal: expected number of elements is large enough
> > to make bsearch profitable, right? I see 1 is a common case, but the
> > other case has multiple entries.
>
> Latency was the consideration; the linear search would dramatically
> increase the runtime of the exception.
>
> The current limit is 256 entries and we're hitting that quite often.
>
> (we can trivially increase, but nobody has been able to show significant
> benefits for that -- as of yet)
I see. Thanks for explaining. Just wanted to check because inlining a
linear search would free us from all these unpleasant problems.
^ permalink raw reply
* Re: [PATCH 48/52] drm/mipi-dbi: Move drm_mode_config_init into mipi library
From: Noralf Trønnes @ 2020-02-20 16:22 UTC (permalink / raw)
To: Daniel Vetter, DRI Development; +Cc: Daniel Vetter, Intel Graphics Development
In-Reply-To: <20200219102122.1607365-49-daniel.vetter@ffwll.ch>
Den 19.02.2020 11.21, skrev Daniel Vetter:
> 7/7 drivers agree that's the right choice, let's do this.
>
> This avoids duplicating the same old error checking code over all 7
> drivers, which is the motivation here.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [Intel-gfx] [PATCH 48/52] drm/mipi-dbi: Move drm_mode_config_init into mipi library
From: Noralf Trønnes @ 2020-02-20 16:22 UTC (permalink / raw)
To: Daniel Vetter, DRI Development; +Cc: Daniel Vetter, Intel Graphics Development
In-Reply-To: <20200219102122.1607365-49-daniel.vetter@ffwll.ch>
Den 19.02.2020 11.21, skrev Daniel Vetter:
> 7/7 drivers agree that's the right choice, let's do this.
>
> This avoids duplicating the same old error checking code over all 7
> drivers, which is the motivation here.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH 04/13] wayland: convert to meson build
From: Joshua Watt @ 2020-02-20 16:21 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: OE-core
In-Reply-To: <20200219194752.7967-4-alex.kanavin@gmail.com>
On Wed, Feb 19, 2020 at 1:49 PM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> Replace an autotools-specific .pc adjustment patch with a meson-specific one.
This can (and did) break meta-mingw in the autobuilder, but I pushed
the fix to master-next of meta-mingw
(https://git.yoctoproject.org/cgit/cgit.cgi/meta-mingw/commit/?h=master-next&id=32ccf9d5089694e4a58951ca1a38452f889a27ef),
so that can be pulled in to try again
>
> Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> ---
> ...hardcode-the-path-to-wayland-scanner.patch | 26 +++++++++++++++
> ...-the-native-wayland-scanner-directly.patch | 27 ++++++++++++++++
> .../wayland/wayland/fixpathinpcfiles.patch | 32 -------------------
> .../wayland/wayland_1.18.0.bb | 11 ++++---
> 4 files changed, 59 insertions(+), 37 deletions(-)
> create mode 100644 meta/recipes-graphics/wayland/wayland/0002-Do-not-hardcode-the-path-to-wayland-scanner.patch
> create mode 100644 meta/recipes-graphics/wayland/wayland/0002-meson.build-find-the-native-wayland-scanner-directly.patch
> delete mode 100644 meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch
>
> diff --git a/meta/recipes-graphics/wayland/wayland/0002-Do-not-hardcode-the-path-to-wayland-scanner.patch b/meta/recipes-graphics/wayland/wayland/0002-Do-not-hardcode-the-path-to-wayland-scanner.patch
> new file mode 100644
> index 0000000000..2199548bdf
> --- /dev/null
> +++ b/meta/recipes-graphics/wayland/wayland/0002-Do-not-hardcode-the-path-to-wayland-scanner.patch
> @@ -0,0 +1,26 @@
> +From cbb28635a1079d68e62dbaa1e21791a20dbbbaf4 Mon Sep 17 00:00:00 2001
> +From: Alexander Kanavin <alex.kanavin@gmail.com>
> +Date: Mon, 17 Feb 2020 21:46:18 +0100
> +Subject: [PATCH] Do not hardcode the path to wayland-scanner
> +
> +This results in host contamination during builds.
> +
> +Upstream-Status: Inappropriate [oe-core specific]
> +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +---
> + src/meson.build | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/meson.build b/src/meson.build
> +index 294aee0..7e410fa 100644
> +--- a/src/meson.build
> ++++ b/src/meson.build
> +@@ -49,7 +49,7 @@ pkgconfig.generate(
> + 'datarootdir=' + join_paths('${prefix}', get_option('datadir')),
> + 'pkgdatadir=' + join_paths('${datarootdir}', meson.project_name()),
> + 'bindir=' + join_paths('${prefix}', get_option('bindir')),
> +- 'wayland_scanner=${bindir}/wayland-scanner'
> ++ 'wayland_scanner=wayland-scanner'
> + ],
> + filebase: 'wayland-scanner'
> + )
> diff --git a/meta/recipes-graphics/wayland/wayland/0002-meson.build-find-the-native-wayland-scanner-directly.patch b/meta/recipes-graphics/wayland/wayland/0002-meson.build-find-the-native-wayland-scanner-directly.patch
> new file mode 100644
> index 0000000000..f98037a850
> --- /dev/null
> +++ b/meta/recipes-graphics/wayland/wayland/0002-meson.build-find-the-native-wayland-scanner-directly.patch
> @@ -0,0 +1,27 @@
> +From 2582d2653ba80917d7bc47088e1a5f49530fddaa Mon Sep 17 00:00:00 2001
> +From: Alexander Kanavin <alex.kanavin@gmail.com>
> +Date: Sun, 16 Feb 2020 16:29:53 +0100
> +Subject: [PATCH] meson.build: find the native wayland-scanner directly in PATH
> +
> +Otherwise, meson attempts to use the target pkg-config and fails.
> +
> +Upstream-Status: Pending
> +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +---
> + src/meson.build | 3 +--
> + 1 file changed, 1 insertion(+), 2 deletions(-)
> +
> +diff --git a/src/meson.build b/src/meson.build
> +index 3e8c9bf..294aee0 100644
> +--- a/src/meson.build
> ++++ b/src/meson.build
> +@@ -55,8 +55,7 @@ pkgconfig.generate(
> + )
> +
> + if meson.is_cross_build()
> +- scanner_dep = dependency('wayland-scanner', native: true, version: '>=1.14.0')
> +- wayland_scanner_for_build = find_program(scanner_dep.get_pkgconfig_variable('wayland_scanner'))
> ++ wayland_scanner_for_build = find_program('wayland-scanner')
> + else
> + wayland_scanner_for_build = wayland_scanner
> + endif
> diff --git a/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch b/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch
> deleted file mode 100644
> index ad3526d984..0000000000
> --- a/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -Fix wayland-client and wayland-scanner pc files
> -
> -Upstream-Status: Pending
> -
> -Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
> -
> -Index: wayland-1.14.0/src/wayland-client.pc.in
> -===================================================================
> ---- wayland-1.14.0.orig/src/wayland-client.pc.in
> -+++ wayland-1.14.0/src/wayland-client.pc.in
> -@@ -1,7 +1,7 @@
> - prefix=@prefix@
> - exec_prefix=@exec_prefix@
> - datarootdir=@datarootdir@
> --pkgdatadir=@datadir@/@PACKAGE@
> -+pkgdatadir=${pc_sysrootdir}@datadir@/@PACKAGE@
> - libdir=@libdir@
> - includedir=@includedir@
> -
> -Index: wayland-1.14.0/src/wayland-scanner.pc.in
> -===================================================================
> ---- wayland-1.14.0.orig/src/wayland-scanner.pc.in
> -+++ wayland-1.14.0/src/wayland-scanner.pc.in
> -@@ -2,7 +2,7 @@ prefix=@prefix@
> - exec_prefix=@exec_prefix@
> - datarootdir=@datarootdir@
> - pkgdatadir=@datadir@/@PACKAGE@
> --wayland_scanner=@bindir@/wayland-scanner
> -+wayland_scanner=wayland-scanner
> -
> - Name: Wayland Scanner
> - Description: Wayland scanner
> diff --git a/meta/recipes-graphics/wayland/wayland_1.18.0.bb b/meta/recipes-graphics/wayland/wayland_1.18.0.bb
> index 7a3f075552..a702b3f6cc 100644
> --- a/meta/recipes-graphics/wayland/wayland_1.18.0.bb
> +++ b/meta/recipes-graphics/wayland/wayland_1.18.0.bb
> @@ -13,20 +13,21 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \
> DEPENDS = "expat libffi wayland-native"
>
> SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
> - file://fixpathinpcfiles.patch \
> + file://0002-meson.build-find-the-native-wayland-scanner-directly.patch \
> + file://0002-Do-not-hardcode-the-path-to-wayland-scanner.patch \
> "
> SRC_URI[md5sum] = "23317697b6e3ff2e1ac8c5ba3ed57b65"
> SRC_URI[sha256sum] = "4675a79f091020817a98fd0484e7208c8762242266967f55a67776936c2e294d"
>
> UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
>
> -inherit autotools pkgconfig
> +inherit meson pkgconfig
>
> PACKAGECONFIG ??= "dtd-validation"
> -PACKAGECONFIG[dtd-validation] = "--enable-dtd-validation,--disable-dtd-validation,libxml2,,"
> +PACKAGECONFIG[dtd-validation] = "-Ddtd_validation=true,-Ddtd_validation=false,libxml2,,"
>
> -EXTRA_OECONF = "--disable-documentation --with-host-scanner"
> -EXTRA_OECONF_class-native = "--disable-documentation --disable-libraries"
> +EXTRA_OEMESON = "-Ddocumentation=false"
> +EXTRA_OEMESON_class-native = "-Ddocumentation=false -Dlibraries=false"
>
> # Wayland installs a M4 macro for other projects to use, which uses the target
> # pkg-config to find files. Replace pkg-config with pkg-config-native.
> --
> 2.25.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply
* Re: [Intel-gfx] [PATCH 47/52] drm/repaper: Drop explicit drm_mode_config_cleanup call
From: Noralf Trønnes @ 2020-02-20 16:21 UTC (permalink / raw)
To: Daniel Vetter, DRI Development; +Cc: Daniel Vetter, Intel Graphics Development
In-Reply-To: <20200219102122.1607365-48-daniel.vetter@ffwll.ch>
Den 19.02.2020 11.21, skrev Daniel Vetter:
> Allows us to drop the drm_driver.release callback.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> ---
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH 47/52] drm/repaper: Drop explicit drm_mode_config_cleanup call
From: Noralf Trønnes @ 2020-02-20 16:21 UTC (permalink / raw)
To: Daniel Vetter, DRI Development; +Cc: Daniel Vetter, Intel Graphics Development
In-Reply-To: <20200219102122.1607365-48-daniel.vetter@ffwll.ch>
Den 19.02.2020 11.21, skrev Daniel Vetter:
> Allows us to drop the drm_driver.release callback.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> ---
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [PATCH] kconfig: make 'imply' obey the direct dependency
From: Nicolas Pitre @ 2020-02-20 16:21 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kbuild mailing list, Arnd Bergmann, Richard Cochran,
Thomas Gleixner, John Stultz, Josh Triplett, Mark Brown,
Ulf Magnusson, Geert Uytterhoeven, Jonathan Corbet, Michal Marek,
open list:DOCUMENTATION, Linux Kernel Mailing List
In-Reply-To: <CAK7LNASubs2oJ8-a-amsEhWjYrfpAx8QxeTzH4PnKsELKyLaUw@mail.gmail.com>
On Thu, 20 Feb 2020, Masahiro Yamada wrote:
> Hi Nicolas,
>
> On Thu, Feb 20, 2020 at 1:16 AM Nicolas Pitre <nico@fluxnic.net> wrote:
> >
> > On Wed, 19 Feb 2020, Masahiro Yamada wrote:
> >
> > > As for the combination of FOO=y and BAR=m, the case of BAZ=m is excluded
> > > by the 'imply', and BAZ=y is also excluded by 'depends on'. So, only the
> > > possible value is BAZ=n.
> >
> > I don't think this is right. The imply keyword provide influence over
> > another symbol but it should not impose any restrictions. If BAR=m then
> > BAZ should still be allowed to be m or n.
> >
> > > @@ -174,6 +174,9 @@ applicable everywhere (see syntax).
> > > n y n N/m/y
> > > m y m M/y/n
> > > y y y Y/n
> > > + n m n N/m
> > > + m m m M/n
> > > + y m n N
> >
> > Here the last line shoule be y m n N/m.
> >
> > Generally speaking, the code enabled by FOO may rely on functionalities
> > provided by BAZ only when BAZ >= FOO. This is accomplished with
> > IS_REACHABLE():
> >
> > foo_init()
> > {
> > if (IS_REACHABLE(CONFIG_BAZ))
> > baz_register(&foo);
> > ...
> > }
> >
> > So if FOO=y and BAZ=m then IS_REACHABLE(CONFIG_BAZ) will be false. Maybe
> > adding a note to that effect linked to the "y m n N/m" line in the table
> > would be a good idea.
> >
>
> I also thought so.
>
> I agree IS_REACHABLE() is much saner approach.
>
> So, do you agree to change the current behavior
> as follows?
>
>
> index d0111dd26410..47dbfd1ee003 100644
> --- a/Documentation/kbuild/kconfig-language.rst
> +++ b/Documentation/kbuild/kconfig-language.rst
> @@ -173,7 +173,7 @@ applicable everywhere (see syntax).
> === === ============= ==============
> n y n N/m/y
> m y m M/y/n
> - y y y Y/n
> + y y y Y/m/n
> y n * N
> === === ============= ==============
>
Yes. That should have been the case all along.
Nicolas
^ permalink raw reply
* [PULL 15/18] qemu-img: Fix convert -n -B for backing-less targets
From: Max Reitz @ 2020-02-20 16:07 UTC (permalink / raw)
To: qemu-block; +Cc: Kevin Wolf, Peter Maydell, qemu-devel, Max Reitz
In-Reply-To: <20200220160710.533297-1-mreitz@redhat.com>
s.target_has_backing does not reflect whether the target BDS has a
backing file; it only tells whether we should use a backing file during
conversion (specified by -B).
As such, if you use convert -n, the target does not necessarily actually
have a backing file, and then dereferencing out_bs->backing fails here.
When converting to an existing file, we should set
target_backing_sectors to a negative value, because first, as the
comment explains, this value is only used for optimization, so it is
always fine to do that.
Second, we use this value to determine where the target must be
initialized to zeroes (overlays are initialized to zero after the end of
their backing file). When converting to an existing file, we cannot
assume that to be true.
Cc: qemu-stable@nongnu.org
Fixes: 351c8efff9ad809c822d55620df54d575d536f68
("qemu-img: Special post-backing convert handling")
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200121155915.98232-2-mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
qemu-img.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index 0faf2cd2f5..804630a368 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2523,7 +2523,7 @@ static int img_convert(int argc, char **argv)
}
}
- if (s.target_has_backing) {
+ if (s.target_has_backing && s.target_is_new) {
/* Errors are treated as "backing length unknown" (which means
* s.target_backing_sectors has to be negative, which it will
* be automatically). The backing file length is used only
--
2.24.1
^ permalink raw reply related
* Re: [RFC PATCH v3 4/6] media: tegra: Add Tegra210 Video input driver
From: Sowjanya Komatineni @ 2020-02-20 16:21 UTC (permalink / raw)
To: Hans Verkuil, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w,
jonathanh-DDmLM1+adcrQT0dZR+AlfA, frankc-DDmLM1+adcrQT0dZR+AlfA,
helen.koike-ZGY8ohtN/8qB+jHODAdFcQ, sboyd-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-media-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-clk-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <dae3a6dd-f7ab-5e0f-08a9-2b0be4c68fe1-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
On 2/20/20 1:29 AM, Hans Verkuil wrote:
> External email: Use caution opening links or attachments
>
>
> On 2/20/20 1:09 AM, Sowjanya Komatineni wrote:
>>> Thanks Hans. Probably dma address is not aligned properly. Will check.
>>
>> I see this time repro happened right on power up during 1st run of
>> compliance test and it shows kernel write to read-only error right
>> during vb2_core_qbuf -> buf_prepare.
>>
>> it happened after buffers allocation and during pre-queuing of buffers
>> right before starting 1st stream on power up.
>>
>> Hi Thierry,
>>
>> Currently tegra vi driver don't use iommu. Could this be some issue with
>> contig allocation as iommu is not being used?
> Nothing to do with that. The root cause is that struct tegra_channel_buffer
> must start with struct vb2_v4l2_buffer since that's what vb2 assumes. Instead
> it starts with 'chan'. The really surprising thing is that this didn't cause
> more problems sooner.
>
> The patch below fixes this KASAN error. Whether it also fixes the original
> error you found is something you need to test, but I think that's very likely.
>
> Regards,
>
> Hans
right, missed to notice. Thanks a lot hans. I think this fixes the error
I am seeing too.
Will fix and test...
>
> diff --git a/drivers/staging/media/tegra/tegra-common.h b/drivers/staging/media/tegra/tegra-common.h
> index 79ec550c6f27..3980a8759e68 100644
> --- a/drivers/staging/media/tegra/tegra-common.h
> +++ b/drivers/staging/media/tegra/tegra-common.h
> @@ -221,9 +221,9 @@ struct tegra_vi_channel {
> * @mw_ack_sp_thresh: MW_ACK_DONE syncpoint threshold
> */
> struct tegra_channel_buffer {
> - struct tegra_vi_channel *chan;
> struct vb2_v4l2_buffer buf;
> struct list_head queue;
> + struct tegra_vi_channel *chan;
> dma_addr_t addr;
> u32 mw_ack_sp_thresh;
> };
>
>
>>
>> [ 54.041421] tegra_channel_buffer_prepare+0x34/0x88
>> [ 54.047666] __buf_prepare+0x1c4/0x230
>> [ 54.052094] vb2_core_qbuf+0x454/0x508
>> [ 54.056434] __vb2_init_fileio+0x1f8/0x2b8
>> [ 54.060519] __vb2_perform_fileio+0x5a0/0x6b8
>> [ 54.064864] vb2_read+0x10/0x18
>> [ 54.067996] vb2_fop_read+0xb0/0xf8
>> [ 54.071475] v4l2_read+0x74/0xb8
>> [ 54.074697] __vfs_read+0x18/0x40
>> [ 54.078003] vfs_read+0x98/0x168
>> [ 54.081222] ksys_read+0x64/0xf0
>> [ 54.084439] __arm64_sys_read+0x14/0x20
>> [ 54.088268] el0_svc_common.constprop.2+0xb0/0x168
>> [ 54.093047] do_el0_svc_compat+0x18/0x38
>> [ 54.096961] el0_sync_compat_handler+0x13c/0x194
>> [ 54.101565] el0_sync_compat+0x144/0x180
>> [ 54.105478] Code: b9407802 eb02007f 540001e8 b9007404 (f81f8001)
>> [ 54.111559] ---[ end trace 7fbb77a9700492f1 ]---
>>
>>>>> [ 41.222012] Mem abort info:
>>>>> [ 41.224807] ESR = 0x9600004f
>>>>> [ 41.227852] EC = 0x25: DABT (current EL), IL = 32 bits
>>>>> [ 41.233160] SET = 0, FnV = 0
>>>>> [ 41.236204] EA = 0, S1PTW = 0
>>>>> [ 41.239344] Data abort info:
>>>>> [ 41.242225] ISV = 0, ISS = 0x0000004f
>>>>> [ 41.246058] CM = 0, WnR = 1
>>>>> [ 41.249026] swapper pgtable: 4k pages, 48-bit VAs,
>>>>> pgdp=0000000081498000
>>>>> [ 41.255733] [ffff0000f5c3fff8] pgd=000000017f1f8003,
>>>>> pud=000000017ec06003, pmd=000000017ea57003, pte=0060000175c3f793
>>>>> [ 41.266345] Internal error: Oops: 9600004f [#1] PREEMPT SMP
>>>>> [ 41.271905] Modules linked in: panel_simple tegra_drm
>>>>> snd_hda_codec_hdmi snd_hda_tegra crct10dif_ce snd_hda_codec cec
>>>>> drm_kms_helper snd_hda_core lp855x_bl drm pwm_tegra ip_tables x_tables
>>>>> ipv6 nf_defrag_ipv6
>>>>> [ 41.290401] CPU: 3 PID: 532 Comm: v4l2-compliance Tainted: G
>>>>> W 5.6.0-rc1-00035-g6a105c1c479a-dirty #1
>>>>> [ 41.300902] Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)
>>>>> [ 41.306807] pstate: 60000005 (nZCv daif -PAN -UAO)
>>>>> [ 41.311593] pc : tegra_channel_buffer_prepare+0x34/0x88
>>>>> [ 41.316807] lr : __buf_prepare+0x1c4/0x230
>>>>> [ 41.320891] sp : ffff800011f5baa0
>>>>> [ 41.324195] x29: ffff800011f5baa0 x28: ffff0000f58cc100
>>>>> [ 41.329494] x27: ffff800011f5bc58 x26: ffff80001100b780
>>>>> [ 41.334792] x25: ffff0000f81f1608 x24: ffff0000f7be7c00
>>>>> [ 41.340091] x23: 00000000c058565d x22: 0000000000000000
>>>>> [ 41.345390] x21: ffff0000f81f16e8 x20: 0000000000000000
>>>>> [ 41.350688] x19: ffff0000f5c40000 x18: 0000000000000000
>>>>> [ 41.355986] x17: 0000000000000000 x16: 0000000000000000
>>>>> [ 41.361285] x15: ffff0000f8553800 x14: 0000000000000000
>>>>> [ 41.366583] x13: 003f480000000000 x12: 003f500000000000
>>>>> [ 41.371881] x11: 0000000100000000 x10: 0000000000000000
>>>>> [ 41.377180] x9 : 0000000000000000 x8 : ffff0000f5c40258
>>>>> [ 41.382478] x7 : 0000000000000030 x6 : 0000000000000001
>>>>> [ 41.387776] x5 : 0000000000000000 x4 : 00000000003f4800
>>>>> [ 41.393074] x3 : 00000000003f4800 x2 : 00000000003f4800
>>>>> [ 41.398373] x1 : ffff0000f81f1080 x0 : ffff0000f5c40000
>>>>> [ 41.403671] Call trace:
>>>>> [ 41.406109] tegra_channel_buffer_prepare+0x34/0x88
>>>>> [ 41.410974] __buf_prepare+0x1c4/0x230
>>>>> [ 41.414713] vb2_core_prepare_buf+0x94/0x110
>>>>> [ 41.418971] vb2_prepare_buf+0x74/0xa8
>>>>> [ 41.422710] vb2_ioctl_prepare_buf+0x54/0x60
>>>>> [ 41.426970] v4l_prepare_buf+0x44/0x58
>>>>> [ 41.430707] __video_do_ioctl+0x228/0x3e8
>>>>> [ 41.434705] video_usercopy+0x1cc/0x4d0
>>>>> [ 41.438531] video_ioctl2+0x14/0x20
>>>>> [ 41.442010] v4l2_ioctl+0x44/0x68
>>>>> [ 41.445316] v4l2_compat_ioctl32+0x21c/0x1420
>>>>> [ 41.449665] __arm64_compat_sys_ioctl+0xc8/0x108
>>>>> [ 41.454273] el0_svc_common.constprop.2+0xb0/0x168
>>>>> [ 41.459051] do_el0_svc_compat+0x18/0x38
>>>>> [ 41.462964] el0_sync_compat_handler+0x13c/0x194
>>>>> [ 41.467570] el0_sync_compat+0x144/0x180
>>>>> [ 41.471483] Code: b9407802 eb02007f 540001e8 b9007404 (f81f8001)
>>>>> [ 41.477563] ---[ end trace 051c84051f60870a ]---
>>>>>
>>>>>>>>>>> With using minimum 3 buffers, this issue doesnt happen at all
>>>>>>>>>>> from
>>>>>>>>>>> almost 72 hours of testing.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Will try with setting vb2 queue field min_buffers_needed as 3
>>>>>>>>>>> instead
>>>>>>>>>>> of adding check in queue setup.
>>>>>>>>>>>
>>>>>>>>>>>>> +
>>>>>>>>>>>>> + return 0;
>>>>>>>>>>>>> +}
^ permalink raw reply
* Re: [RFC PATCH v3 4/6] media: tegra: Add Tegra210 Video input driver
From: Sowjanya Komatineni @ 2020-02-20 16:21 UTC (permalink / raw)
To: Hans Verkuil, thierry.reding, jonathanh, frankc, helen.koike,
sboyd
Cc: linux-media, devicetree, linux-clk, linux-tegra, linux-kernel
In-Reply-To: <dae3a6dd-f7ab-5e0f-08a9-2b0be4c68fe1@xs4all.nl>
On 2/20/20 1:29 AM, Hans Verkuil wrote:
> External email: Use caution opening links or attachments
>
>
> On 2/20/20 1:09 AM, Sowjanya Komatineni wrote:
>>> Thanks Hans. Probably dma address is not aligned properly. Will check.
>>
>> I see this time repro happened right on power up during 1st run of
>> compliance test and it shows kernel write to read-only error right
>> during vb2_core_qbuf -> buf_prepare.
>>
>> it happened after buffers allocation and during pre-queuing of buffers
>> right before starting 1st stream on power up.
>>
>> Hi Thierry,
>>
>> Currently tegra vi driver don't use iommu. Could this be some issue with
>> contig allocation as iommu is not being used?
> Nothing to do with that. The root cause is that struct tegra_channel_buffer
> must start with struct vb2_v4l2_buffer since that's what vb2 assumes. Instead
> it starts with 'chan'. The really surprising thing is that this didn't cause
> more problems sooner.
>
> The patch below fixes this KASAN error. Whether it also fixes the original
> error you found is something you need to test, but I think that's very likely.
>
> Regards,
>
> Hans
right, missed to notice. Thanks a lot hans. I think this fixes the error
I am seeing too.
Will fix and test...
>
> diff --git a/drivers/staging/media/tegra/tegra-common.h b/drivers/staging/media/tegra/tegra-common.h
> index 79ec550c6f27..3980a8759e68 100644
> --- a/drivers/staging/media/tegra/tegra-common.h
> +++ b/drivers/staging/media/tegra/tegra-common.h
> @@ -221,9 +221,9 @@ struct tegra_vi_channel {
> * @mw_ack_sp_thresh: MW_ACK_DONE syncpoint threshold
> */
> struct tegra_channel_buffer {
> - struct tegra_vi_channel *chan;
> struct vb2_v4l2_buffer buf;
> struct list_head queue;
> + struct tegra_vi_channel *chan;
> dma_addr_t addr;
> u32 mw_ack_sp_thresh;
> };
>
>
>>
>> [ 54.041421] tegra_channel_buffer_prepare+0x34/0x88
>> [ 54.047666] __buf_prepare+0x1c4/0x230
>> [ 54.052094] vb2_core_qbuf+0x454/0x508
>> [ 54.056434] __vb2_init_fileio+0x1f8/0x2b8
>> [ 54.060519] __vb2_perform_fileio+0x5a0/0x6b8
>> [ 54.064864] vb2_read+0x10/0x18
>> [ 54.067996] vb2_fop_read+0xb0/0xf8
>> [ 54.071475] v4l2_read+0x74/0xb8
>> [ 54.074697] __vfs_read+0x18/0x40
>> [ 54.078003] vfs_read+0x98/0x168
>> [ 54.081222] ksys_read+0x64/0xf0
>> [ 54.084439] __arm64_sys_read+0x14/0x20
>> [ 54.088268] el0_svc_common.constprop.2+0xb0/0x168
>> [ 54.093047] do_el0_svc_compat+0x18/0x38
>> [ 54.096961] el0_sync_compat_handler+0x13c/0x194
>> [ 54.101565] el0_sync_compat+0x144/0x180
>> [ 54.105478] Code: b9407802 eb02007f 540001e8 b9007404 (f81f8001)
>> [ 54.111559] ---[ end trace 7fbb77a9700492f1 ]---
>>
>>>>> [ 41.222012] Mem abort info:
>>>>> [ 41.224807] ESR = 0x9600004f
>>>>> [ 41.227852] EC = 0x25: DABT (current EL), IL = 32 bits
>>>>> [ 41.233160] SET = 0, FnV = 0
>>>>> [ 41.236204] EA = 0, S1PTW = 0
>>>>> [ 41.239344] Data abort info:
>>>>> [ 41.242225] ISV = 0, ISS = 0x0000004f
>>>>> [ 41.246058] CM = 0, WnR = 1
>>>>> [ 41.249026] swapper pgtable: 4k pages, 48-bit VAs,
>>>>> pgdp=0000000081498000
>>>>> [ 41.255733] [ffff0000f5c3fff8] pgd=000000017f1f8003,
>>>>> pud=000000017ec06003, pmd=000000017ea57003, pte=0060000175c3f793
>>>>> [ 41.266345] Internal error: Oops: 9600004f [#1] PREEMPT SMP
>>>>> [ 41.271905] Modules linked in: panel_simple tegra_drm
>>>>> snd_hda_codec_hdmi snd_hda_tegra crct10dif_ce snd_hda_codec cec
>>>>> drm_kms_helper snd_hda_core lp855x_bl drm pwm_tegra ip_tables x_tables
>>>>> ipv6 nf_defrag_ipv6
>>>>> [ 41.290401] CPU: 3 PID: 532 Comm: v4l2-compliance Tainted: G
>>>>> W 5.6.0-rc1-00035-g6a105c1c479a-dirty #1
>>>>> [ 41.300902] Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)
>>>>> [ 41.306807] pstate: 60000005 (nZCv daif -PAN -UAO)
>>>>> [ 41.311593] pc : tegra_channel_buffer_prepare+0x34/0x88
>>>>> [ 41.316807] lr : __buf_prepare+0x1c4/0x230
>>>>> [ 41.320891] sp : ffff800011f5baa0
>>>>> [ 41.324195] x29: ffff800011f5baa0 x28: ffff0000f58cc100
>>>>> [ 41.329494] x27: ffff800011f5bc58 x26: ffff80001100b780
>>>>> [ 41.334792] x25: ffff0000f81f1608 x24: ffff0000f7be7c00
>>>>> [ 41.340091] x23: 00000000c058565d x22: 0000000000000000
>>>>> [ 41.345390] x21: ffff0000f81f16e8 x20: 0000000000000000
>>>>> [ 41.350688] x19: ffff0000f5c40000 x18: 0000000000000000
>>>>> [ 41.355986] x17: 0000000000000000 x16: 0000000000000000
>>>>> [ 41.361285] x15: ffff0000f8553800 x14: 0000000000000000
>>>>> [ 41.366583] x13: 003f480000000000 x12: 003f500000000000
>>>>> [ 41.371881] x11: 0000000100000000 x10: 0000000000000000
>>>>> [ 41.377180] x9 : 0000000000000000 x8 : ffff0000f5c40258
>>>>> [ 41.382478] x7 : 0000000000000030 x6 : 0000000000000001
>>>>> [ 41.387776] x5 : 0000000000000000 x4 : 00000000003f4800
>>>>> [ 41.393074] x3 : 00000000003f4800 x2 : 00000000003f4800
>>>>> [ 41.398373] x1 : ffff0000f81f1080 x0 : ffff0000f5c40000
>>>>> [ 41.403671] Call trace:
>>>>> [ 41.406109] tegra_channel_buffer_prepare+0x34/0x88
>>>>> [ 41.410974] __buf_prepare+0x1c4/0x230
>>>>> [ 41.414713] vb2_core_prepare_buf+0x94/0x110
>>>>> [ 41.418971] vb2_prepare_buf+0x74/0xa8
>>>>> [ 41.422710] vb2_ioctl_prepare_buf+0x54/0x60
>>>>> [ 41.426970] v4l_prepare_buf+0x44/0x58
>>>>> [ 41.430707] __video_do_ioctl+0x228/0x3e8
>>>>> [ 41.434705] video_usercopy+0x1cc/0x4d0
>>>>> [ 41.438531] video_ioctl2+0x14/0x20
>>>>> [ 41.442010] v4l2_ioctl+0x44/0x68
>>>>> [ 41.445316] v4l2_compat_ioctl32+0x21c/0x1420
>>>>> [ 41.449665] __arm64_compat_sys_ioctl+0xc8/0x108
>>>>> [ 41.454273] el0_svc_common.constprop.2+0xb0/0x168
>>>>> [ 41.459051] do_el0_svc_compat+0x18/0x38
>>>>> [ 41.462964] el0_sync_compat_handler+0x13c/0x194
>>>>> [ 41.467570] el0_sync_compat+0x144/0x180
>>>>> [ 41.471483] Code: b9407802 eb02007f 540001e8 b9007404 (f81f8001)
>>>>> [ 41.477563] ---[ end trace 051c84051f60870a ]---
>>>>>
>>>>>>>>>>> With using minimum 3 buffers, this issue doesnt happen at all
>>>>>>>>>>> from
>>>>>>>>>>> almost 72 hours of testing.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Will try with setting vb2 queue field min_buffers_needed as 3
>>>>>>>>>>> instead
>>>>>>>>>>> of adding check in queue setup.
>>>>>>>>>>>
>>>>>>>>>>>>> +
>>>>>>>>>>>>> + return 0;
>>>>>>>>>>>>> +}
^ permalink raw reply
* Re: Why the journal log records IPv6(::ffff:127.0.0.1) not IPv4(127.0.0.1)
From: Patrick Williams @ 2020-02-20 16:20 UTC (permalink / raw)
To: 常晓明; +Cc: OpenBMC Development
In-Reply-To: <37d82a1c.6ab1.17061b3f429.Coremail.xiaoqian1641@163.com>
[-- Attachment #1: Type: text/plain, Size: 774 bytes --]
On Thu, Feb 20, 2020 at 04:25:48PM +0800, 常晓明 wrote:
> Hi, Team,
>
>
> I enabled the "/xyz/openbmc_project/logging/rest_api_logs" and add the patch code as followed, the journal log does not record IPv4(10.0.2.2) but IPv6(::ffff:10.0.2.2) .
That IPv6 address is the same as the IPv4 address, just in IPv6 format.
https://en.wikipedia.org/wiki/IPv6_address#Transition_from_IPv4
Generally, applications that support IPv6 don't [need to] know if they are
being connected to by an IPv4 or IPv6 end-point. This is how the Linux
networking stack handles IPv6. When the application indicates it
supports IPv6, the network stack will give it IPv6-formatted addresses
even for IPv4 connections. This is what you're seeing here.
--
Patrick Williams
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH v3 00/12] Enable per-file/directory DAX operations V3
From: Ira Weiny @ 2020-02-20 16:20 UTC (permalink / raw)
To: Jeff Moyer
Cc: Dan Williams, Darrick J. Wong, Linux Kernel Mailing List,
Alexander Viro, Dave Chinner, Christoph Hellwig,
Theodore Y. Ts'o, Jan Kara, linux-ext4, linux-xfs,
linux-fsdevel
In-Reply-To: <20200218235429.GB14509@iweiny-DESK2.sc.intel.com>
On Tue, Feb 18, 2020 at 03:54:30PM -0800, 'Ira Weiny' wrote:
> On Tue, Feb 18, 2020 at 09:22:58AM -0500, Jeff Moyer wrote:
> > Ira Weiny <ira.weiny@intel.com> writes:
> > > If my disassembly of read_pages is correct it looks like readpage is null which
> > > makes sense because all files should be IS_DAX() == true due to the mount option...
> > >
> > > But tracing code indicates that the patch:
> > >
> > > fs: remove unneeded IS_DAX() check
> > >
> > > ... may be the culprit and the following fix may work...
> > >
> > > diff --git a/mm/filemap.c b/mm/filemap.c
> > > index 3a7863ba51b9..7eaf74a2a39b 100644
> > > --- a/mm/filemap.c
> > > +++ b/mm/filemap.c
> > > @@ -2257,7 +2257,7 @@ generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
> > > if (!count)
> > > goto out; /* skip atime */
> > >
> > > - if (iocb->ki_flags & IOCB_DIRECT) {
> > > + if (iocb->ki_flags & IOCB_DIRECT || IS_DAX(inode)) {
> > > struct file *file = iocb->ki_filp;
> > > struct address_space *mapping = file->f_mapping;
> > > struct inode *inode = mapping->host;
> >
> > Well, you'll have to up-level the inode variable instantiation,
> > obviously. That solves this particular issue.
>
> Well... This seems to be a random issue. I've had BMC issues with
> my server most of the day... But even with this patch I still get the failure
> in read_pages(). :-/
>
> And I have gotten it to both succeed and fail with qemu... :-/
... here is the fix. I made the change in xfs_diflags_to_linux() early on with
out factoring in the flag logic changes we have agreed upon...
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 62d9f622bad1..d592949ad396 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1123,11 +1123,11 @@ xfs_diflags_to_linux(
inode->i_flags |= S_NOATIME;
else
inode->i_flags &= ~S_NOATIME;
- if (xflags & FS_XFLAG_DAX)
+
+ if (xfs_inode_enable_dax(ip))
inode->i_flags |= S_DAX;
else
inode->i_flags &= ~S_DAX;
-
}
But the one thing which tripped me up, and concerns me, is we have 2 functions
which set the inode flags.
xfs_diflags_to_iflags()
xfs_diflags_to_linux()
xfs_diflags_to_iflags() is geared toward initialization but logically they do
the same thing. I see no reason to keep them separate. Does anyone?
Based on this find, the discussion on behavior in this thread, and the comments
from Dave I'm reworking the series because the flag check/set functions have
all changed and I really want to be as clear as possible with both the patches
and the resulting code.[*] So v4 should be out today including attempting to
document what we have discussed here and being as clear as possible on the
behavior. :-D
Thanks so much for testing this!
Ira
[*] I will probably throw in a patch to remove xfs_diflags_to_iflags() as I
really don't see a reason to keep it.
^ permalink raw reply related
* Re: [Xen-devel] [PATCH v6 2/6] libxl: modify libxl__logv() to only log valid domid values
From: Ian Jackson @ 2020-02-20 16:20 UTC (permalink / raw)
To: Paul Durrant; +Cc: Anthony Perard, xen-devel@lists.xenproject.org, Wei Liu
In-Reply-To: <20200219093754.2924-3-pdurrant@amazon.com>
Paul Durrant writes ("[PATCH v6 2/6] libxl: modify libxl__logv() to only log valid domid values"):
> Some code-paths use values other than INVALID_DOMID to indicate an invalid
> domain id. Specifically, xl will pass a value of 0 when creating/restoring
> a domain. Therefore modify libxl__logv() to use libxl_domid_valid_guest()
> as a validity test.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply
* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
From: Tony Lindgren @ 2020-02-20 16:20 UTC (permalink / raw)
To: Andrew F. Davis; +Cc: kbuild-all, linux-kernel, kbuild test robot, linux-omap
In-Reply-To: <55ddcd29-ed8b-529e-dd54-cbac5cf74e42@ti.com>
* Andrew F. Davis <afd@ti.com> [200220 16:04]:
> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> > Andrew,
> >
> > * kbuild test robot <lkp@intel.com> [200213 10:27]:
> >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >> head: 0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> >> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> >> date: 3 weeks ago
> >> config: arm-randconfig-a001-20200213 (attached as .config)
> >> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> >> reproduce:
> >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >> chmod +x ~/bin/make.cross
> >> git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> >> # save the attached .config to linux build tree
> >> GCC_VERSION=7.5.0 make.cross ARCH=arm
> >>
> >> If you fix the issue, kindly add following tag
> >> Reported-by: kbuild test robot <lkp@intel.com>
> >>
> >> All errors (new ones prefixed by >>):
> >>
> >> arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> >>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >
> > Have you looked at this one? Looks like there's still an unhandled
> > randconfig build case.
> >
>
>
> I've had a quick look, all the ARM config does:
>
> select HAVE_ARM_SMCCC if CPU_V7
>
> so I don't think this will happen in any real config, but if we want to
> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> on it.
Seems to happen at least with omap2 only config where we don't have
CPU_V7. Something like below seems to fix it.
If that looks OK to you, I'll send out a proper fix.
Regards,
Tony
8< -----------------------
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -77,6 +77,7 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
return ret;
}
+#ifdef CONFIG_HAVE_ARM_SMCCC
void omap_smccc_smc(u32 fn, u32 arg)
{
struct arm_smccc_res res;
@@ -85,6 +86,11 @@ void omap_smccc_smc(u32 fn, u32 arg)
0, 0, 0, 0, 0, 0, &res);
WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
}
+#else
+void omap_smccc_smc(u32 fn, u32 arg)
+{
+}
+#endif
void omap_smc1(u32 fn, u32 arg)
{
^ permalink raw reply
* Re: [PATCH 2/4] ceph: consider file's last read/write when calculating wanted caps
From: Jeff Layton @ 2020-02-20 16:20 UTC (permalink / raw)
To: Yan, Zheng; +Cc: Yan, Zheng, ceph-devel
In-Reply-To: <CAAM7YAnQBWjoBtE8ekB+usLjCd=ZRmB4L6_YdbspWUXNGHBa6w@mail.gmail.com>
On Thu, 2020-02-20 at 22:53 +0800, Yan, Zheng wrote:
> On Thu, Feb 20, 2020 at 10:18 PM Jeff Layton <jlayton@kernel.org> wrote:
> > On Thu, 2020-02-20 at 20:26 +0800, Yan, Zheng wrote:
> > > When getting caps for read/write, update corresponding file's last
> > > read/write. If a file hasn't been read/write for 'caps_wanted_delay_max'
> > > seconds, ignore the file when calculating wanted caps.
> > >
> >
> > Please explain in the changelog how the new info is to be stored, given
> > that it is quite complex.
> >
> > > Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
> > > ---
> > > fs/ceph/caps.c | 149 ++++++++++++++++++++++++-----------
> > > fs/ceph/file.c | 23 +++---
> > > fs/ceph/inode.c | 15 +++-
> > > fs/ceph/ioctl.c | 4 +-
> > > fs/ceph/super.h | 16 +++-
> > > include/linux/ceph/ceph_fs.h | 1 +
> > > 6 files changed, 145 insertions(+), 63 deletions(-)
> > >
> > > diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> > > index 293920d013ff..ccdc47bd7cf0 100644
> > > --- a/fs/ceph/caps.c
> > > +++ b/fs/ceph/caps.c
> > > @@ -971,18 +971,44 @@ int __ceph_caps_used(struct ceph_inode_info *ci)
> > > return used;
> > > }
> > >
> > > +#define FMODE_WAIT_BIAS 1000
> > > +
> > > /*
> > > * wanted, by virtue of open file modes
> > > */
> > > int __ceph_caps_file_wanted(struct ceph_inode_info *ci)
> > > {
> > > + struct ceph_mount_options *opt =
> > > + ceph_inode_to_client(&ci->vfs_inode)->mount_options;
> > > + unsigned long used_cutoff =
> > > + round_jiffies(jiffies - opt->caps_wanted_delay_max * HZ);
> > > + unsigned long idle_cutoff =
> > > + round_jiffies(jiffies - opt->caps_wanted_delay_min * HZ);
> > > int i, bits = 0;
> > > +
> > > for (i = 0; i < CEPH_FILE_MODE_BITS; i++) {
> > > - if (ci->i_nr_by_mode[i])
> > > + if (ci->i_file_by_mode[i].nr >= FMODE_WAIT_BIAS) {
> > > + /* there are cap waiters or lots of open files */
> > > bits |= 1 << i;
> > > + } else if (ci->i_file_by_mode[i].nr > 0) {
> > > + if (i == CEPH_FILE_MODE_PIN ||
> > > + time_after(ci->i_file_by_mode[i].last_used,
> > > + used_cutoff))
> > > + bits |= 1 << i;
> > > + } else if ((ci->i_file_by_mode[i].last_used & 1)) {
> > > + if (time_after(ci->i_file_by_mode[i].last_used,
> > > + idle_cutoff)) {
> > > + bits |= 1 << i;
> > > + } else {
> > > + ci->i_file_by_mode[i].last_used &= ~1UL;
> > > + }
> > > + }
> > > }
> > > if (bits == 0)
> > > return 0;
> > > + if (bits == 1 && !S_ISDIR(ci->vfs_inode.i_mode))
> > > + return 0;
> > > +
> > > return ceph_caps_for_mode(bits >> 1);
> > > }
> > >
> > > @@ -1021,14 +1047,6 @@ int __ceph_caps_mds_wanted(struct ceph_inode_info *ci, bool check)
> > > return mds_wanted;
> > > }
> > >
> > > -/*
> > > - * called under i_ceph_lock
> > > - */
> > > -static int __ceph_is_single_caps(struct ceph_inode_info *ci)
> > > -{
> > > - return rb_first(&ci->i_caps) == rb_last(&ci->i_caps);
> > > -}
> > > -
> > > int ceph_is_any_caps(struct inode *inode)
> > > {
> > > struct ceph_inode_info *ci = ceph_inode(inode);
> > > @@ -1856,10 +1874,6 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
> > > if (ci->i_ceph_flags & CEPH_I_FLUSH)
> > > flags |= CHECK_CAPS_FLUSH;
> > >
> > > - if (!(flags & CHECK_CAPS_AUTHONLY) ||
> > > - (ci->i_auth_cap && __ceph_is_single_caps(ci)))
> > > - __cap_delay_cancel(mdsc, ci);
> > > -
> > > goto retry_locked;
> > > retry:
> > > spin_lock(&ci->i_ceph_lock);
> > > @@ -2081,9 +2095,16 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
> > > goto retry; /* retake i_ceph_lock and restart our cap scan. */
> > > }
> > >
> > > - /* Reschedule delayed caps release if we delayed anything */
> > > - if (delayed)
> > > - __cap_delay_requeue(mdsc, ci, false);
> > > + if (list_empty(&ci->i_cap_delay_list)) {
> > > + if (delayed) {
> > > + /* Reschedule delayed caps release if we delayed anything */
> > > + __cap_delay_requeue(mdsc, ci, false);
> > > + } else if ((file_wanted & ~CEPH_CAP_PIN) &&
> > > + !(used & (CEPH_CAP_FILE_RD | CEPH_CAP_ANY_FILE_WR))) {
> > > + /* periodically re-calculate caps wanted by open files */
> > > + __cap_delay_requeue(mdsc, ci, true);
> > > + }
> > > + }
> > >
> > > spin_unlock(&ci->i_ceph_lock);
> > >
> > > @@ -2549,8 +2570,9 @@ static void __take_cap_refs(struct ceph_inode_info *ci, int got,
> > > * FIXME: how does a 0 return differ from -EAGAIN?
> > > */
> > > enum {
> > > - NON_BLOCKING = 1,
> > > - CHECK_FILELOCK = 2,
> > > + /* first 8 bits are reserved for CEPH_FILE_MODE_FOO */
> > > + NON_BLOCKING = (1 << 8),
> > > + CHECK_FILELOCK = (1 << 9),
> > > };
> > >
> > > static int try_get_cap_refs(struct inode *inode, int need, int want,
> > > @@ -2560,7 +2582,6 @@ static int try_get_cap_refs(struct inode *inode, int need, int want,
> > > struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
> > > int ret = 0;
> > > int have, implemented;
> > > - int file_wanted;
> > > bool snap_rwsem_locked = false;
> > >
> > > dout("get_cap_refs %p need %s want %s\n", inode,
> > > @@ -2576,15 +2597,6 @@ static int try_get_cap_refs(struct inode *inode, int need, int want,
> > > goto out_unlock;
> > > }
> > >
> > > - /* make sure file is actually open */
> > > - file_wanted = __ceph_caps_file_wanted(ci);
> > > - if ((file_wanted & need) != need) {
> > > - dout("try_get_cap_refs need %s file_wanted %s, EBADF\n",
> > > - ceph_cap_string(need), ceph_cap_string(file_wanted));
> > > - ret = -EBADF;
> > > - goto out_unlock;
> > > - }
> > > -
> > > /* finish pending truncate */
> > > while (ci->i_truncate_pending) {
> > > spin_unlock(&ci->i_ceph_lock);
> > > @@ -2692,6 +2704,9 @@ static int try_get_cap_refs(struct inode *inode, int need, int want,
> > > ceph_cap_string(have), ceph_cap_string(need));
> > > }
> > > out_unlock:
> > > +
> > > + __ceph_touch_fmode(ci, mdsc, flags);
> > > +
> > > spin_unlock(&ci->i_ceph_lock);
> > > if (snap_rwsem_locked)
> > > up_read(&mdsc->snap_rwsem);
> > > @@ -2729,10 +2744,22 @@ static void check_max_size(struct inode *inode, loff_t endoff)
> > > ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
> > > }
> > >
> > > +static inline int get_used_file_mode(int need, int want)
> > > +{
> > > + int fmode = 0;
> > > + if (need & CEPH_CAP_FILE_RD)
> > > + fmode |= CEPH_FILE_MODE_RD;
> > > + if (need & CEPH_CAP_FILE_WR)
> > > + fmode |= CEPH_FILE_MODE_WR;
> > > + if (want & CEPH_CAP_FILE_LAZYIO)
> > > + fmode |= CEPH_FILE_MODE_LAZY;
> > > + return fmode;
> > > +}
> > > +
> > > int ceph_try_get_caps(struct inode *inode, int need, int want,
> > > bool nonblock, int *got)
> > > {
> > > - int ret;
> > > + int ret, flags;
> > >
> > > BUG_ON(need & ~CEPH_CAP_FILE_RD);
> > > BUG_ON(want & ~(CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO|CEPH_CAP_FILE_SHARED));
> > > @@ -2740,8 +2767,11 @@ int ceph_try_get_caps(struct inode *inode, int need, int want,
> > > if (ret < 0)
> > > return ret;
> > >
> > > - ret = try_get_cap_refs(inode, need, want, 0,
> > > - (nonblock ? NON_BLOCKING : 0), got);
> > > + flags = get_used_file_mode(need, want);
> > > + if (nonblock)
> > > + flags |= NON_BLOCKING;
> > > +
> > > + ret = try_get_cap_refs(inode, need, want, 0, flags, got);
> > > return ret == -EAGAIN ? 0 : ret;
> > > }
> > >
> > > @@ -2767,11 +2797,15 @@ int ceph_get_caps(struct file *filp, int need, int want,
> > > fi->filp_gen != READ_ONCE(fsc->filp_gen))
> > > return -EBADF;
> > >
> > > + flags = get_used_file_mode(need, want);
> > > +
> > > while (true) {
> > > if (endoff > 0)
> > > check_max_size(inode, endoff);
> > >
> > > - flags = atomic_read(&fi->num_locks) ? CHECK_FILELOCK : 0;
> > > + flags &= CEPH_FILE_MODE_MASK;
> > > + if (atomic_read(&fi->num_locks))
> > > + flags |= CHECK_FILELOCK;
> > > _got = 0;
> > > ret = try_get_cap_refs(inode, need, want, endoff,
> > > flags, &_got);
> > > @@ -2791,6 +2825,8 @@ int ceph_get_caps(struct file *filp, int need, int want,
> > > list_add(&cw.list, &mdsc->cap_wait_list);
> > > spin_unlock(&mdsc->caps_list_lock);
> > >
> > > + /* make sure used fmode not timeout */
> > > + ceph_get_fmode(ci, flags, FMODE_WAIT_BIAS);
> > > add_wait_queue(&ci->i_cap_wq, &wait);
> > >
> > > flags |= NON_BLOCKING;
> > > @@ -2804,6 +2840,7 @@ int ceph_get_caps(struct file *filp, int need, int want,
> > > }
> > >
> > > remove_wait_queue(&ci->i_cap_wq, &wait);
> > > + ceph_put_fmode(ci, flags, FMODE_WAIT_BIAS);
> > >
> > > spin_lock(&mdsc->caps_list_lock);
> > > list_del(&cw.list);
> > > @@ -2823,7 +2860,7 @@ int ceph_get_caps(struct file *filp, int need, int want,
> > > if (ret < 0) {
> > > if (ret == -ESTALE) {
> > > /* session was killed, try renew caps */
> > > - ret = ceph_renew_caps(inode);
> > > + ret = ceph_renew_caps(inode, flags);
> > > if (ret == 0)
> > > continue;
> > > }
> > > @@ -4121,13 +4158,41 @@ void ceph_flush_dirty_caps(struct ceph_mds_client *mdsc)
> > > dout("flush_dirty_caps done\n");
> > > }
> > >
> > > +void __ceph_touch_fmode(struct ceph_inode_info *ci,
> > > + struct ceph_mds_client *mdsc, int fmode)
> > > +{
> > > + int i;
> > > + int bits = (fmode << 1);
> > > + unsigned long now = jiffies | 1;
> > > + for (i = 1; i < CEPH_FILE_MODE_BITS; i++) {
> > > + if (bits & (1 << i))
> > > + ci->i_file_by_mode[i].last_used = now;
> > > + }
> > > +
> > > + /* queue periodic check */
> > > + if (bits && list_empty(&ci->i_cap_delay_list))
> > > + __cap_delay_requeue(mdsc, ci, true);
> > > +}
> > > +
> > > +void ceph_get_fmode(struct ceph_inode_info *ci, int fmode, int count)
> > > +{
> > > + int i;
> > > + int bits = (fmode << 1) | 1;
> > > + spin_lock(&ci->i_ceph_lock);
> > > + for (i = 0; i < CEPH_FILE_MODE_BITS; i++) {
> > > + if (bits & (1 << i))
> > > + ci->i_file_by_mode[i].nr += count;
> > > + }
> > > + spin_unlock(&ci->i_ceph_lock);
> > > +}
> > > +
> > > void __ceph_get_fmode(struct ceph_inode_info *ci, int fmode)
> > > {
> > > int i;
> > > int bits = (fmode << 1) | 1;
> > > for (i = 0; i < CEPH_FILE_MODE_BITS; i++) {
> > > if (bits & (1 << i))
> > > - ci->i_nr_by_mode[i]++;
> > > + ci->i_file_by_mode[i].nr++;
> > > }
> > > }
> > >
> > > @@ -4136,26 +4201,18 @@ void __ceph_get_fmode(struct ceph_inode_info *ci, int fmode)
> > > * we may need to release capabilities to the MDS (or schedule
> > > * their delayed release).
> > > */
> > > -void ceph_put_fmode(struct ceph_inode_info *ci, int fmode)
> > > +void ceph_put_fmode(struct ceph_inode_info *ci, int fmode, int count)
> > > {
> > > - int i, last = 0;
> > > + int i;
> > > int bits = (fmode << 1) | 1;
> > > spin_lock(&ci->i_ceph_lock);
> > > for (i = 0; i < CEPH_FILE_MODE_BITS; i++) {
> > > if (bits & (1 << i)) {
> > > - BUG_ON(ci->i_nr_by_mode[i] == 0);
> > > - if (--ci->i_nr_by_mode[i] == 0)
> > > - last++;
> > > + BUG_ON(ci->i_file_by_mode[i].nr < count);
> > > + ci->i_file_by_mode[i].nr -= count;
> > > }
> > > }
> > > - dout("put_fmode %p fmode %d {%d,%d,%d,%d}\n",
> > > - &ci->vfs_inode, fmode,
> > > - ci->i_nr_by_mode[0], ci->i_nr_by_mode[1],
> > > - ci->i_nr_by_mode[2], ci->i_nr_by_mode[3]);
> > > spin_unlock(&ci->i_ceph_lock);
> > > -
> > > - if (last && ci->i_vino.snap == CEPH_NOSNAP)
> > > - ceph_check_caps(ci, 0, NULL);
> > > }
> > >
> > > /*
> > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> > > index 7e0190b1f821..f28f420bad23 100644
> > > --- a/fs/ceph/file.c
> > > +++ b/fs/ceph/file.c
> > > @@ -213,7 +213,7 @@ static int ceph_init_file_info(struct inode *inode, struct file *file,
> > > struct ceph_dir_file_info *dfi =
> > > kmem_cache_zalloc(ceph_dir_file_cachep, GFP_KERNEL);
> > > if (!dfi) {
> > > - ceph_put_fmode(ci, fmode); /* clean up */
> > > + ceph_put_fmode(ci, fmode, 1); /* clean up */
> > > return -ENOMEM;
> > > }
> > >
> > > @@ -224,7 +224,7 @@ static int ceph_init_file_info(struct inode *inode, struct file *file,
> > > } else {
> > > fi = kmem_cache_zalloc(ceph_file_cachep, GFP_KERNEL);
> > > if (!fi) {
> > > - ceph_put_fmode(ci, fmode); /* clean up */
> > > + ceph_put_fmode(ci, fmode, 1); /* clean up */
> > > return -ENOMEM;
> > > }
> > >
> > > @@ -263,7 +263,7 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode)
> > > case S_IFLNK:
> > > dout("init_file %p %p 0%o (symlink)\n", inode, file,
> > > inode->i_mode);
> > > - ceph_put_fmode(ceph_inode(inode), fmode); /* clean up */
> > > + ceph_put_fmode(ceph_inode(inode), fmode, 1); /* clean up */
> > > break;
> > >
> > > default:
> > > @@ -273,7 +273,7 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode)
> > > * we need to drop the open ref now, since we don't
> > > * have .release set to ceph_release.
> > > */
> > > - ceph_put_fmode(ceph_inode(inode), fmode); /* clean up */
> > > + ceph_put_fmode(ceph_inode(inode), fmode, 1); /* clean up */
> > > BUG_ON(inode->i_fop->release == ceph_release);
> > >
> > > /* call the proper open fop */
> > > @@ -285,14 +285,15 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode)
> > > /*
> > > * try renew caps after session gets killed.
> > > */
> > > -int ceph_renew_caps(struct inode *inode)
> > > +int ceph_renew_caps(struct inode *inode, int fmode)
> > > {
> > > - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
> > > + struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
> > > struct ceph_inode_info *ci = ceph_inode(inode);
> > > struct ceph_mds_request *req;
> > > int err, flags, wanted;
> > >
> > > spin_lock(&ci->i_ceph_lock);
> > > + __ceph_touch_fmode(ci, mdsc, fmode);
> > > wanted = __ceph_caps_file_wanted(ci);
> > > if (__ceph_is_any_real_caps(ci) &&
> > > (!(wanted & CEPH_CAP_ANY_WR) || ci->i_auth_cap)) {
> > > @@ -405,6 +406,7 @@ int ceph_open(struct inode *inode, struct file *file)
> > > } else if (ceph_snap(inode) != CEPH_NOSNAP &&
> > > (ci->i_snap_caps & wanted) == wanted) {
> > > __ceph_get_fmode(ci, fmode);
> > > + __ceph_touch_fmode(ci, mdsc, fmode);
> > > spin_unlock(&ci->i_ceph_lock);
> > > return ceph_init_file(inode, file, fmode);
> > > }
> > > @@ -525,7 +527,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
> > > }
> > > out_req:
> > > if (!req->r_err && req->r_target_inode)
> > > - ceph_put_fmode(ceph_inode(req->r_target_inode), req->r_fmode);
> > > + ceph_put_fmode(ceph_inode(req->r_target_inode), req->r_fmode, 1);
> > > ceph_mdsc_put_request(req);
> > > out_ctx:
> > > ceph_release_acl_sec_ctx(&as_ctx);
> > > @@ -542,7 +544,7 @@ int ceph_release(struct inode *inode, struct file *file)
> > > dout("release inode %p dir file %p\n", inode, file);
> > > WARN_ON(!list_empty(&dfi->file_info.rw_contexts));
> > >
> > > - ceph_put_fmode(ci, dfi->file_info.fmode);
> > > + ceph_put_fmode(ci, dfi->file_info.fmode, 1);
> > >
> > > if (dfi->last_readdir)
> > > ceph_mdsc_put_request(dfi->last_readdir);
> > > @@ -554,7 +556,8 @@ int ceph_release(struct inode *inode, struct file *file)
> > > dout("release inode %p regular file %p\n", inode, file);
> > > WARN_ON(!list_empty(&fi->rw_contexts));
> > >
> > > - ceph_put_fmode(ci, fi->fmode);
> > > + ceph_put_fmode(ci, fi->fmode, 1);
> > > +
> > > kmem_cache_free(ceph_file_cachep, fi);
> > > }
> > >
> > > @@ -1560,7 +1563,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
> > > if (dirty)
> > > __mark_inode_dirty(inode, dirty);
> > > if (ceph_quota_is_max_bytes_approaching(inode, iocb->ki_pos))
> > > - ceph_check_caps(ci, CHECK_CAPS_NODELAY, NULL);
> > > + ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
> > > }
> > >
> > > dout("aio_write %p %llx.%llx %llu~%u dropping cap refs on %s\n",
> > > diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> > > index 094b8fc37787..b279bd8e168e 100644
> > > --- a/fs/ceph/inode.c
> > > +++ b/fs/ceph/inode.c
> > > @@ -478,8 +478,10 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
> > > ci->i_head_snapc = NULL;
> > > ci->i_snap_caps = 0;
> > >
> > > - for (i = 0; i < CEPH_FILE_MODE_BITS; i++)
> > > - ci->i_nr_by_mode[i] = 0;
> > > + for (i = 0; i < CEPH_FILE_MODE_BITS; i++) {
> > > + ci->i_file_by_mode[i].nr = 0;
> > > + ci->i_file_by_mode[i].last_used = 0;
> > > + }
> > >
> > > mutex_init(&ci->i_truncate_mutex);
> > > ci->i_truncate_seq = 0;
> > > @@ -637,7 +639,7 @@ int ceph_fill_file_size(struct inode *inode, int issued,
> > > if ((issued & (CEPH_CAP_FILE_CACHE|
> > > CEPH_CAP_FILE_BUFFER)) ||
> > > mapping_mapped(inode->i_mapping) ||
> > > - __ceph_caps_file_wanted(ci)) {
> > > + __ceph_is_file_opened(ci)) {
> > > ci->i_truncate_pending++;
> > > queue_trunc = 1;
> > > }
> > > @@ -1010,6 +1012,13 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
> > > fill_inline = true;
> > > }
> > >
> > > + if (cap_fmode >= 0) {
> > > + if (!info_caps)
> > > + pr_warn("mds issued no caps on %llx.%llx\n",
> > > + ceph_vinop(inode));
> > > + __ceph_touch_fmode(ci, mdsc, cap_fmode);
> > > + }
> > > +
> > > spin_unlock(&ci->i_ceph_lock);
> > >
> > > if (fill_inline)
> > > diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
> > > index c90f03beb15d..da0ee54ae5bc 100644
> > > --- a/fs/ceph/ioctl.c
> > > +++ b/fs/ceph/ioctl.c
> > > @@ -243,11 +243,13 @@ static long ceph_ioctl_lazyio(struct file *file)
> > > struct ceph_file_info *fi = file->private_data;
> > > struct inode *inode = file_inode(file);
> > > struct ceph_inode_info *ci = ceph_inode(inode);
> > > + struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
> > >
> > > if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) {
> > > spin_lock(&ci->i_ceph_lock);
> > > fi->fmode |= CEPH_FILE_MODE_LAZY;
> > > - ci->i_nr_by_mode[ffs(CEPH_FILE_MODE_LAZY)]++;
> > > + ci->i_file_by_mode[ffs(CEPH_FILE_MODE_LAZY)].nr++;
> > > + __ceph_touch_fmode(ci, mdsc, CEPH_FILE_MODE_LAZY);
> > > spin_unlock(&ci->i_ceph_lock);
> > > dout("ioctl_layzio: file %p marked lazy\n", file);
> > >
> > > diff --git a/fs/ceph/super.h b/fs/ceph/super.h
> > > index d370f89df358..029823643b8b 100644
> > > --- a/fs/ceph/super.h
> > > +++ b/fs/ceph/super.h
> > > @@ -361,7 +361,10 @@ struct ceph_inode_info {
> > > dirty|flushing caps */
> > > unsigned i_snap_caps; /* cap bits for snapped files */
> > >
> > > - int i_nr_by_mode[CEPH_FILE_MODE_BITS]; /* open file counts */
> > > + struct {
> > > + int nr;
> > > + unsigned long last_used;
> > > + } i_file_by_mode[CEPH_FILE_MODE_BITS]; /* open file counts */
> > >
> >
> > Ok, so we're growing ceph_inode_info by 40 bytes here (on 64-bit arch).
> >
> > That's quite a bit, actually, but it turns out that there are 32 bytes
> > worth of holes in ceph_inode_info now. It'd be good to reorganize the
> > struct for better packing before you do this, so that this at least
> > won't make memory consumption too much worse.
> >
> > There other ways we could approach this too that would be more space
> > efficient. We don't really need to keep a timestamp for each mode bit.
> > All we're really interested in is what modes were used in the last time
> > interval.
> >
> > We could keep an active and inactive set of CEPH_FILE_MODE bits (which
> > are just a single byte each), and a timestamp representing the switch
> > between the two.
> >
> > As we use the file, we'd set bits in the active mask if the timestamp is
> > less than half the time interval old. If it's more than half the
> > interval, copy the active mask to the inactive one and zero out the
> > active mask first.
> >
> > When you go to check what modes have been used you can do the switch
> > again first if the timestamp is too old. To see what bits were actually
> > used, you just logically or the activ You could couple this with
> > something that requeues e and inactive sets together.
> >
> > That would take a lot less space per inode.
>
> The problem is there is no reliable tick for interval.
I handwaved over that part, but you could ensure that it was revisited
in a timely fashion the same way as here. Just call __cap_delay_requeue
at each active/inactive switch event.
You might not end up with a hard timeout for each individual bit, but
I'm not sure that's really required to fix this problem. There may also
be benefits in keeping the timeouts "looser" -- more opportunities to
batch up cap releases when there are spiky, mixed read/write workloads.
> besides, we can
> not have patch 4 if use active bit. patch 4 simplifies code a lot. I
> really like to keep it. we can just track last use of read/write,
> which uses 16 bytes. this patch removes i_hold_caps_min. So only need
> 8 more bytes.
Ok, I do like the last two patches in the series a lot.
Don't you also need to timestamp LAZY too if you do it this way? If you
have a mix of lazy and nonlazy clients and the lazy one is holding the
cap w/o using it, that seems like it could be the same problem all over
again.
> > > struct mutex i_truncate_mutex;
> > > u32 i_truncate_seq; /* last truncate to smaller size */
> > > @@ -673,6 +676,10 @@ extern int __ceph_caps_revoking_other(struct ceph_inode_info *ci,
> > > extern int ceph_caps_revoking(struct ceph_inode_info *ci, int mask);
> > > extern int __ceph_caps_used(struct ceph_inode_info *ci);
> > >
> > > +static inline bool __ceph_is_file_opened(struct ceph_inode_info *ci)
> > > +{
> > > + return ci->i_file_by_mode[0].nr;
> > > +}
> > > extern int __ceph_caps_file_wanted(struct ceph_inode_info *ci);
> > > extern int __ceph_caps_wanted(struct ceph_inode_info *ci);
> > >
> > > @@ -1074,7 +1081,10 @@ extern int ceph_try_get_caps(struct inode *inode,
> > >
> > > /* for counting open files by mode */
> > > extern void __ceph_get_fmode(struct ceph_inode_info *ci, int mode);
> > > -extern void ceph_put_fmode(struct ceph_inode_info *ci, int mode);
> > > +extern void ceph_get_fmode(struct ceph_inode_info *ci, int mode, int count);
> > > +extern void ceph_put_fmode(struct ceph_inode_info *ci, int mode, int count);
> > > +extern void __ceph_touch_fmode(struct ceph_inode_info *ci,
> > > + struct ceph_mds_client *mdsc, int fmode);
> > >
> > > /* addr.c */
> > > extern const struct address_space_operations ceph_aops;
> > > @@ -1086,7 +1096,7 @@ extern void ceph_pool_perm_destroy(struct ceph_mds_client* mdsc);
> > > /* file.c */
> > > extern const struct file_operations ceph_file_fops;
> > >
> > > -extern int ceph_renew_caps(struct inode *inode);
> > > +extern int ceph_renew_caps(struct inode *inode, int fmode);
> > > extern int ceph_open(struct inode *inode, struct file *file);
> > > extern int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
> > > struct file *file, unsigned flags, umode_t mode);
> > > diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
> > > index cb21c5cf12c3..8017130a08a1 100644
> > > --- a/include/linux/ceph/ceph_fs.h
> > > +++ b/include/linux/ceph/ceph_fs.h
> > > @@ -564,6 +564,7 @@ struct ceph_filelock {
> > > #define CEPH_FILE_MODE_RDWR 3 /* RD | WR */
> > > #define CEPH_FILE_MODE_LAZY 4 /* lazy io */
> > > #define CEPH_FILE_MODE_BITS 4
> > > +#define CEPH_FILE_MODE_MASK ((1 << CEPH_FILE_MODE_BITS) - 1)
> > >
> > > int ceph_flags_to_mode(int flags);
> > >
> >
> > --
> > Jeff Layton <jlayton@kernel.org>
> >
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply
* Re: omap-secure.c:undefined reference to `__arm_smccc_smc'
From: Tony Lindgren @ 2020-02-20 16:20 UTC (permalink / raw)
To: kbuild-all
In-Reply-To: <55ddcd29-ed8b-529e-dd54-cbac5cf74e42@ti.com>
[-- Attachment #1: Type: text/plain, Size: 2481 bytes --]
* Andrew F. Davis <afd@ti.com> [200220 16:04]:
> On 2/20/20 10:54 AM, Tony Lindgren wrote:
> > Andrew,
> >
> > * kbuild test robot <lkp@intel.com> [200213 10:27]:
> >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >> head: 0bf999f9c5e74c7ecf9dafb527146601e5c848b9
> >> commit: c37baa06f8a970e4a533d41f7d33e5e57de5ad25 ARM: OMAP2+: Fix undefined reference to omap_secure_init
> >> date: 3 weeks ago
> >> config: arm-randconfig-a001-20200213 (attached as .config)
> >> compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
> >> reproduce:
> >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >> chmod +x ~/bin/make.cross
> >> git checkout c37baa06f8a970e4a533d41f7d33e5e57de5ad25
> >> # save the attached .config to linux build tree
> >> GCC_VERSION=7.5.0 make.cross ARCH=arm
> >>
> >> If you fix the issue, kindly add following tag
> >> Reported-by: kbuild test robot <lkp@intel.com>
> >>
> >> All errors (new ones prefixed by >>):
> >>
> >> arch/arm/mach-omap2/omap-secure.o: In function `omap_smccc_smc':
> >>>> omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >
> > Have you looked at this one? Looks like there's still an unhandled
> > randconfig build case.
> >
>
>
> I've had a quick look, all the ARM config does:
>
> select HAVE_ARM_SMCCC if CPU_V7
>
> so I don't think this will happen in any real config, but if we want to
> prevent randconfig issue this we could force ARCH_OMAP2PLUS to "depend"
> on it.
Seems to happen at least with omap2 only config where we don't have
CPU_V7. Something like below seems to fix it.
If that looks OK to you, I'll send out a proper fix.
Regards,
Tony
8< -----------------------
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -77,6 +77,7 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
return ret;
}
+#ifdef CONFIG_HAVE_ARM_SMCCC
void omap_smccc_smc(u32 fn, u32 arg)
{
struct arm_smccc_res res;
@@ -85,6 +86,11 @@ void omap_smccc_smc(u32 fn, u32 arg)
0, 0, 0, 0, 0, 0, &res);
WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
}
+#else
+void omap_smccc_smc(u32 fn, u32 arg)
+{
+}
+#endif
void omap_smc1(u32 fn, u32 arg)
{
^ permalink raw reply
* Re: [Xen-devel] [PATCH v6 1/6] libxl: add infrastructure to track and query 'recent' domids
From: Ian Jackson @ 2020-02-20 16:19 UTC (permalink / raw)
To: Paul Durrant; +Cc: Anthony Perard, xen-devel@lists.xenproject.org, Wei Liu
In-Reply-To: <20200219093754.2924-2-pdurrant@amazon.com>
Paul Durrant writes ("[PATCH v6 1/6] libxl: add infrastructure to track and query 'recent' domids"):
> A domid is considered recent if the domain it represents was destroyed
> less than a specified number of seconds ago. For debugging and/or testing
> purposes the number can be set using the environment variable
> LIBXL_DOMID_REUSE_TIMEOUT. If the variable does not exist then a default
> value of 60s is used.
...
Quoting only the parts which are neither specific to the particular
function, nor calls to the functions into which common code has
currently been moved:
> +static int libxl__mark_domid_recent(libxl__gc *gc, uint32_t domid)
> +{
+ long timeout = libxl__get_domid_reuse_timeout();
...
> + if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
> + LOGED(ERROR, domid, "failed to get time");
> + goto out;
> + }
...
> + if (ts.tv_sec - sec > timeout)
> + continue; /* Ignore expired entries */
> +int libxl__is_domid_recent(libxl__gc *gc, uint32_t domid, bool *recent)
> +{
> + long timeout = libxl__get_domid_reuse_timeout();
...
> + if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
> + LOGED(ERROR, domid, "failed to get time");
> + goto out;
> + }
...
> + if (val == domid && ts.tv_sec - sec <= timeout) {
I'm afraid I am still making style comments:
IMO the reuse timeout call and the clock_gettime call should be put in
libxl__open_domid_history; and the time filtering check should be
folded into libxl__read_recent.
In my review of v4 I wrote:
Do you think this can be combined somehow ? Possibilities seem to
include: explicit read_recent_{init,entry,finish} functions; a single
function with a "per-entry" callback; same but with a macro. If you
do that you can also have it have handle the "file does not exist"
special case.
You've provided the read_recent_entry function but the "init" function
libxl__open_domid_history does too little. This series seems to be
moving towards what I called read_recent_{init,entry,finish} (which
should probably have the timestamp and FILE* in a struct together) but
it seems to be doing so quite slowly.
In your factored out functions you generally do this:
int some_function(){
r = do_the_thing();
if (r == 0) return 0;
LOGE(....)
return ERROR_FAIL;
}
This structure is not ideal because:
- It makes it hard to extend this function to do more, later.
For example, refactoring the clock_gettime call into
what is now libxl__open_domid_history would involve reorganising
the function.
- It encourages vacuous log messages whose content is mainly in the
function and line number framing:
+ LOGE(ERROR, "failed");
+ return ERROR_FAIL;
+}
rather than
if (!*f) {
LOGE(ERROR, "failed to open recent domid file `%s'", path);
rc = ERROR_FAIL;
goto out;
}
(and the latter is to be preferred).
- It is nonstandard. See ERROR_HANDLING in CODING_STYLE.
> + ret = fclose(nf);
This should be called `r', not `ret'. See CODING_STYLE.
Sorry that some of the other code which you are having to edit here
sets a bad example. (See the apology at the top of CODING_STYLE.)
(Existing uses of `ret' in libxl are sometimes a syscall return value
and sometimes a libxl error code, which is one reason that name is now
deprecated.)
> +static int libxl__replace_domid_history(libxl__gc *gc, char *new)
> +{
For the record: it was not necessary to break this out into its own
function, because there is only one call site, so open-coding it would
not duplicate anything. On the other hand if you think it is clearer,
I have no objection.
I think the actual behaviour is correct now but I would like to read
it again when it is in the conventional style.
Thanks
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply
* [PULL 13/18] iscsi: Drop iscsi_co_create_opts()
From: Max Reitz @ 2020-02-20 16:07 UTC (permalink / raw)
To: qemu-block; +Cc: Kevin Wolf, Peter Maydell, qemu-devel, Max Reitz
In-Reply-To: <20200220160710.533297-1-mreitz@redhat.com>
The generic fallback implementation effectively does the same.
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200122164532.178040-5-mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/iscsi.c | 56 ---------------------------------------------------
1 file changed, 56 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index c8feaa2f0e..682abd8e09 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -2164,58 +2164,6 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
return 0;
}
-static int coroutine_fn iscsi_co_create_opts(const char *filename, QemuOpts *opts,
- Error **errp)
-{
- int ret = 0;
- int64_t total_size = 0;
- BlockDriverState *bs;
- IscsiLun *iscsilun = NULL;
- QDict *bs_options;
- Error *local_err = NULL;
-
- bs = bdrv_new();
-
- /* Read out options */
- total_size = DIV_ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0),
- BDRV_SECTOR_SIZE);
- bs->opaque = g_new0(struct IscsiLun, 1);
- iscsilun = bs->opaque;
-
- bs_options = qdict_new();
- iscsi_parse_filename(filename, bs_options, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- ret = -EINVAL;
- } else {
- ret = iscsi_open(bs, bs_options, 0, NULL);
- }
- qobject_unref(bs_options);
-
- if (ret != 0) {
- goto out;
- }
- iscsi_detach_aio_context(bs);
- if (iscsilun->type != TYPE_DISK) {
- ret = -ENODEV;
- goto out;
- }
- if (bs->total_sectors < total_size) {
- ret = -ENOSPC;
- goto out;
- }
-
- ret = 0;
-out:
- if (iscsilun->iscsi != NULL) {
- iscsi_destroy_context(iscsilun->iscsi);
- }
- g_free(bs->opaque);
- bs->opaque = NULL;
- bdrv_unref(bs);
- return ret;
-}
-
static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
{
IscsiLun *iscsilun = bs->opaque;
@@ -2486,8 +2434,6 @@ static BlockDriver bdrv_iscsi = {
.bdrv_parse_filename = iscsi_parse_filename,
.bdrv_file_open = iscsi_open,
.bdrv_close = iscsi_close,
- .bdrv_co_create_opts = iscsi_co_create_opts,
- .create_opts = &iscsi_create_opts,
.bdrv_reopen_prepare = iscsi_reopen_prepare,
.bdrv_reopen_commit = iscsi_reopen_commit,
.bdrv_co_invalidate_cache = iscsi_co_invalidate_cache,
@@ -2525,8 +2471,6 @@ static BlockDriver bdrv_iser = {
.bdrv_parse_filename = iscsi_parse_filename,
.bdrv_file_open = iscsi_open,
.bdrv_close = iscsi_close,
- .bdrv_co_create_opts = iscsi_co_create_opts,
- .create_opts = &iscsi_create_opts,
.bdrv_reopen_prepare = iscsi_reopen_prepare,
.bdrv_reopen_commit = iscsi_reopen_commit,
.bdrv_co_invalidate_cache = iscsi_co_invalidate_cache,
--
2.24.1
^ permalink raw reply related
* Re: [PATCH liburing] man/io_uring_setup.2: fix 'sq_thread_idle' description
From: Jens Axboe @ 2020-02-20 16:19 UTC (permalink / raw)
To: Stefano Garzarella; +Cc: io-uring, linux-kernel
In-Reply-To: <20200220140833.108791-1-sgarzare@redhat.com>
On 2/20/20 7:08 AM, Stefano Garzarella wrote:
> In the kernel we are using msecs_to_jiffies() to convert the
> 'sq_thread_idle' parameter, provided by the user, in jiffies.
> So, the value is interpreted in milliseconds and not microseconds.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply
* [PULL 18/18] iotests: Test snapshot -l field separation
From: Max Reitz @ 2020-02-20 16:07 UTC (permalink / raw)
To: qemu-block; +Cc: Kevin Wolf, Peter Maydell, qemu-devel, Max Reitz
In-Reply-To: <20200220160710.533297-1-mreitz@redhat.com>
Add a test that all fields in "qemu-img snapshot -l"s output are
separated by spaces.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200117105859.241818-3-mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[mreitz: Renamed test from 284 to 286]
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/286 | 76 ++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/286.out | 8 ++++
tests/qemu-iotests/group | 1 +
3 files changed, 85 insertions(+)
create mode 100755 tests/qemu-iotests/286
create mode 100644 tests/qemu-iotests/286.out
diff --git a/tests/qemu-iotests/286 b/tests/qemu-iotests/286
new file mode 100755
index 0000000000..f14445ba4a
--- /dev/null
+++ b/tests/qemu-iotests/286
@@ -0,0 +1,76 @@
+#!/usr/bin/env bash
+#
+# Test qemu-img snapshot -l
+#
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+seq=$(basename "$0")
+echo "QA output created by $seq"
+
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.qemu
+
+_supported_fmt qcow2
+_supported_proto file
+# Internal snapshots are (currently) impossible with refcount_bits=1,
+# and generally impossible with external data files
+_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+
+_make_test_img 64M
+
+# Should be so long as to take up the whole field width
+sn_name=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+# More memory will give us a larger VM state, i.e. one above 1 MB.
+# This way, we get a number with a decimal point.
+qemu_comm_method=monitor _launch_qemu -m 512 "$TEST_IMG"
+
+_send_qemu_cmd $QEMU_HANDLE "savevm $sn_name" '(qemu)'
+_send_qemu_cmd $QEMU_HANDLE 'quit' '(qemu)'
+wait=yes _cleanup_qemu
+
+# Check that all fields are separated by spaces.
+# We first collapse all space sequences into one space each;
+# then we turn every space-separated field into a '.';
+# and finally, we name the '.'s so the output is not just a confusing
+# sequence of dots.
+
+echo 'Output structure:'
+$QEMU_IMG snapshot -l "$TEST_IMG" | tail -n 1 | tr -s ' ' \
+ | sed -e 's/\S\+/./g' \
+ | sed -e 's/\./(snapshot ID)/' \
+ -e 's/\./(snapshot name)/' \
+ -e 's/\./(VM state size value)/' \
+ -e 's/\./(VM state size unit)/' \
+ -e 's/\./(snapshot date)/' \
+ -e 's/\./(snapshot time)/' \
+ -e 's/\./(VM clock)/'
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/286.out b/tests/qemu-iotests/286.out
new file mode 100644
index 0000000000..39ff07e12c
--- /dev/null
+++ b/tests/qemu-iotests/286.out
@@ -0,0 +1,8 @@
+QA output created by 286
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) savevm abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+(qemu) quit
+Output structure:
+(snapshot ID) (snapshot name) (VM state size value) (VM state size unit) (snapshot date) (snapshot time) (VM clock)
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index b17711d17d..0317667695 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -292,3 +292,4 @@
281 rw quick
283 auto quick
284 rw
+286 rw quick
--
2.24.1
^ permalink raw reply related
* Re: [Freedreno] [PATCH v6] arm64: dts: qcom: sc7180: Add A618 gpu dt blob
From: Rob Clark @ 2020-02-20 16:19 UTC (permalink / raw)
To: Sharat Masetty
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Linux Kernel Mailing List, Douglas Anderson, Bjorn Andersson,
Matthias Kaehlcke, dri-devel, linux-arm-msm, freedreno
In-Reply-To: <1581320465-15854-2-git-send-email-smasetty@codeaurora.org>
On Sun, Feb 9, 2020 at 11:41 PM Sharat Masetty <smasetty@codeaurora.org> wrote:
>
> This patch adds the required dt nodes and properties
> to enabled A618 GPU.
>
> Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
> ---
> arch/arm64/boot/dts/qcom/sc7180.dtsi | 102 +++++++++++++++++++++++++++++++++++
> 1 file changed, 102 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> index f3fcc5c..63fff15 100644
> --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> @@ -1043,6 +1043,108 @@
> };
> };
>
> + gpu: gpu@5000000 {
> + compatible = "qcom,adreno-618.0", "qcom,adreno";
> + #stream-id-cells = <16>;
> + reg = <0 0x05000000 0 0x40000>, <0 0x0509e000 0 0x1000>,
> + <0 0x05061000 0 0x800>;
> + reg-names = "kgsl_3d0_reg_memory", "cx_mem", "cx_dbgc";
> + interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;
> + iommus = <&adreno_smmu 0>;
> + operating-points-v2 = <&gpu_opp_table>;
> + qcom,gmu = <&gmu>;
> +
> + gpu_opp_table: opp-table {
> + compatible = "operating-points-v2";
> +
> + opp-800000000 {
> + opp-hz = /bits/ 64 <800000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
> + };
> +
> + opp-650000000 {
> + opp-hz = /bits/ 64 <650000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
> + };
> +
> + opp-565000000 {
> + opp-hz = /bits/ 64 <565000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
> + };
> +
> + opp-430000000 {
> + opp-hz = /bits/ 64 <430000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
> + };
> +
> + opp-355000000 {
> + opp-hz = /bits/ 64 <355000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
> + };
> +
> + opp-267000000 {
> + opp-hz = /bits/ 64 <267000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
> + };
> +
> + opp-180000000 {
> + opp-hz = /bits/ 64 <180000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
> + };
> + };
> + };
> +
> + adreno_smmu: iommu@5040000 {
> + compatible = "qcom,sc7180-smmu-v2", "qcom,smmu-v2";
> + reg = <0 0x05040000 0 0x10000>;
> + #iommu-cells = <1>;
> + #global-interrupts = <2>;
> + interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 364 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 365 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 366 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 367 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 368 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 369 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 370 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 371 IRQ_TYPE_EDGE_RISING>;
> + clocks = <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
> + <&gcc GCC_GPU_CFG_AHB_CLK>,
> + <&gcc GCC_DDRSS_GPU_AXI_CLK>;
> +
> + clock-names = "bus", "iface", "mem_iface_clk";
> + power-domains = <&gpucc CX_GDSC>;
> + };
> +
> + gmu: gmu@506a000 {
> + compatible="qcom,adreno-gmu-618.0", "qcom,adreno-gmu";
> + reg = <0 0x0506a000 0 0x31000>, <0 0x0b290000 0 0x10000>,
> + <0 0x0b490000 0 0x10000>;
> + reg-names = "gmu", "gmu_pdc", "gmu_pdc_seq";
> + interrupts = <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "hfi", "gmu";
> + clocks = <&gpucc GPU_CC_CX_GMU_CLK>,
> + <&gpucc GPU_CC_CXO_CLK>,
> + <&gcc GCC_DDRSS_GPU_AXI_CLK>,
> + <&gcc GCC_GPU_MEMNOC_GFX_CLK>;
> + clock-names = "gmu", "cxo", "axi", "memnoc";
> + power-domains = <&gpucc CX_GDSC>, <&gpucc GX_GDSC>;
> + power-domain-names = "cx", "gx";
> + iommus = <&adreno_smmu 5>;
> + operating-points-v2 = <&gmu_opp_table>;
jfyi, this will shortly require a dma-ranges property[1].. it might
simplify things, wrt. to which order patches land (this vs dma-ranges)
to go ahead and add the dma-ranges property now
BR,
-R
[1] https://lists.freedesktop.org/archives/freedreno/2020-February/006903.html
> +
> + gmu_opp_table: opp-table {
> + compatible = "operating-points-v2";
> +
> + opp-200000000 {
> + opp-hz = /bits/ 64 <200000000>;
> + opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
> + };
> + };
> + };
> +
> gpucc: clock-controller@5090000 {
> compatible = "qcom,sc7180-gpucc";
> reg = <0 0x05090000 0 0x9000>;
> --
> 1.9.1
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.