* Re: [PATCH 8/8] iio: gyro: mpu3050: Use new PM macros
From: Paul Cercueil @ 2022-01-05 10:17 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Rafael J . Wysocki, Ulf Hansson, Jonathan Cameron,
Lars-Peter Clausen, Linus Walleij, Arnd Bergmann, Len Brown,
Pavel Machek, list, linux-iio, linux-kernel, linux-mips,
linux-mmc, linux-pm
In-Reply-To: <20220105101106.00005ae0@Huawei.com>
Le mer., janv. 5 2022 at 10:11:06 +0000, Jonathan Cameron
<Jonathan.Cameron@Huawei.com> a écrit :
> On Tue, 4 Jan 2022 21:42:14 +0000
> Paul Cercueil <paul@crapouillou.net> wrote:
>
>> Use the new EXPORT_RUNTIME_DEV_PM_OPS() macro. It allows the
>> underlying
>> dev_pm_ops struct as well as the suspend/resume callbacks to be
>> detected
>> as dead code in the case where CONFIG_PM is disabled, without
>> having to
>> wrap everything inside #ifdef CONFIG_PM guards.
>>
>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>
> Hohum - bad choice of example. These shouldn't be exported as only
> used within
> the same module ;) No one ever wrote the other bus interface (and
> the part is
> ancient so I can't see it happening now) hence whilst there are two
> files, they
> are built into a single module. There is a comment about this in the
> Makefile.
Ok - then I'll drop this patch and try to find a better driver to
showcase this.
Cheers,
-Paul
>> ---
>> drivers/iio/gyro/mpu3050-core.c | 13 ++++---------
>> drivers/iio/gyro/mpu3050-i2c.c | 2 +-
>> 2 files changed, 5 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/iio/gyro/mpu3050-core.c
>> b/drivers/iio/gyro/mpu3050-core.c
>> index ea387efab62d..7d6721e268fe 100644
>> --- a/drivers/iio/gyro/mpu3050-core.c
>> +++ b/drivers/iio/gyro/mpu3050-core.c
>> @@ -1281,7 +1281,6 @@ int mpu3050_common_remove(struct device *dev)
>> }
>> EXPORT_SYMBOL(mpu3050_common_remove);
>>
>> -#ifdef CONFIG_PM
>> static int mpu3050_runtime_suspend(struct device *dev)
>> {
>> return mpu3050_power_down(iio_priv(dev_get_drvdata(dev)));
>> @@ -1291,15 +1290,11 @@ static int mpu3050_runtime_resume(struct
>> device *dev)
>> {
>> return mpu3050_power_up(iio_priv(dev_get_drvdata(dev)));
>> }
>> -#endif /* CONFIG_PM */
>>
>> -const struct dev_pm_ops mpu3050_dev_pm_ops = {
>> - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
>> - pm_runtime_force_resume)
>> - SET_RUNTIME_PM_OPS(mpu3050_runtime_suspend,
>> - mpu3050_runtime_resume, NULL)
>> -};
>> -EXPORT_SYMBOL(mpu3050_dev_pm_ops);
>> +EXPORT_RUNTIME_DEV_PM_OPS(mpu3050_dev_pm_ops,
>> + mpu3050_runtime_suspend,
>> + mpu3050_runtime_resume,
>> + NULL);
>>
>> MODULE_AUTHOR("Linus Walleij");
>> MODULE_DESCRIPTION("MPU3050 gyroscope driver");
>> diff --git a/drivers/iio/gyro/mpu3050-i2c.c
>> b/drivers/iio/gyro/mpu3050-i2c.c
>> index ef5bcbc4b45b..820133cad601 100644
>> --- a/drivers/iio/gyro/mpu3050-i2c.c
>> +++ b/drivers/iio/gyro/mpu3050-i2c.c
>> @@ -114,7 +114,7 @@ static struct i2c_driver mpu3050_i2c_driver = {
>> .driver = {
>> .of_match_table = mpu3050_i2c_of_match,
>> .name = "mpu3050-i2c",
>> - .pm = &mpu3050_dev_pm_ops,
>> + .pm = pm_ptr(&mpu3050_dev_pm_ops),
>> },
>> };
>> module_i2c_driver(mpu3050_i2c_driver);
>
^ permalink raw reply
* [libvirt test] 167607: regressions - FAIL
From: osstest service owner @ 2022-01-05 10:17 UTC (permalink / raw)
To: xen-devel
flight 167607 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/167607/
Regressions :-(
Tests which did not succeed and are blocking,
including tests which could not be run:
build-armhf-libvirt 6 libvirt-build fail REGR. vs. 151777
build-amd64-libvirt 6 libvirt-build fail REGR. vs. 151777
build-arm64-libvirt 6 libvirt-build fail REGR. vs. 151777
build-i386-libvirt 6 libvirt-build fail REGR. vs. 151777
Tests which did not succeed, but are not blocking:
test-amd64-amd64-libvirt 1 build-check(1) blocked n/a
test-amd64-amd64-libvirt-pair 1 build-check(1) blocked n/a
test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 1 build-check(1) blocked n/a
test-amd64-amd64-libvirt-vhd 1 build-check(1) blocked n/a
test-amd64-amd64-libvirt-xsm 1 build-check(1) blocked n/a
test-amd64-i386-libvirt 1 build-check(1) blocked n/a
test-amd64-i386-libvirt-pair 1 build-check(1) blocked n/a
test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 1 build-check(1) blocked n/a
test-amd64-i386-libvirt-raw 1 build-check(1) blocked n/a
test-amd64-i386-libvirt-xsm 1 build-check(1) blocked n/a
test-arm64-arm64-libvirt 1 build-check(1) blocked n/a
test-arm64-arm64-libvirt-qcow2 1 build-check(1) blocked n/a
test-arm64-arm64-libvirt-raw 1 build-check(1) blocked n/a
test-armhf-armhf-libvirt-raw 1 build-check(1) blocked n/a
test-arm64-arm64-libvirt-xsm 1 build-check(1) blocked n/a
test-armhf-armhf-libvirt 1 build-check(1) blocked n/a
test-armhf-armhf-libvirt-qcow2 1 build-check(1) blocked n/a
version targeted for testing:
libvirt c4b3e26d67efa88f69a483857c6ce233fc4e4ac3
baseline version:
libvirt 2c846fa6bcc11929c9fb857a22430fb9945654ad
Last test of basis 151777 2020-07-10 04:19:19 Z 544 days
Failing since 151818 2020-07-11 04:18:52 Z 543 days 525 attempts
Testing same since 167607 2022-01-05 04:19:00 Z 0 days 1 attempts
------------------------------------------------------------
People who touched revisions under test:
Adolfo Jayme Barrientos <fitoschido@gmail.com>
Aleksandr Alekseev <alexander.alekseev@virtuozzo.com>
Aleksei Zakharov <zaharov@selectel.ru>
Andika Triwidada <andika@gmail.com>
Andrea Bolognani <abologna@redhat.com>
Ani Sinha <ani@anisinha.ca>
Balázs Meskó <meskobalazs@mailbox.org>
Barrett Schonefeld <bschoney@utexas.edu>
Bastian Germann <bastiangermann@fishpost.de>
Bastien Orivel <bastien.orivel@diateam.net>
BiaoXiang Ye <yebiaoxiang@huawei.com>
Bihong Yu <yubihong@huawei.com>
Binfeng Wu <wubinfeng@huawei.com>
Bjoern Walk <bwalk@linux.ibm.com>
Boris Fiuczynski <fiuczy@linux.ibm.com>
Brian Turek <brian.turek@gmail.com>
Bruno Haible <bruno@clisp.org>
Chris Mayo <aklhfex@gmail.com>
Christian Borntraeger <borntraeger@de.ibm.com>
Christian Ehrhardt <christian.ehrhardt@canonical.com>
Christian Kirbach <christian.kirbach@gmail.com>
Christian Schoenebeck <qemu_oss@crudebyte.com>
Cole Robinson <crobinso@redhat.com>
Collin Walling <walling@linux.ibm.com>
Cornelia Huck <cohuck@redhat.com>
Cédric Bosdonnat <cbosdonnat@suse.com>
Côme Borsoi <fedora@borsoi.fr>
Daniel Henrique Barboza <danielhb413@gmail.com>
Daniel Letai <dani@letai.org.il>
Daniel P. Berrange <berrange@redhat.com>
Daniel P. Berrangé <berrange@redhat.com>
Didik Supriadi <didiksupriadi41@gmail.com>
dinglimin <dinglimin@cmss.chinamobile.com>
Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
Dmytro Linkin <dlinkin@nvidia.com>
Eiichi Tsukata <eiichi.tsukata@nutanix.com>
Eric Farman <farman@linux.ibm.com>
Erik Skultety <eskultet@redhat.com>
Fabian Affolter <mail@fabian-affolter.ch>
Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Fabiano Fidêncio <fabiano@fidencio.org>
Fangge Jin <fjin@redhat.com>
Farhan Ali <alifm@linux.ibm.com>
Fedora Weblate Translation <i18n@lists.fedoraproject.org>
Franck Ridel <fridel@protonmail.com>
Gavi Teitz <gavi@nvidia.com>
gongwei <gongwei@smartx.com>
Guoyi Tu<tu.guoyi@h3c.com>
Göran Uddeborg <goeran@uddeborg.se>
Halil Pasic <pasic@linux.ibm.com>
Han Han <hhan@redhat.com>
Hao Wang <wanghao232@huawei.com>
Hela Basa <r45xveza@pm.me>
Helmut Grohne <helmut@subdivi.de>
Hiroki Narukawa <hnarukaw@yahoo-corp.jp>
Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Ian Wienand <iwienand@redhat.com>
Ioanna Alifieraki <ioanna-maria.alifieraki@canonical.com>
Jakob Meng <jakobmeng@web.de>
Jamie Strandboge <jamie@canonical.com>
Jamie Strandboge <jamie@ubuntu.com>
Jan Kuparinen <copper_fin@hotmail.com>
jason lee <ppark5237@gmail.com>
Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
Jia Zhou <zhou.jia2@zte.com.cn>
Jianan Gao <jgao@redhat.com>
Jim Fehlig <jfehlig@suse.com>
Jin Yan <jinyan12@huawei.com>
Jinsheng Zhang <zhangjl02@inspur.com>
Jiri Denemark <jdenemar@redhat.com>
Joachim Falk <joachim.falk@gmx.de>
John Ferlan <jferlan@redhat.com>
Jonathan Watt <jwatt@jwatt.org>
Jonathon Jongsma <jjongsma@redhat.com>
Julio Faracco <jcfaracco@gmail.com>
Justin Gatzen <justin.gatzen@gmail.com>
Ján Tomko <jtomko@redhat.com>
Kashyap Chamarthy <kchamart@redhat.com>
Kevin Locke <kevin@kevinlocke.name>
Koichi Murase <myoga.murase@gmail.com>
Kristina Hanicova <khanicov@redhat.com>
Laine Stump <laine@redhat.com>
Laszlo Ersek <lersek@redhat.com>
Lee Yarwood <lyarwood@redhat.com>
Lei Yang <yanglei209@huawei.com>
Liao Pingfang <liao.pingfang@zte.com.cn>
Lin Ma <lma@suse.com>
Lin Ma <lma@suse.de>
Lin Ma <morecache@gmail.com>
Liu Yiding <liuyd.fnst@fujitsu.com>
Luke Yue <lukedyue@gmail.com>
Luyao Zhong <luyao.zhong@intel.com>
Marc Hartmayer <mhartmay@linux.ibm.com>
Marc-André Lureau <marcandre.lureau@redhat.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Markus Schade <markus.schade@hetzner.com>
Martin Kletzander <mkletzan@redhat.com>
Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Matej Cepl <mcepl@cepl.eu>
Matt Coleman <matt@datto.com>
Matt Coleman <mcoleman@datto.com>
Mauro Matteo Cascella <mcascell@redhat.com>
Meina Li <meili@redhat.com>
Michal Privoznik <mprivozn@redhat.com>
Michał Smyk <fedora@smyk.it>
Milo Casagrande <milo@milo.name>
Moshe Levi <moshele@nvidia.com>
Muha Aliss <muhaaliss@gmail.com>
Nathan <nathan95@live.it>
Neal Gompa <ngompa13@gmail.com>
Nick Chevsky <nchevsky@gmail.com>
Nick Shyrokovskiy <nshyrokovskiy@gmail.com>
Nickys Music Group <nickys.music.group@gmail.com>
Nico Pache <npache@redhat.com>
Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Olaf Hering <olaf@aepfle.de>
Olesya Gerasimenko <gammaray@basealt.ru>
Or Ozeri <oro@il.ibm.com>
Orion Poplawski <orion@nwra.com>
Pany <geekpany@gmail.com>
Patrick Magauran <patmagauran.j@gmail.com>
Paulo de Rezende Pinatti <ppinatti@linux.ibm.com>
Pavel Hrdina <phrdina@redhat.com>
Peng Liang <liangpeng10@huawei.com>
Peter Krempa <pkrempa@redhat.com>
Pino Toscano <ptoscano@redhat.com>
Pino Toscano <toscano.pino@tiscali.it>
Piotr Drąg <piotrdrag@gmail.com>
Prathamesh Chavan <pc44800@gmail.com>
Praveen K Paladugu <prapal@linux.microsoft.com>
Richard W.M. Jones <rjones@redhat.com>
Ricky Tigg <ricky.tigg@gmail.com>
Robin Lee <cheeselee@fedoraproject.org>
Roman Bogorodskiy <bogorodskiy@gmail.com>
Roman Bolshakov <r.bolshakov@yadro.com>
Ryan Gahagan <rgahagan@cs.utexas.edu>
Ryan Schmidt <git@ryandesign.com>
Sam Hartman <hartmans@debian.org>
Scott Shambarger <scott-libvirt@shambarger.net>
Sebastian Mitterle <smitterl@redhat.com>
SeongHyun Jo <caelus9536@gmail.com>
Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Shaojun Yang <yangshaojun@phytium.com.cn>
Shi Lei <shi_lei@massclouds.com>
simmon <simmon@nplob.com>
Simon Chopin <chopin.simon@gmail.com>
Simon Gaiser <simon@invisiblethingslab.com>
Simon Rowe <simon.rowe@nutanix.com>
Stefan Bader <stefan.bader@canonical.com>
Stefan Berger <stefanb@linux.ibm.com>
Stefan Berger <stefanb@linux.vnet.ibm.com>
Stefan Hajnoczi <stefanha@gmail.com>
Stefan Hajnoczi <stefanha@redhat.com>
Szymon Scholz <szymonscholz@gmail.com>
Thomas Huth <thuth@redhat.com>
Tim Wiederhake <twiederh@redhat.com>
Tomáš Golembiovský <tgolembi@redhat.com>
Tomáš Janoušek <tomi@nomi.cz>
Tuguoyi <tu.guoyi@h3c.com>
Vasiliy Ulyanov <vulyanov@suse.de>
Victor Toso <victortoso@redhat.com>
Ville Skyttä <ville.skytta@iki.fi>
Vinayak Kale <vkale@nvidia.com>
Wang Xin <wangxinxin.wang@huawei.com>
WangJian <wangjian161@huawei.com>
Weblate <noreply@weblate.org>
Wei Liu <liuwe@microsoft.com>
Wei Liu <wei.liu@kernel.org>
Wei-Chen Chen <weicche@microsoft.com>
William Douglas <william.douglas@intel.com>
Xu Chao <xu.chao6@zte.com.cn>
Yalei Li <274268859@qq.com>
Yalei Li <liyl43@chinatelecom.cn>
Yang Fei <yangfei85@huawei.com>
Yang Hang <yanghang44@huawei.com>
Yanqiu Zhang <yanqzhan@redhat.com>
Yaroslav Kargin <ykargin@virtuozzo.com>
Yasuhiko Kamata <belphegor@belbel.or.jp>
Yi Li <yili@winhong.com>
Yi Wang <wang.yi59@zte.com.cn>
Yuri Chornoivan <yurchor@ukr.net>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
zhangjl02 <zhangjl02@inspur.com>
zhanglei <zhanglei@smartx.com>
Zheng Chuan <zhengchuan@huawei.com>
zhenwei pi <pizhenwei@bytedance.com>
Zhenyu Ye <yezhenyu2@huawei.com>
Zhenyu Zheng <zheng.zhenyu@outlook.com>
Zhenzhong Duan <zhenzhong.duan@intel.com>
Дамјан Георгиевски <gdamjan@gmail.com>
jobs:
build-amd64-xsm pass
build-arm64-xsm pass
build-i386-xsm pass
build-amd64 pass
build-arm64 pass
build-armhf pass
build-i386 pass
build-amd64-libvirt fail
build-arm64-libvirt fail
build-armhf-libvirt fail
build-i386-libvirt fail
build-amd64-pvops pass
build-arm64-pvops pass
build-armhf-pvops pass
build-i386-pvops pass
test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm blocked
test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm blocked
test-amd64-amd64-libvirt-xsm blocked
test-arm64-arm64-libvirt-xsm blocked
test-amd64-i386-libvirt-xsm blocked
test-amd64-amd64-libvirt blocked
test-arm64-arm64-libvirt blocked
test-armhf-armhf-libvirt blocked
test-amd64-i386-libvirt blocked
test-amd64-amd64-libvirt-pair blocked
test-amd64-i386-libvirt-pair blocked
test-arm64-arm64-libvirt-qcow2 blocked
test-armhf-armhf-libvirt-qcow2 blocked
test-arm64-arm64-libvirt-raw blocked
test-armhf-armhf-libvirt-raw blocked
test-amd64-i386-libvirt-raw blocked
test-amd64-amd64-libvirt-vhd blocked
------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images
Logs, config files, etc. are available at
http://logs.test-lab.xenproject.org/osstest/logs
Explanation of these reports, and of osstest in general, is at
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master
Test harness code can be found at
http://xenbits.xen.org/gitweb?p=osstest.git;a=summary
Not pushing.
(No revision log; it would be 90926 lines long.)
^ permalink raw reply
* [PATCH] ARM: dts: aspeed: Add ASRock ROMED8HM3 BMC
From: Zev Weiss @ 2022-01-05 10:17 UTC (permalink / raw)
To: linux-arm-kernel, linux-aspeed
Cc: devicetree, Zev Weiss, Arnd Bergmann, Andrew Jeffery, openbmc,
linux-kernel, Rob Herring, Olof Johansson, Anthony Jenkins,
Neil Horman
This is a half-width, single-socket Epyc server board with an AST2500
BMC. This device tree is sufficient for basic OpenBMC functionality,
but we'll need to add a few more devices (as driver support becomes
available) before it's fully usable.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
---
arch/arm/boot/dts/Makefile | 1 +
.../boot/dts/aspeed-bmc-asrock-romed8hm3.dts | 259 ++++++++++++++++++
2 files changed, 260 insertions(+)
create mode 100644 arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0de64f237cd8..4008d2143b44 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1481,6 +1481,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
aspeed-bmc-arm-centriq2400-rep.dtb \
aspeed-bmc-arm-stardragon4800-rep2.dtb \
aspeed-bmc-asrock-e3c246d4i.dtb \
+ aspeed-bmc-asrock-romed8hm3.dtb \
aspeed-bmc-bytedance-g220a.dtb \
aspeed-bmc-facebook-cloudripper.dtb \
aspeed-bmc-facebook-cmm.dtb \
diff --git a/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts b/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts
new file mode 100644
index 000000000000..e71ccfd1df63
--- /dev/null
+++ b/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts
@@ -0,0 +1,259 @@
+// SPDX-License-Identifier: GPL-2.0+
+/dts-v1/;
+
+#include "aspeed-g5.dtsi"
+#include <dt-bindings/gpio/aspeed-gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/{
+ model = "ASRock ROMED8HM3 BMC v1.00";
+ compatible = "asrock,romed8hm3-bmc", "aspeed,ast2500";
+
+ aliases {
+ serial4 = &uart5;
+ };
+
+ chosen {
+ stdout-path = &uart5;
+ bootargs = "console=tty0 console=ttyS4,115200 earlycon";
+ };
+
+ memory@80000000 {
+ reg = <0x80000000 0x20000000>;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ heartbeat {
+ gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "timer";
+ };
+
+ system-fault {
+ gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
+ panic-indicator;
+ };
+ };
+
+ iio-hwmon {
+ compatible = "iio-hwmon";
+ io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
+ <&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
+ <&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>,
+ <&adc 12>, <&adc 13>, <&adc 14>, <&adc 15>;
+ };
+};
+
+&fmc {
+ status = "okay";
+ flash@0 {
+ status = "okay";
+ m25p,fast-read;
+ label = "bmc";
+ spi-max-frequency = <100000000>; /* 100 MHz */
+#include "openbmc-flash-layout-64.dtsi"
+ };
+};
+
+&uart5 {
+ status = "okay";
+};
+
+&vuart {
+ status = "okay";
+ aspeed,lpc-io-reg = <0x2f8>;
+ aspeed,lpc-interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&mac0 {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
+};
+
+&i2c0 {
+ status = "okay";
+
+ /* inlet temp sensor */
+ w83773g@4c {
+ compatible = "nuvoton,w83773g";
+ reg = <0x4c>;
+ };
+};
+
+&i2c1 {
+ status = "okay";
+};
+
+&i2c2 {
+ status = "okay";
+
+ /* IPB temp sensor */
+ w83773g@4c {
+ compatible = "nuvoton,w83773g";
+ reg = <0x4c>;
+ };
+
+ /* IPB PMIC */
+ lm25066@40 {
+ compatible = "lm25066";
+ reg = <0x40>;
+ };
+
+ /* 12VSB PMIC */
+ lm25066@41 {
+ compatible = "lm25066";
+ reg = <0x41>;
+ };
+};
+
+&i2c4 {
+ status = "okay";
+};
+
+&i2c5 {
+ status = "okay";
+};
+
+&i2c6 {
+ status = "okay";
+};
+
+&i2c7 {
+ status = "okay";
+
+ /* Baseboard FRU eeprom */
+ eeprom@50 {
+ compatible = "st,24c128", "atmel,24c128";
+ reg = <0x50>;
+ pagesize = <16>;
+ };
+};
+
+&i2c8 {
+ status = "okay";
+};
+
+&i2c9 {
+ status = "okay";
+};
+
+&video {
+ status = "okay";
+};
+
+&vhub {
+ status = "okay";
+};
+
+&lpc_ctrl {
+ status = "okay";
+};
+
+&lpc_snoop {
+ status = "okay";
+ snoop-ports = <0x80>;
+};
+
+&kcs3 {
+ status = "okay";
+ aspeed,lpc-io-reg = <0xca2>;
+};
+
+&pwm_tacho {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm3_default
+ &pinctrl_pwm4_default
+ &pinctrl_pwm5_default
+ &pinctrl_pwm6_default>;
+
+ fan@3 {
+ reg = <0x03>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x03 0x0b>;
+ };
+
+ fan@4 {
+ reg = <0x04>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x04 0x0c>;
+ };
+
+ fan@5 {
+ reg = <0x05>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x05 0x0d>;
+ };
+
+ fan@6 {
+ reg = <0x06>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x06 0x0e>;
+ };
+};
+
+&gpio {
+ status = "okay";
+ gpio-line-names =
+ /* A */ "LOCATORLED_STATUS_N", "BMC_MAC2_INTB", "NMI_BTN_N", "BMC_NMI",
+ "", "", "", "",
+ /* B */ "DDR_MEM_TEMP", "", "", "", "", "", "", "",
+ /* C */ "", "", "", "", "PCIE_HP_SEL_N", "PCIE_SATA_SEL_N", "LOCATORBTN", "",
+ /* D */ "BMC_PSIN", "BMC_PSOUT", "BMC_RESETCON", "RESETCON",
+ "", "", "", "PSU_FAN_FAIL_N",
+ /* E */ "", "", "", "", "", "", "", "",
+ /* F */ "NIC_PWR_GOOD", "PRSNTB0", "PRSNTB1", "PRSNTB2",
+ "PRSNTB3", "", "3VSB_PCIE1_PG", "12V_PCIE1_PG",
+ /* G */ "HWM_BAT_EN", "CHASSIS_ID0", "CHASSIS_ID1", "CHASSIS_ID2",
+ "BMC_ALERT1_N_R", "BMC_ALERT2_N_R", "BMC_ALERT3_N", "BMC_ALERT4_N",
+ /* H */ "X24_C1_PRSNT", "X24_C2_PRSNT", "X24_C3_PRSNT", "FM_MEM_THERM_EVENT_BMC_R_N",
+ "FACMODE", "BMC_RTCRST", "BMC_HB_LED_N", "BMC_CASEOPEN",
+ /* I */ "", "", "", "", "", "", "", "",
+ /* J */ "BMC_READY", "BMC_PCH_BIOS_CS_N", "", "P0_MA_DDR_QS_CS_N",
+ "", "", "", "",
+ /* K */ "", "", "", "", "", "", "", "",
+ /* L */ "", "", "", "", "", "", "", "",
+ /* M */ "", "", "MEZZ_PWRBRK_N", "OCP_HP_RST_EN",
+ "MAIN_PWR_EN_G", "BMC_MAIN_EN", "AUX_PWR_EN_G", "BMC_AUX_EN",
+ /* N */ "", "", "", "", "", "", "", "",
+ /* O */ "", "", "", "", "", "", "", "",
+ /* P */ "", "", "", "", "", "", "", "",
+ /* Q */ "", "", "", "",
+ "BMC_SMB_PRESENT_1_N", "BMC_SMB_PRESENT_2_N",
+ "BMC_SMB_PRESENT_3_N", "BMC_PCIE_WAKE_N",
+ /* R */ "", "", "THERMALTRIP_CLEAR_N", "", "", "", "", "",
+ /* S */ "", "", "", "", "", "", "", "",
+ /* T */ "", "", "", "", "", "", "", "",
+ /* U */ "", "", "", "", "", "", "", "",
+ /* V */ "", "", "", "", "", "", "", "",
+ /* W */ "", "", "", "", "", "", "", "",
+ /* X */ "", "", "", "", "", "", "", "",
+ /* Y */ "SLP_S3", "SLP_S4_S5", "NODE_ID_1", "NODE_ID_2", "", "", "", "",
+ /* Z */ "", "", "SYSTEM_FAULT_LED_N", "FAST_THROTTLE_N",
+ "", "", "", "",
+ /* AA */ "FM_CPU0_IBMC_THERMTRIP_N", "", "PROCHOT_L_G", "",
+ "", "", "", "",
+ /* AB */ "BMC_FORCE_SELFREFRESH", "PWRGD_OUT", "", "IRQ_BMC_PCH_SMI_LPC_N",
+ "", "", "", "",
+ /* AC */ "", "", "", "", "", "", "", "";
+};
+
+&adc {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_adc0_default
+ &pinctrl_adc1_default
+ &pinctrl_adc2_default
+ &pinctrl_adc3_default
+ &pinctrl_adc4_default
+ &pinctrl_adc5_default
+ &pinctrl_adc6_default
+ &pinctrl_adc7_default
+ &pinctrl_adc8_default
+ &pinctrl_adc9_default
+ &pinctrl_adc10_default
+ &pinctrl_adc11_default
+ &pinctrl_adc12_default
+ &pinctrl_adc13_default
+ &pinctrl_adc14_default
+ &pinctrl_adc15_default>;
+};
--
2.34.1
^ permalink raw reply related
* Re: [PATCH v8 01/19] securityfs: Extend securityfs with namespacing support
From: Christian Brauner @ 2022-01-05 10:18 UTC (permalink / raw)
To: Al Viro
Cc: Stefan Berger, linux-integrity, zohar, serge, containers,
dmitry.kasatkin, ebiederm, krzysztof.struczynski, roberto.sassu,
mpeters, lhinds, lsturman, puiterwi, jejb, jamjoom, linux-kernel,
paul, rgb, linux-security-module, jmorris, Stefan Berger,
James Bottomley
In-Reply-To: <YdUXU3XIzhxFUfVB@zeniv-ca.linux.org.uk>
On Wed, Jan 05, 2022 at 03:58:11AM +0000, Al Viro wrote:
> On Tue, Jan 04, 2022 at 12:03:58PM -0500, Stefan Berger wrote:
> > From: Stefan Berger <stefanb@linux.ibm.com>
> >
> > To prepare for virtualization of SecurityFS, use simple_pin_fs and
> > simpe_release_fs only when init_user_ns is active.
> >
> > Extend 'securityfs' for support of IMA namespacing so that each
> > IMA (user) namespace can have its own front-end for showing the currently
> > active policy, the measurement list, number of violations and so on.
> >
> > Enable multiple instances of securityfs by keying each instance with a
> > pointer to the user namespace it belongs to.
> >
> > Drop the additional dentry reference to enable simple cleanup of dentries
> > upon umount. Now the dentries do not need to be explicitly freed anymore
> > but we can just rely on d_genocide() and the dcache shrinker to do all
> > the required work.
>
> Looks brittle... What are the new rules for securityfs_remove()? Is it
> still paired with securityfs_create_...()? When is removal done? On
> securityfs instance shutdown? What about the underlying data structures, BTW?
> When can they be freed?
>
> That kind of commit message is asking for trouble down the road; please,
> document the rules properly.
Yeah, it's not explaining it in detail. I've asked for that as well. My
explanations below are what I expressed it should look like in prior
reviews. I haven't reviewed this version yet so this as I would expect
it to go.
For the initial securityfs, i.e. the one mounted in the host userns
mount nothing changes.
The rules for securityfs_remove() are as before and it is still paired
with securityfs_create(). Specifically, a file created via
securityfs_create_dentry() in the initial securityfs mount still needs
to be removed by a call to securityfs_remove().
Creating a new dentry in the initial securityfs mount still pins the
filesytem like it always did. Consequently, the initial securityfs
mount is not destroyed on umount/shutdown as long as at least one user
of it still has dentries that it hasn't removed with a call to
securityfs_remove().
This specific part of the commit message you responded to is not
giving enough details, I think:
> > Drop the additional dentry reference to enable simple cleanup of dentries
> > upon umount. Now the dentries do not need to be explicitly freed anymore
> > but we can just rely on d_genocide() and the dcache shrinker to do all
> > the required work.
The "additional dentry reference" mentioned only relates to an afaict
unnecessary dget() in securityfs_create_dentry() which I pointed out
as part of earlier reviews. But the phrasing implies that there's a
behavioral change for the initial securityfs instance based on the
removal of this additional dget() when there really isn't.
After securityfs_create_dentry() has created a new dentry via
lookup_one_len() and eventually called d_instantiate() it currently
takes an additional reference on the newly created dentry via dget().
This additional reference is then paired with an additional dput() in
securityfs_remove(). I have not yet seen a reason why this is
necessary maybe you can help there.
For example, contrast this with debugfs which has the same underlying
logic as securityfs, i.e. any created dentry pins the whole filesystem
via simple_pin_fs() until the dentry is released and simple_unpin_fs()
is called. It uses a similar pairing as securityfs: where securityfs
has the securityfs_create_dentry() and securityfs_remove() pairing,
debugfs has the __debugfs_create_file() and debugfs_remove() pairing.
But debugfs doesn't take an additional reference on the just created
dentry in __debugfs_create_file() which would need to be put in
debugfs_remove().
So if we contrast the creation routines of securityfs and debugfs directly
condensed to just the dentry references:
securityfs | debugfs
---------------- | ------------------
|
lookup_one_len() | lookup_one_len()
d_instantiate() | d_instantiate()
dget() |
And I have not understood why securityfs would need that additional
dget(). Not just intrinsically but also when contrasted with debugfs. So
that additional dget() is removed as part of this patch.
But the explanation in the commit message isn't ideal as it implies
the removal of the additional dget() would have any impact on the
pinning logic for securityfs when it does not.
But the pinning logic doesn't make sense outside of the initial
namespace which can never go away and there are security modules that
have files or settings for the whole system that never go away and will
always keep the filesystem around.
But for unprivileged/userns containers that mount their own securityfs
instance we want the securityfs instance cleaned up when it is
unmounted. There is no need to duplicate the pinning logic or make the
global securityfs instance display different information based on the
userns. Both options would be really messy and hacky.
Instead we can simply give each userns it's own securityfs instance
similar to how each ipc ns has its own mqueue instance and all entries
in there are cleaned up on umount or when the whole container is
shutdown. After the container is shutdown all of the security module
settings for the container go away with it anyway. So for that we don't
want any filesystem pinning done in securityfs_create_dentry(). And we
also really don't want the additional dget() that is currently taken in
securityfs_create_dentry() as it would pointlessly require us to dput()
during superblock shutdown afaict. None of this however should cause any
behavioral changes for the initial securityfs instance.
>
> Incidentally, what happens if you open a file, pass it to somebody in a
> different userns and try to shut the opener's userns down?
I'm not exactly sure what you mean by "shutting down" and whether that's
a generic question or specific to this patch. I assume that you just
mean what happens when the last task for a userns exits and the userns
isn't pinned by e.g. a bind-mount of it to somewhere.
If you're just asking about the generic case then the opener's creds are
pinned by ->f_cred including the caller's userns at open-time. So it
will be released once that file has been closed.
If you're asking about what happens to the userns the
securityfs/tmpfs/mqueue/devpts etc. instance was mounted in it will be
pinned by the superblock which in turn is pinned by the open file.
Does that answer your question or did you have something else in mind?
^ permalink raw reply
* Re: INFO: task hung in blk_mq_get_tag
From: yukuai (C) @ 2022-01-05 10:18 UTC (permalink / raw)
To: kvartet, Jens Axboe, linux-block, linux-kernel, syzkaller-bugs; +Cc: sunhao.th
In-Reply-To: <CAFkrUshANwa2iLNdjZypUUam7-tarKNp-EAhJMDbJciHKCXe7Q@mail.gmail.com>
On 2022/01/04 18:26, kvartet wrote:
> Hello,
>
> When using Syzkaller to fuzz the latest Linux kernel, the following
> crash was triggered.
>
> HEAD commit: a7904a538933 Linux 5.16-rc6
> git tree: upstream
> console output: https://paste.ubuntu.com/p/sBNS3rSWFq/plain/
> kernel config: https://paste.ubuntu.com/p/FDDNHDxtwz/plain/
>
> Sorry, I don't have a reproducer for this crash, hope the symbolized
> report can help.
>
> If you fix this issue, please add the following tag to the commit:
> Reported-by: Yiru Xu <xyru1999@gmail.com>
>
>
Hi,
I notice that ata_scsi_dev_rescan() is in progress, will this problem be
related to this:
https://lkml.org/lkml/2022/1/4/1170
Thanks,
Kuai
> INFO: task syz-executor.7:13121 blocked for more than 143 seconds.
> Not tainted 5.16.0-rc6 #9
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:syz-executor.7 state:D stack:27760 pid:13121 ppid: 12530 flags:0x00000004
> Call Trace:
> <TASK>
> context_switch kernel/sched/core.c:4972 [inline]
> __schedule+0xcd9/0x2530 kernel/sched/core.c:6253
> schedule+0xd2/0x260 kernel/sched/core.c:6326
> io_schedule+0xb3/0x120 kernel/sched/core.c:8371
> blk_mq_get_tag+0x58d/0xac0 block/blk-mq-tag.c:158
> __blk_mq_alloc_requests+0x674/0xe00 block/blk-mq.c:486
> blk_mq_alloc_request+0x116/0x210 block/blk-mq.c:520
> scsi_alloc_request+0x1f/0x60 drivers/scsi/scsi_lib.c:1103
> sg_start_req drivers/scsi/sg.c:1727 [inline]
> sg_common_write.isra.0+0x50e/0x1f30 drivers/scsi/sg.c:807
> sg_write+0x7c9/0xda0 drivers/scsi/sg.c:711
> vfs_write+0x22a/0xae0 fs/read_write.c:588
> ksys_write+0x12d/0x250 fs/read_write.c:643
> do_syscall_x64 arch/x86/entry/common.c:50 [inline]
> do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
> entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x7f90924fe89d
> RSP: 002b:00007f9090e6fc28 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
> RAX: ffffffffffffffda RBX: 00007f909261df60 RCX: 00007f90924fe89d
> RDX: 0000000000000030 RSI: 0000000020000040 RDI: 0000000000000004
> RBP: 00007f909256b00d R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 00007fff4495088f R14: 00007f909261df60 R15: 00007f9090e6fdc0
> </TASK>
>
> Showing all locks held in the system:
> 1 lock held by khungtaskd/39:
> #0: ffffffff8bb80e20 (rcu_read_lock){....}-{1:2}, at:
> debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6458
> 1 lock held by in:imklog/6764:
> #0: ffff888018636b70 (&f->f_pos_lock){+.+.}-{3:3}, at:
> __fdget_pos+0xe9/0x100 fs/file.c:1034
> 3 locks held by syz-fuzzer/6689:
> #0: ffff888102adc460 (sb_writers#5){.+.+}-{0:0}, at:
> do_rmdir+0x1d0/0x390 fs/namei.c:4013
> #1: ffff88802af421d8 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at:
> inode_lock_nested include/linux/fs.h:818 [inline]
> #1: ffff88802af421d8 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at:
> do_rmdir+0x21b/0x390 fs/namei.c:4017
> #2: ffff888113c5b5c8 (&type->i_mutex_dir_key#4){++++}-{3:3}, at:
> inode_lock include/linux/fs.h:783 [inline]
> #2: ffff888113c5b5c8 (&type->i_mutex_dir_key#4){++++}-{3:3}, at:
> vfs_rmdir fs/namei.c:3958 [inline]
> #2: ffff888113c5b5c8 (&type->i_mutex_dir_key#4){++++}-{3:3}, at:
> vfs_rmdir+0xe3/0x570 fs/namei.c:3946
> 3 locks held by kworker/u9:21/13658:
> #0: ffff888100ff0138 ((wq_completion)writeback){+.+.}-{0:0}, at:
> arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
> #0: ffff888100ff0138 ((wq_completion)writeback){+.+.}-{0:0}, at:
> arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
> #0: ffff888100ff0138 ((wq_completion)writeback){+.+.}-{0:0}, at:
> atomic_long_set include/linux/atomic/atomic-instrumented.h:1198
> [inline]
> #0: ffff888100ff0138 ((wq_completion)writeback){+.+.}-{0:0}, at:
> set_work_data kernel/workqueue.c:635 [inline]
> #0: ffff888100ff0138 ((wq_completion)writeback){+.+.}-{0:0}, at:
> set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline]
> #0: ffff888100ff0138 ((wq_completion)writeback){+.+.}-{0:0}, at:
> process_one_work+0x8c3/0x16d0 kernel/workqueue.c:2269
> #1: ffffc9000f8bfdc8
> ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at:
> process_one_work+0x8f7/0x16d0 kernel/workqueue.c:2273
> #2: ffff8881000940e0 (&type->s_umount_key#47){.+.+}-{3:3}, at:
> trylock_super+0x1d/0x100 fs/super.c:418
> 4 locks held by kworker/2:10/30001:
> #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at:
> arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
> #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at:
> arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
> #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at:
> atomic_long_set include/linux/atomic/atomic-instrumented.h:1198
> [inline]
> #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at:
> set_work_data kernel/workqueue.c:635 [inline]
> #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at:
> set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline]
> #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at:
> process_one_work+0x8c3/0x16d0 kernel/workqueue.c:2269
> #1: ffffc9001352fdc8
> ((work_completion)(&ap->scsi_rescan_task)){+.+.}-{0:0}, at:
> process_one_work+0x8f7/0x16d0 kernel/workqueue.c:2273
> #2: ffff8881075ac2a0 (&ap->scsi_scan_mutex){+.+.}-{3:3}, at:
> ata_scsi_dev_rescan+0x38/0x230 drivers/ata/libata-scsi.c:4646
> #3: ffff888107c9a3e0 (&dev->mutex){....}-{3:3}, at: device_lock
> include/linux/device.h:760 [inline]
> #3: ffff888107c9a3e0 (&dev->mutex){....}-{3:3}, at:
> scsi_rescan_device+0x28/0x210 drivers/scsi/scsi_scan.c:1555
>
> =============================================
>
> NMI backtrace for cpu 2
> CPU: 2 PID: 39 Comm: khungtaskd Not tainted 5.16.0-rc6 #9
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> 1.13.0-1ubuntu1.1 04/01/2014
> Call Trace:
> <TASK>
> __dump_stack lib/dump_stack.c:88 [inline]
> dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
> nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111
> nmi_trigger_cpumask_backtrace+0x1a1/0x1e0 lib/nmi_backtrace.c:62
> trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
> check_hung_uninterruptible_tasks kernel/hung_task.c:210 [inline]
> watchdog+0xcc8/0x1010 kernel/hung_task.c:295
> kthread+0x405/0x4f0 kernel/kthread.c:327
> ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
> </TASK>
> Sending NMI from CPU 2 to CPUs 0-1,3:
> NMI backtrace for cpu 0
> CPU: 0 PID: 11470 Comm: kworker/u8:5 Not tainted 5.16.0-rc6 #9
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> 1.13.0-1ubuntu1.1 04/01/2014
> Workqueue: bat_events batadv_nc_worker
> RIP: 0010:lockdep_enabled kernel/locking/lockdep.c:91 [inline]
> RIP: 0010:lock_acquire kernel/locking/lockdep.c:5613 [inline]
> RIP: 0010:lock_acquire+0x13b/0x520 kernel/locking/lockdep.c:5602
> Code: 85 c5 01 00 00 65 48 8b 14 25 40 70 02 00 48 8d ba 1c 0a 00 00
> 48 b8 00 00 00 00 00 fc ff df 48 89 f9 48 c1 e9 03 0f b6 0c 01 <48> 89
> f8 83 e0 07 83 c0 03 38 c8 7c 08 84 c9 0f 85 80 03 00 00 8b
> RSP: 0018:ffffc9000fc7fbf0 EFLAGS: 00000213
> RAX: dffffc0000000000 RBX: 1ffff92001f8ff80 RCX: 0000000000000000
> RDX: ffff888054573980 RSI: 0000000000000001 RDI: ffff88805457439c
> RBP: 0000000000000000 R08: 0000000000000000 R09: fffffbfff1b20a2b
> R10: ffffffff8d905157 R11: fffffbfff1b20a2a R12: 0000000000000002
> R13: ffffffff8bb80e20 R14: 0000000000000000 R15: 0000000000000000
> FS: 0000000000000000(0000) GS:ffff888063e00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 0000563740b0c900 CR3: 000000000b88e000 CR4: 0000000000350ef0
> Call Trace:
> <TASK>
> rcu_lock_acquire include/linux/rcupdate.h:268 [inline]
> rcu_read_lock include/linux/rcupdate.h:688 [inline]
> batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline]
> batadv_nc_worker+0x114/0x770 net/batman-adv/network-coding.c:723
> process_one_work+0x9df/0x16d0 kernel/workqueue.c:2298
> worker_thread+0x90/0xed0 kernel/workqueue.c:2445
> kthread+0x405/0x4f0 kernel/kthread.c:327
> ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
> </TASK>
> NMI backtrace for cpu 1 skipped: idling at native_safe_halt
> arch/x86/include/asm/irqflags.h:51 [inline]
> NMI backtrace for cpu 1 skipped: idling at arch_safe_halt
> arch/x86/include/asm/irqflags.h:89 [inline]
> NMI backtrace for cpu 1 skipped: idling at default_idle+0xb/0x10
> arch/x86/kernel/process.c:733
> NMI backtrace for cpu 3
> CPU: 3 PID: 3047 Comm: systemd-journal Not tainted 5.16.0-rc6 #9
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> 1.13.0-1ubuntu1.1 04/01/2014
> RIP: 0010:get_reg+0xef/0x170 arch/x86/kernel/unwind_orc.c:405
> Code: 11 00 0f 85 8d 00 00 00 49 89 45 00 41 bc 01 00 00 00 48 83 c4
> 08 5b 44 89 e0 5d 41 5c 41 5d c3 48 8d 7c f5 00 e8 01 fc ff ff <4c> 89
> e9 48 ba 00 00 00 00 00 fc ff df 48 c1 e9 03 80 3c 11 00 75
> RSP: 0018:ffffc9000128f928 EFLAGS: 00000202
> RAX: 00007ffd54a44fe0 RBX: ffffc9000128fa50 RCX: 1ffff92000251f54
> RDX: 0000000000000006 RSI: 0000000000000004 RDI: ffffc9000128ff78
> RBP: ffffc9000128ff58 R08: ffffffff8ea3f366 R09: ffffffff8ea3f360
> R10: ffffc9000128faaf R11: 0000000000088089 R12: 0000000000000001
> R13: ffffc9000128f9d8 R14: ffffc9000128fa50 R15: ffffc9000128ff58
> FS: 00007fbeac5ba8c0(0000) GS:ffff888135d00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007fbea9dca000 CR3: 000000001b63f000 CR4: 0000000000350ee0
> Call Trace:
> <TASK>
> unwind_next_frame+0xfe8/0x1780 arch/x86/kernel/unwind_orc.c:595
> arch_stack_walk+0x7d/0xe0 arch/x86/kernel/stacktrace.c:25
> stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122
> kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38
> kasan_set_track mm/kasan/common.c:46 [inline]
> set_alloc_info mm/kasan/common.c:434 [inline]
> ____kasan_kmalloc mm/kasan/common.c:513 [inline]
> ____kasan_kmalloc mm/kasan/common.c:472 [inline]
> __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522
> kasan_kmalloc include/linux/kasan.h:269 [inline]
> __kmalloc+0x1d2/0x3d0 mm/slub.c:4423
> kmalloc include/linux/slab.h:595 [inline]
> kzalloc include/linux/slab.h:724 [inline]
> lsm_cred_alloc security/security.c:537 [inline]
> security_prepare_creds+0x10e/0x190 security/security.c:1692
> prepare_creds+0x56e/0x7b0 kernel/cred.c:291
> access_override_creds fs/open.c:351 [inline]
> do_faccessat+0x3f4/0x850 fs/open.c:415
> do_syscall_x64 arch/x86/entry/common.c:50 [inline]
> do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
> entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x7fbeab8769c7
> Code: 83 c4 08 48 3d 01 f0 ff ff 73 01 c3 48 8b 0d c8 d4 2b 00 f7 d8
> 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 b8 15 00 00 00 0f 05 <48> 3d
> 01 f0 ff ff 73 01 c3 48 8b 0d a1 d4 2b 00 f7 d8 64 89 01 48
> RSP: 002b:00007ffd54a44fa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000015
> RAX: ffffffffffffffda RBX: 00007ffd54a47ec0 RCX: 00007fbeab8769c7
> RDX: 00007fbeac2e7a00 RSI: 0000000000000000 RDI: 000055b9fe0f89a3
> RBP: 00007ffd54a44fe0 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000069 R11: 0000000000000246 R12: 0000000000000000
> R13: 0000000000000000 R14: 00007ffd54a47ec0 R15: 00007ffd54a454d0
> </TASK>
> ----------------
> Code disassembly (best guess):
> 0: 85 c5 test %eax,%ebp
> 2: 01 00 add %eax,(%rax)
> 4: 00 65 48 add %ah,0x48(%rbp)
> 7: 8b 14 25 40 70 02 00 mov 0x27040,%edx
> e: 48 8d ba 1c 0a 00 00 lea 0xa1c(%rdx),%rdi
> 15: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
> 1c: fc ff df
> 1f: 48 89 f9 mov %rdi,%rcx
> 22: 48 c1 e9 03 shr $0x3,%rcx
> 26: 0f b6 0c 01 movzbl (%rcx,%rax,1),%ecx
> * 2a: 48 89 f8 mov %rdi,%rax <-- trapping instruction
> 2d: 83 e0 07 and $0x7,%eax
> 30: 83 c0 03 add $0x3,%eax
> 33: 38 c8 cmp %cl,%al
> 35: 7c 08 jl 0x3f
> 37: 84 c9 test %cl,%cl
> 39: 0f 85 80 03 00 00 jne 0x3bf
> 3f: 8b .byte 0x8b
>
>
>
> Best Regards,
> Yiru
> .
>
^ permalink raw reply
* [PATCH] ARM: dts: aspeed: Add ASRock ROMED8HM3 BMC
From: Zev Weiss @ 2022-01-05 10:17 UTC (permalink / raw)
To: linux-arm-kernel, linux-aspeed
Cc: openbmc, linux-kernel, devicetree, Arnd Bergmann, Olof Johansson,
Rob Herring, Joel Stanley, Andrew Jeffery, Neil Horman,
Anthony Jenkins, Zev Weiss
This is a half-width, single-socket Epyc server board with an AST2500
BMC. This device tree is sufficient for basic OpenBMC functionality,
but we'll need to add a few more devices (as driver support becomes
available) before it's fully usable.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
---
arch/arm/boot/dts/Makefile | 1 +
.../boot/dts/aspeed-bmc-asrock-romed8hm3.dts | 259 ++++++++++++++++++
2 files changed, 260 insertions(+)
create mode 100644 arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0de64f237cd8..4008d2143b44 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1481,6 +1481,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
aspeed-bmc-arm-centriq2400-rep.dtb \
aspeed-bmc-arm-stardragon4800-rep2.dtb \
aspeed-bmc-asrock-e3c246d4i.dtb \
+ aspeed-bmc-asrock-romed8hm3.dtb \
aspeed-bmc-bytedance-g220a.dtb \
aspeed-bmc-facebook-cloudripper.dtb \
aspeed-bmc-facebook-cmm.dtb \
diff --git a/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts b/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts
new file mode 100644
index 000000000000..e71ccfd1df63
--- /dev/null
+++ b/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts
@@ -0,0 +1,259 @@
+// SPDX-License-Identifier: GPL-2.0+
+/dts-v1/;
+
+#include "aspeed-g5.dtsi"
+#include <dt-bindings/gpio/aspeed-gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/{
+ model = "ASRock ROMED8HM3 BMC v1.00";
+ compatible = "asrock,romed8hm3-bmc", "aspeed,ast2500";
+
+ aliases {
+ serial4 = &uart5;
+ };
+
+ chosen {
+ stdout-path = &uart5;
+ bootargs = "console=tty0 console=ttyS4,115200 earlycon";
+ };
+
+ memory@80000000 {
+ reg = <0x80000000 0x20000000>;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ heartbeat {
+ gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "timer";
+ };
+
+ system-fault {
+ gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
+ panic-indicator;
+ };
+ };
+
+ iio-hwmon {
+ compatible = "iio-hwmon";
+ io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
+ <&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
+ <&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>,
+ <&adc 12>, <&adc 13>, <&adc 14>, <&adc 15>;
+ };
+};
+
+&fmc {
+ status = "okay";
+ flash@0 {
+ status = "okay";
+ m25p,fast-read;
+ label = "bmc";
+ spi-max-frequency = <100000000>; /* 100 MHz */
+#include "openbmc-flash-layout-64.dtsi"
+ };
+};
+
+&uart5 {
+ status = "okay";
+};
+
+&vuart {
+ status = "okay";
+ aspeed,lpc-io-reg = <0x2f8>;
+ aspeed,lpc-interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&mac0 {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
+};
+
+&i2c0 {
+ status = "okay";
+
+ /* inlet temp sensor */
+ w83773g@4c {
+ compatible = "nuvoton,w83773g";
+ reg = <0x4c>;
+ };
+};
+
+&i2c1 {
+ status = "okay";
+};
+
+&i2c2 {
+ status = "okay";
+
+ /* IPB temp sensor */
+ w83773g@4c {
+ compatible = "nuvoton,w83773g";
+ reg = <0x4c>;
+ };
+
+ /* IPB PMIC */
+ lm25066@40 {
+ compatible = "lm25066";
+ reg = <0x40>;
+ };
+
+ /* 12VSB PMIC */
+ lm25066@41 {
+ compatible = "lm25066";
+ reg = <0x41>;
+ };
+};
+
+&i2c4 {
+ status = "okay";
+};
+
+&i2c5 {
+ status = "okay";
+};
+
+&i2c6 {
+ status = "okay";
+};
+
+&i2c7 {
+ status = "okay";
+
+ /* Baseboard FRU eeprom */
+ eeprom@50 {
+ compatible = "st,24c128", "atmel,24c128";
+ reg = <0x50>;
+ pagesize = <16>;
+ };
+};
+
+&i2c8 {
+ status = "okay";
+};
+
+&i2c9 {
+ status = "okay";
+};
+
+&video {
+ status = "okay";
+};
+
+&vhub {
+ status = "okay";
+};
+
+&lpc_ctrl {
+ status = "okay";
+};
+
+&lpc_snoop {
+ status = "okay";
+ snoop-ports = <0x80>;
+};
+
+&kcs3 {
+ status = "okay";
+ aspeed,lpc-io-reg = <0xca2>;
+};
+
+&pwm_tacho {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm3_default
+ &pinctrl_pwm4_default
+ &pinctrl_pwm5_default
+ &pinctrl_pwm6_default>;
+
+ fan@3 {
+ reg = <0x03>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x03 0x0b>;
+ };
+
+ fan@4 {
+ reg = <0x04>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x04 0x0c>;
+ };
+
+ fan@5 {
+ reg = <0x05>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x05 0x0d>;
+ };
+
+ fan@6 {
+ reg = <0x06>;
+ aspeed,fan-tach-ch = /bits/ 8 <0x06 0x0e>;
+ };
+};
+
+&gpio {
+ status = "okay";
+ gpio-line-names =
+ /* A */ "LOCATORLED_STATUS_N", "BMC_MAC2_INTB", "NMI_BTN_N", "BMC_NMI",
+ "", "", "", "",
+ /* B */ "DDR_MEM_TEMP", "", "", "", "", "", "", "",
+ /* C */ "", "", "", "", "PCIE_HP_SEL_N", "PCIE_SATA_SEL_N", "LOCATORBTN", "",
+ /* D */ "BMC_PSIN", "BMC_PSOUT", "BMC_RESETCON", "RESETCON",
+ "", "", "", "PSU_FAN_FAIL_N",
+ /* E */ "", "", "", "", "", "", "", "",
+ /* F */ "NIC_PWR_GOOD", "PRSNTB0", "PRSNTB1", "PRSNTB2",
+ "PRSNTB3", "", "3VSB_PCIE1_PG", "12V_PCIE1_PG",
+ /* G */ "HWM_BAT_EN", "CHASSIS_ID0", "CHASSIS_ID1", "CHASSIS_ID2",
+ "BMC_ALERT1_N_R", "BMC_ALERT2_N_R", "BMC_ALERT3_N", "BMC_ALERT4_N",
+ /* H */ "X24_C1_PRSNT", "X24_C2_PRSNT", "X24_C3_PRSNT", "FM_MEM_THERM_EVENT_BMC_R_N",
+ "FACMODE", "BMC_RTCRST", "BMC_HB_LED_N", "BMC_CASEOPEN",
+ /* I */ "", "", "", "", "", "", "", "",
+ /* J */ "BMC_READY", "BMC_PCH_BIOS_CS_N", "", "P0_MA_DDR_QS_CS_N",
+ "", "", "", "",
+ /* K */ "", "", "", "", "", "", "", "",
+ /* L */ "", "", "", "", "", "", "", "",
+ /* M */ "", "", "MEZZ_PWRBRK_N", "OCP_HP_RST_EN",
+ "MAIN_PWR_EN_G", "BMC_MAIN_EN", "AUX_PWR_EN_G", "BMC_AUX_EN",
+ /* N */ "", "", "", "", "", "", "", "",
+ /* O */ "", "", "", "", "", "", "", "",
+ /* P */ "", "", "", "", "", "", "", "",
+ /* Q */ "", "", "", "",
+ "BMC_SMB_PRESENT_1_N", "BMC_SMB_PRESENT_2_N",
+ "BMC_SMB_PRESENT_3_N", "BMC_PCIE_WAKE_N",
+ /* R */ "", "", "THERMALTRIP_CLEAR_N", "", "", "", "", "",
+ /* S */ "", "", "", "", "", "", "", "",
+ /* T */ "", "", "", "", "", "", "", "",
+ /* U */ "", "", "", "", "", "", "", "",
+ /* V */ "", "", "", "", "", "", "", "",
+ /* W */ "", "", "", "", "", "", "", "",
+ /* X */ "", "", "", "", "", "", "", "",
+ /* Y */ "SLP_S3", "SLP_S4_S5", "NODE_ID_1", "NODE_ID_2", "", "", "", "",
+ /* Z */ "", "", "SYSTEM_FAULT_LED_N", "FAST_THROTTLE_N",
+ "", "", "", "",
+ /* AA */ "FM_CPU0_IBMC_THERMTRIP_N", "", "PROCHOT_L_G", "",
+ "", "", "", "",
+ /* AB */ "BMC_FORCE_SELFREFRESH", "PWRGD_OUT", "", "IRQ_BMC_PCH_SMI_LPC_N",
+ "", "", "", "",
+ /* AC */ "", "", "", "", "", "", "", "";
+};
+
+&adc {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_adc0_default
+ &pinctrl_adc1_default
+ &pinctrl_adc2_default
+ &pinctrl_adc3_default
+ &pinctrl_adc4_default
+ &pinctrl_adc5_default
+ &pinctrl_adc6_default
+ &pinctrl_adc7_default
+ &pinctrl_adc8_default
+ &pinctrl_adc9_default
+ &pinctrl_adc10_default
+ &pinctrl_adc11_default
+ &pinctrl_adc12_default
+ &pinctrl_adc13_default
+ &pinctrl_adc14_default
+ &pinctrl_adc15_default>;
+};
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* Re: [PATCH v4 1/2] linux-user: add sched_getattr support
From: Laurent Vivier @ 2022-01-05 10:16 UTC (permalink / raw)
To: Tonis Tiigi, qemu-devel
In-Reply-To: <20220105041819.24160-2-tonistiigi@gmail.com>
Le 05/01/2022 à 05:18, Tonis Tiigi a écrit :
> These syscalls are not exposed by glibc. The struct type need to be
> redefined as it can't be included directly before
> https://lkml.org/lkml/2020/5/28/810 .
>
> sched_attr type can grow in future kernel versions. When client sends
> values that QEMU does not understand it will return E2BIG with same
> semantics as old kernel would so client can retry with smaller inputs.
>
> Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
> ---
> linux-user/syscall.c | 123 ++++++++++++++++++++++++++++++++++++++
> linux-user/syscall_defs.h | 14 +++++
> 2 files changed, 137 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 56a3e17183..1b8415c8a3 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -340,6 +340,25 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
> #define __NR_sys_sched_setaffinity __NR_sched_setaffinity
> _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
> unsigned long *, user_mask_ptr);
> +/* sched_attr is not defined in glibc */
> +struct sched_attr {
> + uint32_t size;
> + uint32_t sched_policy;
> + uint64_t sched_flags;
> + int32_t sched_nice;
> + uint32_t sched_priority;
> + uint64_t sched_runtime;
> + uint64_t sched_deadline;
> + uint64_t sched_period;
> + uint32_t sched_util_min;
> + uint32_t sched_util_max;
> +};
> +#define __NR_sys_sched_getattr __NR_sched_getattr
> +_syscall4(int, sys_sched_getattr, pid_t, pid, struct sched_attr *, attr,
> + unsigned int, size, unsigned int, flags);
> +#define __NR_sys_sched_setattr __NR_sched_setattr
> +_syscall3(int, sys_sched_setattr, pid_t, pid, struct sched_attr *, attr,
> + unsigned int, flags);
> #define __NR_sys_getcpu __NR_getcpu
> _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *, tcache);
> _syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd,
> @@ -558,6 +577,24 @@ const char *target_strerror(int err)
> return strerror(target_to_host_errno(err));
> }
>
> +static int check_zeroed_user(abi_long addr, size_t ksize, size_t usize)
> +{
> + int i;
> + uint8_t b;
> + if (usize <= ksize) {
> + return 1;
> + }
> + for (i = ksize; i < usize; i++) {
> + if (get_user_u8(b, addr + i)) {
> + return -TARGET_EFAULT;
> + }
> + if (b != 0) {
> + return 0;
> + }
> + }
> + return 1;
> +}
> +
> #define safe_syscall0(type, name) \
> static type safe_##name(void) \
> { \
> @@ -10594,6 +10631,92 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
> }
> case TARGET_NR_sched_getscheduler:
> return get_errno(sched_getscheduler(arg1));
> + case TARGET_NR_sched_getattr:
> + {
> + struct target_sched_attr *target_scha;
> + struct sched_attr scha;
> + if (arg2 == 0) {
> + return -TARGET_EINVAL;
> + }
> + if (arg3 > sizeof(scha)) {
> + arg3 = sizeof(scha);
> + }
> + ret = get_errno(sys_sched_getattr(arg1, &scha, arg3, arg4));
> + if (!is_error(ret)) {
> + target_scha = lock_user(VERIFY_WRITE, arg2, arg3, 0);
> + if (!target_scha) {
> + return -TARGET_EFAULT;
> + }
> + target_scha->size = tswap32(scha.size);
> + target_scha->sched_policy = tswap32(scha.sched_policy);
> + target_scha->sched_flags = tswap64(scha.sched_flags);
> + target_scha->sched_nice = tswap32(scha.sched_nice);
> + target_scha->sched_priority = tswap32(scha.sched_priority);
> + target_scha->sched_runtime = tswap64(scha.sched_runtime);
> + target_scha->sched_deadline = tswap64(scha.sched_deadline);
> + target_scha->sched_period = tswap64(scha.sched_period);
> + if (scha.size > offsetof(struct sched_attr, sched_util_min)) {
> + target_scha->sched_util_min = tswap32(scha.sched_util_min);
> + target_scha->sched_util_max = tswap32(scha.sched_util_max);
> + }
> + unlock_user(target_scha, arg2, arg3);
> + }
> + return ret;
> + }
> + case TARGET_NR_sched_setattr:
> + {
> + struct target_sched_attr *target_scha;
> + struct sched_attr scha;
> + uint32_t size;
> + int zeroed;
> + if (arg2 == 0) {
> + return -TARGET_EINVAL;
> + }
> + if (get_user_u32(size, arg2)) {
> + return -TARGET_EFAULT;
> + }
> + if (!size) {
> + size = offsetof(struct target_sched_attr, sched_util_min);
> + }
> + if (size < offsetof(struct target_sched_attr, sched_util_min)) {
> + if (put_user_u32(sizeof(struct target_sched_attr), arg2)) {
> + return -TARGET_EFAULT;
> + }
> + return -TARGET_E2BIG;
> + }
> +
> + zeroed = check_zeroed_user(arg2, sizeof(struct target_sched_attr), size);
> + if (zeroed < 0) {
> + return zeroed;
> + } else if (zeroed == 0) {
> + if (put_user_u32(sizeof(struct target_sched_attr), arg2)) {
> + return -TARGET_EFAULT;
> + }
> + return -TARGET_E2BIG;
> + }
> + if (size > sizeof(struct target_sched_attr)) {
> + size = sizeof(struct target_sched_attr);
> + }
> +
> + target_scha = lock_user(VERIFY_READ, arg2, size, 1);
> + if (!target_scha) {
> + return -TARGET_EFAULT;
> + }
> + scha.size = size;
> + scha.sched_policy = tswap32(target_scha->sched_policy);
> + scha.sched_flags = tswap64(target_scha->sched_flags);
> + scha.sched_nice = tswap32(target_scha->sched_nice);
> + scha.sched_priority = tswap32(target_scha->sched_priority);
> + scha.sched_runtime = tswap64(target_scha->sched_runtime);
> + scha.sched_deadline = tswap64(target_scha->sched_deadline);
> + scha.sched_period = tswap64(target_scha->sched_period);
> + if (size > offsetof(struct target_sched_attr, sched_util_min)) {
> + scha.sched_util_min = tswap32(target_scha->sched_util_min);
> + scha.sched_util_max = tswap32(target_scha->sched_util_max);
> + }
> + unlock_user(target_scha, arg2, 0);
> + return get_errno(sys_sched_setattr(arg1, &scha, arg3));
> + }
> case TARGET_NR_sched_yield:
> return get_errno(sched_yield());
> case TARGET_NR_sched_get_priority_max:
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index 0b13975937..310d6ce8ad 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -2914,4 +2914,18 @@ struct target_statx {
> /* 0x100 */
> };
>
> +/* from kernel's include/linux/sched/types.h */
> +struct target_sched_attr {
> + abi_uint size;
> + abi_uint sched_policy;
> + abi_ullong sched_flags;
> + abi_int sched_nice;
> + abi_uint sched_priority;
> + abi_ullong sched_runtime;
> + abi_ullong sched_deadline;
> + abi_ullong sched_period;
> + abi_uint sched_util_min;
> + abi_uint sched_util_max;
> +};
> +
> #endif
Applied to my linux-user-for-7.0 branch.
Thanks,
Laurent
^ permalink raw reply
* Re: [PATCH] thunderbolt: Check for null pointer after calling kmemdup in icm_handle_event
From: Mika Westerberg @ 2022-01-05 10:17 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: andreas.noever, michael.jamet, YehezkelShB, linux-usb,
linux-kernel
In-Reply-To: <20220105082634.2410596-1-jiasheng@iscas.ac.cn>
Hi,
On Wed, Jan 05, 2022 at 04:26:34PM +0800, Jiasheng Jiang wrote:
> As the possible failure of the allocation, kmemdup() may return NULL
> pointer.
> Like alloc_switch(), it might be better to check it.
> Therefore, icm_handle_event() should also check the return value of
> kmemdup().
> If fails, just free 'n' and directly return is enough, same as the way
> to handle the failure of kmalloc().
>
> Fixes: f67cf491175a ("thunderbolt: Add support for Internal Connection Manager (ICM)")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Thanks for the patch but I realized that this has been fixed already:
https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git/commit/?h=next&id=3cc1c6de458e0e58c413c3c35802ca96e55bbdbe
^ permalink raw reply
* Re: [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime
From: Marc Kleine-Budde @ 2022-01-05 10:18 UTC (permalink / raw)
To: Dario Binacchi; +Cc: linux-can
In-Reply-To: <CABGWkvrH2DGx2e9a0jAJycQPCW67vZiOstjt-SK=LcpS0kyd5Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 599 bytes --]
On 05.01.2022 09:22:09, Dario Binacchi wrote:
> > +static u32 flexcan_get_priv_flags(struct net_device *ndev)
> > +{
> > + const struct flexcan_priv *priv = netdev_priv(ndev);
> > + const u32 quirks = priv->devtype_data.quirks;
> > + u32 priv_flags;
>
> u32 priv_flags = 0;
Fixed.
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH v4 2/2] linux-user: call set/getscheduler set/getparam directly
From: Laurent Vivier @ 2022-01-05 10:16 UTC (permalink / raw)
To: Tonis Tiigi, qemu-devel
In-Reply-To: <20220105041819.24160-3-tonistiigi@gmail.com>
Le 05/01/2022 à 05:18, Tonis Tiigi a écrit :
> There seems to be difference in syscall and libc definition of these
> methods and therefore musl does not implement them (1e21e78bf7). Call
> syscall directly to ensure the behavior of the libc of user application,
> not the libc that was used to build QEMU.
>
> Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
> ---
> linux-user/syscall.c | 34 ++++++++++++++++++++++++----------
> linux-user/syscall_defs.h | 4 ++++
> 2 files changed, 28 insertions(+), 10 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 1b8415c8a3..30962155a6 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -359,6 +359,17 @@ _syscall4(int, sys_sched_getattr, pid_t, pid, struct sched_attr *, attr,
> #define __NR_sys_sched_setattr __NR_sched_setattr
> _syscall3(int, sys_sched_setattr, pid_t, pid, struct sched_attr *, attr,
> unsigned int, flags);
> +#define __NR_sys_sched_getscheduler __NR_sched_getscheduler
> +_syscall1(int, sys_sched_getscheduler, pid_t, pid);
> +#define __NR_sys_sched_setscheduler __NR_sched_setscheduler
> +_syscall3(int, sys_sched_setscheduler, pid_t, pid, int, policy,
> + const struct sched_param *, param);
> +#define __NR_sys_sched_getparam __NR_sched_getparam
> +_syscall2(int, sys_sched_getparam, pid_t, pid,
> + struct sched_param *, param);
> +#define __NR_sys_sched_setparam __NR_sched_setparam
> +_syscall2(int, sys_sched_setparam, pid_t, pid,
> + const struct sched_param *, param);
> #define __NR_sys_getcpu __NR_getcpu
> _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *, tcache);
> _syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd,
> @@ -10587,30 +10598,32 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
> return ret;
> case TARGET_NR_sched_setparam:
> {
> - struct sched_param *target_schp;
> + struct target_sched_param *target_schp;
> struct sched_param schp;
>
> if (arg2 == 0) {
> return -TARGET_EINVAL;
> }
> - if (!lock_user_struct(VERIFY_READ, target_schp, arg2, 1))
> + if (!lock_user_struct(VERIFY_READ, target_schp, arg2, 1)) {
> return -TARGET_EFAULT;
> + }
> schp.sched_priority = tswap32(target_schp->sched_priority);
> unlock_user_struct(target_schp, arg2, 0);
> - return get_errno(sched_setparam(arg1, &schp));
> + return get_errno(sys_sched_setparam(arg1, &schp));
> }
> case TARGET_NR_sched_getparam:
> {
> - struct sched_param *target_schp;
> + struct target_sched_param *target_schp;
> struct sched_param schp;
>
> if (arg2 == 0) {
> return -TARGET_EINVAL;
> }
> - ret = get_errno(sched_getparam(arg1, &schp));
> + ret = get_errno(sys_sched_getparam(arg1, &schp));
> if (!is_error(ret)) {
> - if (!lock_user_struct(VERIFY_WRITE, target_schp, arg2, 0))
> + if (!lock_user_struct(VERIFY_WRITE, target_schp, arg2, 0)) {
> return -TARGET_EFAULT;
> + }
> target_schp->sched_priority = tswap32(schp.sched_priority);
> unlock_user_struct(target_schp, arg2, 1);
> }
> @@ -10618,19 +10631,20 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
> return ret;
> case TARGET_NR_sched_setscheduler:
> {
> - struct sched_param *target_schp;
> + struct target_sched_param *target_schp;
> struct sched_param schp;
> if (arg3 == 0) {
> return -TARGET_EINVAL;
> }
> - if (!lock_user_struct(VERIFY_READ, target_schp, arg3, 1))
> + if (!lock_user_struct(VERIFY_READ, target_schp, arg3, 1)) {
> return -TARGET_EFAULT;
> + }
> schp.sched_priority = tswap32(target_schp->sched_priority);
> unlock_user_struct(target_schp, arg3, 0);
> - return get_errno(sched_setscheduler(arg1, arg2, &schp));
> + return get_errno(sys_sched_setscheduler(arg1, arg2, &schp));
> }
> case TARGET_NR_sched_getscheduler:
> - return get_errno(sched_getscheduler(arg1));
> + return get_errno(sys_sched_getscheduler(arg1));
> case TARGET_NR_sched_getattr:
> {
> struct target_sched_attr *target_scha;
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index 310d6ce8ad..28b9fe9a47 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -2928,4 +2928,8 @@ struct target_sched_attr {
> abi_uint sched_util_max;
> };
>
> +struct target_sched_param {
> + abi_int sched_priority;
> +};
> +
> #endif
Applied to my linux-user-for-7.0 branch.
Thanks,
Laurent
^ permalink raw reply
* Re: [PATCH v3 00/12] dmaengine: at_xdmac: Various fixes
From: Vinod Koul @ 2022-01-05 10:20 UTC (permalink / raw)
To: Tudor Ambarus
Cc: ludovic.desroches, nicolas.ferre, mripard, linux-arm-kernel,
dmaengine, linux-kernel
In-Reply-To: <20211215110115.191749-1-tudor.ambarus@microchip.com>
On 15-12-21, 13:01, Tudor Ambarus wrote:
> Bugs identified when debugging a hang encountered when operating
> an octal DTR SPI NOR memory. The culprit was the flash, not the
> DMA driver, so all these bugs are not experienced in real life,
> they are all theoretical fixes. Nevertheless the bugs are there
> and I think they should be squashed.
>
> Tested the serial with DMA on sama5d2_xplained. Tested QSPI with DMA on
> sama7g5ek. All went well.
Applied all, thanks
--
~Vinod
^ permalink raw reply
* Re: [PATCH] gitlab-ci: Enable docs in the centos job
From: Thomas Huth @ 2022-01-05 10:14 UTC (permalink / raw)
To: Alex Bennée
Cc: Marc-André Lureau, Philippe Mathieu-Daudé, qemu-devel,
Wainer dos Santos Moschetta, Beraldo Leal
In-Reply-To: <87y23ujz4b.fsf@linaro.org>
On 05/01/2022 10.44, Alex Bennée wrote:
>
> Thomas Huth <thuth@redhat.com> writes:
>
>> We just ran into a problem that the docs don't build on RHEL8 / CentOS 8
>> anymore. Seems like these distros are using one of the oldest Sphinx
>> versions that we still have to support. Thus enable the docs build in
>> the CI on CentOS so that such bugs don't slip in so easily again.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>
> Queued to testing/next, thanks.
Note that you need Marc-André's fix first, too. But I'm also planning a pull
request with a bunch of misc other patches soon, so I can also stick these
two patches in there, too.
Thomas
^ permalink raw reply
* [PATCH] io_uring: remove unused para
From: GuoYong Zheng @ 2022-01-05 10:12 UTC (permalink / raw)
To: axboe, asml.silence; +Cc: io-uring, linux-kernel, GuoYong Zheng
Para res2 is not used in __io_complete_rw, remove it.
Signed-off-by: GuoYong Zheng <zhenggy@chinatelecom.cn>
---
fs/io_uring.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index e6fb1bb..8473f955 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2858,7 +2858,7 @@ static inline void io_req_task_complete(struct io_kiocb *req, bool *locked)
}
}
-static void __io_complete_rw(struct io_kiocb *req, long res, long res2,
+static void __io_complete_rw(struct io_kiocb *req, long res,
unsigned int issue_flags)
{
if (__io_complete_rw_common(req, res))
@@ -3108,7 +3108,7 @@ static void kiocb_done(struct io_kiocb *req, ssize_t ret,
if (req->flags & REQ_F_CUR_POS)
req->file->f_pos = req->rw.kiocb.ki_pos;
if (ret >= 0 && (req->rw.kiocb.ki_complete == io_complete_rw))
- __io_complete_rw(req, ret, 0, issue_flags);
+ __io_complete_rw(req, ret, issue_flags);
else
io_rw_done(&req->rw.kiocb, ret);
--
1.8.3.1
^ permalink raw reply related
* [PATCH] io_uring: remove redundant tap space
From: GuoYong Zheng @ 2022-01-05 10:13 UTC (permalink / raw)
To: axboe, asml.silence; +Cc: io-uring, linux-kernel, GuoYong Zheng
When show fdinfo, SqMask follow two tap space, Inconsistent with
other paras, remove one.
Signed-off-by: GuoYong Zheng <zhenggy@chinatelecom.cn>
---
fs/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index e6fb1bb..78a6181 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -10553,7 +10553,7 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
* and sq_tail and cq_head are changed by userspace. But it's ok since
* we usually use these info when it is stuck.
*/
- seq_printf(m, "SqMask:\t\t0x%x\n", sq_mask);
+ seq_printf(m, "SqMask:\t0x%x\n", sq_mask);
seq_printf(m, "SqHead:\t%u\n", sq_head);
seq_printf(m, "SqTail:\t%u\n", sq_tail);
seq_printf(m, "CachedSqHead:\t%u\n", ctx->cached_sq_head);
--
1.8.3.1
^ permalink raw reply related
* Re: ANNOUNCE mdadm-4.2
From: Mariusz Tkaczyk @ 2022-01-05 10:21 UTC (permalink / raw)
To: Jes Sorensen; +Cc: Kernel.org-Linux-RAID, Mariusz Tkaczyk
In-Reply-To: <28fdbc45-96ca-7cdb-3ced-a5f65d978048@trained-monkey.org>
On Thu, 30 Dec 2021 14:52:44 -0500
Jes Sorensen <jes@trained-monkey.org> wrote:
> Hi,
>
> Finally here it is, mdadm-4.2. Thanks for all the contributions and
> your patience.
>
> Happy New Year everyone!
>
> Jes
>
> From the announce file:
>
> I am pleased to finally announce the availability of mdadm-4.2.
> get 4.2 out the door soon.
>
> It is available at the usual places:
> http://www.kernel.org/pub/linux/utils/raid/mdadm/
> and via git at
> git://git.kernel.org/pub/scm/utils/mdadm/mdadm.git
> http://git.kernel.org/cgit/utils/mdadm/
>
Hi Jes,
I can see a tarball in the first link but I cannot find 4.2 tag in git:
https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git
Could you push the tag to repository?
Thanks,
Mariusz
^ permalink raw reply
* Re: [PATCH v3 00/12] dmaengine: at_xdmac: Various fixes
From: Vinod Koul @ 2022-01-05 10:20 UTC (permalink / raw)
To: Tudor Ambarus
Cc: mripard, linux-kernel, ludovic.desroches, dmaengine,
linux-arm-kernel
In-Reply-To: <20211215110115.191749-1-tudor.ambarus@microchip.com>
On 15-12-21, 13:01, Tudor Ambarus wrote:
> Bugs identified when debugging a hang encountered when operating
> an octal DTR SPI NOR memory. The culprit was the flash, not the
> DMA driver, so all these bugs are not experienced in real life,
> they are all theoretical fixes. Nevertheless the bugs are there
> and I think they should be squashed.
>
> Tested the serial with DMA on sama5d2_xplained. Tested QSPI with DMA on
> sama7g5ek. All went well.
Applied all, thanks
--
~Vinod
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [Intel-gfx] [PATCH] drm/i915: stop including i915_irq.h from i915_drv.h
From: Jani Nikula @ 2022-01-05 10:21 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
Only include i915_irq.h where actually needed.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_crtc.c | 1 +
drivers/gpu/drm/i915/display/intel_display_trace.h | 1 +
drivers/gpu/drm/i915/gt/intel_rps.c | 1 +
drivers/gpu/drm/i915/gt/uc/intel_guc.c | 1 +
drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 1 +
drivers/gpu/drm/i915/i915_drv.h | 1 -
6 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index 16c3ca66d9f0..08ee3e17ee5c 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -12,6 +12,7 @@
#include <drm/drm_plane_helper.h>
#include <drm/drm_vblank_work.h>
+#include "i915_irq.h"
#include "i915_vgpu.h"
#include "i9xx_plane.h"
#include "icl_dsi.h"
diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h
index 4043e1276383..f05f0f9b5103 100644
--- a/drivers/gpu/drm/i915/display/intel_display_trace.h
+++ b/drivers/gpu/drm/i915/display/intel_display_trace.h
@@ -13,6 +13,7 @@
#include <linux/tracepoint.h>
#include "i915_drv.h"
+#include "i915_irq.h"
#include "intel_crtc.h"
#include "intel_display_types.h"
diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
index 54e7df788dbf..bd35e45d3aaa 100644
--- a/drivers/gpu/drm/i915/gt/intel_rps.c
+++ b/drivers/gpu/drm/i915/gt/intel_rps.c
@@ -6,6 +6,7 @@
#include <drm/i915_drm.h>
#include "i915_drv.h"
+#include "i915_irq.h"
#include "intel_breadcrumbs.h"
#include "intel_gt.h"
#include "intel_gt_clock_utils.h"
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
index 6e228343e8cb..0c52d1652e8b 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
@@ -12,6 +12,7 @@
#include "intel_guc_ads.h"
#include "intel_guc_submission.h"
#include "i915_drv.h"
+#include "i915_irq.h"
/**
* DOC: GuC
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
index ac0931f0374b..7b0b43e87244 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
@@ -7,6 +7,7 @@
#include "gt/intel_gt.h"
#include "i915_drv.h"
+#include "i915_irq.h"
#include "i915_memcpy.h"
#include "intel_guc_log.h"
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index beeb42a14aae..3967748ba347 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -106,7 +106,6 @@
#include "i915_scheduler.h"
#include "gt/intel_timeline.h"
#include "i915_vma.h"
-#include "i915_irq.h"
/* General customization:
--
2.30.2
^ permalink raw reply related
* [igt-dev] [PATCH i-g-t v2] tests/i915/gem_ctx_exec: Skip test for RCS+CCS
From: priyanka.dandamudi @ 2022-01-05 10:10 UTC (permalink / raw)
To: igt-dev, arjun.melkaveri, priyanka.dandamudi, ashutosh.dixit,
John.C.Harrison, saurabhg.gupta
From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
The test tries to submit non-preemptible spinners to all engines,
causes a hang and expects the non-preemptible spinners to survive
but fails to do for RCS+CCS.
So, updated the code to skip nohangcheck subtest for a platform with RCS+CCS.
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Melkaveri, Arjun <arjun.melkaveri@intel.com>
---
tests/i915/gem_ctx_exec.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c
index a1270a88..7b2aa390 100644
--- a/tests/i915/gem_ctx_exec.c
+++ b/tests/i915/gem_ctx_exec.c
@@ -276,6 +276,8 @@ static void nohangcheck_hostile(int i915)
int err = 0;
int dir;
uint64_t ahnd;
+ bool rcs0 = false;
+ bool ccs0 = false;
/*
* Even if the user disables hangcheck during their context,
@@ -292,6 +294,20 @@ static void nohangcheck_hostile(int i915)
ahnd = get_reloc_ahnd(i915, ctx->id);
igt_require(__enable_hangcheck(dir, false));
+ /* Skips for RCS+CCS combination when nopreemption batch submitted*/
+ for_each_ctx_engine (i915, ctx, e) {
+ if (rcs0 && ccs0)
+ break;
+ else if (!rcs0) {
+ if (e->class == I915_ENGINE_CLASS_RENDER)
+ rcs0 = true;
+ }
+ else if (!ccs0) {
+ if (e->class == I915_ENGINE_CLASS_COMPUTE)
+ ccs0 = true;
+ }
+ }
+ igt_require(!(rcs0 && ccs0));
for_each_ctx_engine(i915, ctx, e) {
igt_spin_t *spin;
--
2.25.1
^ permalink raw reply related
* Re: [PATCH] thunderbolt: Check for null pointer after calling kmemdup in icm_handle_event
From: Greg KH @ 2022-01-05 10:21 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: mika.westerberg, andreas.noever, michael.jamet, YehezkelShB,
linux-usb, linux-kernel
In-Reply-To: <20220105082634.2410596-1-jiasheng@iscas.ac.cn>
On Wed, Jan 05, 2022 at 04:26:34PM +0800, Jiasheng Jiang wrote:
> As the possible failure of the allocation, kmemdup() may return NULL
> pointer.
> Like alloc_switch(), it might be better to check it.
> Therefore, icm_handle_event() should also check the return value of
> kmemdup().
> If fails, just free 'n' and directly return is enough, same as the way
> to handle the failure of kmalloc().
I can not understand this changelog text at all, sorry. Please read the
documentation for how to write a good changelog text.
And most importantly, how did you test this change?
thanks,
greg k-h
^ permalink raw reply
* Re: [RFC 05/10] vdpa-dev: implement the realize interface
From: Stefan Hajnoczi @ 2022-01-05 10:17 UTC (permalink / raw)
To: Longpeng(Mike)
Cc: mst, jasowang, cohuck, qemu-devel, yechuan, arei.gonglei,
huangzhichao, pbonzini, sgarzare
In-Reply-To: <20220105005900.860-6-longpeng2@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 4131 bytes --]
On Wed, Jan 05, 2022 at 08:58:55AM +0800, Longpeng(Mike) wrote:
> From: Longpeng <longpeng2@huawei.com>
>
> Implements the .realize interface.
>
> Signed-off-by: Longpeng <longpeng2@huawei.com>
> ---
> hw/virtio/vdpa-dev.c | 114 +++++++++++++++++++++++++++++++++++
> include/hw/virtio/vdpa-dev.h | 8 +++
> 2 files changed, 122 insertions(+)
>
> diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c
> index 790117fb3b..2d534d837a 100644
> --- a/hw/virtio/vdpa-dev.c
> +++ b/hw/virtio/vdpa-dev.c
> @@ -15,9 +15,122 @@
> #include "sysemu/sysemu.h"
> #include "sysemu/runstate.h"
>
> +static void
> +vhost_vdpa_device_dummy_handle_output(VirtIODevice *vdev, VirtQueue *vq)
> +{
> + /* Nothing to do */
> +}
> +
> +static int vdpa_dev_get_info_by_fd(int fd, uint64_t cmd, Error **errp)
This looks similar to the helper function in a previous patch but this
time the return value type is int instead of uint32_t. Please make the
types consistent.
> +{
> + int val;
> +
> + if (ioctl(fd, cmd, &val) < 0) {
> + error_setg(errp, "vhost-vdpa-device: cmd 0x%lx failed: %s",
> + cmd, strerror(errno));
> + return -1;
> + }
> +
> + return val;
> +}
> +
> +static inline int vdpa_dev_get_queue_size(int fd, Error **errp)
> +{
> + return vdpa_dev_get_info_by_fd(fd, VHOST_VDPA_GET_VRING_NUM, errp);
> +}
> +
> +static inline int vdpa_dev_get_vqs_num(int fd, Error **errp)
> +{
> + return vdpa_dev_get_info_by_fd(fd, VHOST_VDPA_GET_VQS_NUM, errp);
> +}
> +
> +static inline int vdpa_dev_get_config_size(int fd, Error **errp)
> +{
> + return vdpa_dev_get_info_by_fd(fd, VHOST_VDPA_GET_CONFIG_SIZE, errp);
> +}
> +
> static void vhost_vdpa_device_realize(DeviceState *dev, Error **errp)
> {
> + VirtIODevice *vdev = VIRTIO_DEVICE(dev);
> + VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
> + uint32_t device_id;
> + int max_queue_size;
> + int fd;
> + int i, ret;
> +
> + fd = qemu_open(s->vdpa_dev, O_RDWR, errp);
> + if (fd == -1) {
> + return;
> + }
> + s->vdpa.device_fd = fd;
This is the field I suggest exposing as a QOM property so it can be set
from the proxy object (e.g. when the PCI proxy opens the vdpa device
before our .realize() function is called).
> +
> + max_queue_size = vdpa_dev_get_queue_size(fd, errp);
> + if (*errp) {
> + goto out;
> + }
> +
> + if (s->queue_size > max_queue_size) {
> + error_setg(errp, "vhost-vdpa-device: invalid queue_size: %d (max:%d)",
> + s->queue_size, max_queue_size);
> + goto out;
> + } else if (!s->queue_size) {
> + s->queue_size = max_queue_size;
> + }
> +
> + ret = vdpa_dev_get_vqs_num(fd, errp);
> + if (*errp) {
> + goto out;
> + }
> +
> + s->dev.nvqs = ret;
There is no input validation because we trust the kernel vDPA return
values. That seems okay for now but if there is a vhost-user version of
this in the future then input validation will be necessary to achieve
isolation between QEMU and the vhost-user processes. I suggest including
input validation code right away because it's harder to audit the code
and fix missing input validation later on.
> + s->dev.vqs = g_new0(struct vhost_virtqueue, s->dev.nvqs);
> + s->dev.vq_index = 0;
> + s->dev.vq_index_end = s->dev.nvqs;
> + s->dev.backend_features = 0;
> + s->started = false;
> +
> + ret = vhost_dev_init(&s->dev, &s->vdpa, VHOST_BACKEND_TYPE_VDPA, 0, NULL);
> + if (ret < 0) {
> + error_setg(errp, "vhost-vdpa-device: vhost initialization failed: %s",
> + strerror(-ret));
> + goto out;
> + }
> +
> + ret = s->dev.vhost_ops->vhost_get_device_id(&s->dev, &device_id);
The vhost_*() API abstracts the ioctl calls but this source file and the
PCI proxy have ioctl calls. I wonder if it's possible to move the ioctls
calls into the vhost_*() API? That would be cleaner and also make it
easier to add vhost-user vDPA support in the future.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH] ata: sata_fsl: add compile test support
From: kernel test robot @ 2022-01-05 10:22 UTC (permalink / raw)
To: kbuild-all
In-Reply-To: <20220104045748.1171439-1-damien.lemoal@opensource.wdc.com>
[-- Attachment #1: Type: text/plain, Size: 9901 bytes --]
Hi Damien,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.16-rc8 next-20220104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Damien-Le-Moal/ata-sata_fsl-add-compile-test-support/20220104-125826
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c9e6606c7fe92b50a02ce51dda82586ebdf99b48
config: openrisc-allmodconfig (https://download.01.org/0day-ci/archive/20220105/202201051820.NO5a8nXS-lkp(a)intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/3e9ce2ab1a908d2acd644bfd39d3626635919aa1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Damien-Le-Moal/ata-sata_fsl-add-compile-test-support/20220104-125826
git checkout 3e9ce2ab1a908d2acd644bfd39d3626635919aa1
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/ata/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/ata/sata_fsl.c: In function 'sata_fsl_host_intr':
>> drivers/ata/sata_fsl.c:1281:62: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
1281 | ioread32(hcr_base + CA));
| ^
drivers/ata/sata_fsl.c: At top level:
drivers/ata/sata_fsl.c:1410:22: warning: initialized field overwritten [-Woverride-init]
1410 | .can_queue = SATA_FSL_QUEUE_DEPTH,
| ^~~~~~~~~~~~~~~~~~~~
drivers/ata/sata_fsl.c:1410:22: note: (near initialization for 'sata_fsl_sht.can_queue')
vim +/if +1281 drivers/ata/sata_fsl.c
faf0b2e5afe7da Li Yang 2007-10-16 1203
faf0b2e5afe7da Li Yang 2007-10-16 1204 static void sata_fsl_host_intr(struct ata_port *ap)
faf0b2e5afe7da Li Yang 2007-10-16 1205 {
faf0b2e5afe7da Li Yang 2007-10-16 1206 struct sata_fsl_host_priv *host_priv = ap->host->private_data;
faf0b2e5afe7da Li Yang 2007-10-16 1207 void __iomem *hcr_base = host_priv->hcr_base;
752e386c247664 Tejun Heo 2010-06-25 1208 u32 hstatus, done_mask = 0;
faf0b2e5afe7da Li Yang 2007-10-16 1209 struct ata_queued_cmd *qc;
faf0b2e5afe7da Li Yang 2007-10-16 1210 u32 SError;
100f586bd0959f Shaohui Xie 2012-09-11 1211 u32 tag;
100f586bd0959f Shaohui Xie 2012-09-11 1212 u32 status_mask = INT_ON_ERROR;
faf0b2e5afe7da Li Yang 2007-10-16 1213
faf0b2e5afe7da Li Yang 2007-10-16 1214 hstatus = ioread32(hcr_base + HSTATUS);
faf0b2e5afe7da Li Yang 2007-10-16 1215
82ef04fb4c8254 Tejun Heo 2008-07-31 1216 sata_fsl_scr_read(&ap->link, SCR_ERROR, &SError);
faf0b2e5afe7da Li Yang 2007-10-16 1217
100f586bd0959f Shaohui Xie 2012-09-11 1218 /* Read command completed register */
100f586bd0959f Shaohui Xie 2012-09-11 1219 done_mask = ioread32(hcr_base + CC);
100f586bd0959f Shaohui Xie 2012-09-11 1220
100f586bd0959f Shaohui Xie 2012-09-11 1221 /* Workaround for data length mismatch errata */
100f586bd0959f Shaohui Xie 2012-09-11 1222 if (unlikely(hstatus & INT_ON_DATA_LENGTH_MISMATCH)) {
d3543b4d1b48af Jens Axboe 2018-06-19 1223 ata_qc_for_each_with_internal(ap, qc, tag) {
100f586bd0959f Shaohui Xie 2012-09-11 1224 if (qc && ata_is_atapi(qc->tf.protocol)) {
100f586bd0959f Shaohui Xie 2012-09-11 1225 u32 hcontrol;
100f586bd0959f Shaohui Xie 2012-09-11 1226 /* Set HControl[27] to clear error registers */
100f586bd0959f Shaohui Xie 2012-09-11 1227 hcontrol = ioread32(hcr_base + HCONTROL);
100f586bd0959f Shaohui Xie 2012-09-11 1228 iowrite32(hcontrol | CLEAR_ERROR,
100f586bd0959f Shaohui Xie 2012-09-11 1229 hcr_base + HCONTROL);
100f586bd0959f Shaohui Xie 2012-09-11 1230
100f586bd0959f Shaohui Xie 2012-09-11 1231 /* Clear HControl[27] */
100f586bd0959f Shaohui Xie 2012-09-11 1232 iowrite32(hcontrol & ~CLEAR_ERROR,
100f586bd0959f Shaohui Xie 2012-09-11 1233 hcr_base + HCONTROL);
100f586bd0959f Shaohui Xie 2012-09-11 1234
100f586bd0959f Shaohui Xie 2012-09-11 1235 /* Clear SError[E] bit */
100f586bd0959f Shaohui Xie 2012-09-11 1236 sata_fsl_scr_write(&ap->link, SCR_ERROR,
100f586bd0959f Shaohui Xie 2012-09-11 1237 SError);
100f586bd0959f Shaohui Xie 2012-09-11 1238
100f586bd0959f Shaohui Xie 2012-09-11 1239 /* Ignore fatal error and device error */
100f586bd0959f Shaohui Xie 2012-09-11 1240 status_mask &= ~(INT_ON_SINGL_DEVICE_ERR
100f586bd0959f Shaohui Xie 2012-09-11 1241 | INT_ON_FATAL_ERR);
100f586bd0959f Shaohui Xie 2012-09-11 1242 break;
100f586bd0959f Shaohui Xie 2012-09-11 1243 }
100f586bd0959f Shaohui Xie 2012-09-11 1244 }
100f586bd0959f Shaohui Xie 2012-09-11 1245 }
100f586bd0959f Shaohui Xie 2012-09-11 1246
faf0b2e5afe7da Li Yang 2007-10-16 1247 if (unlikely(SError & 0xFFFF0000)) {
faf0b2e5afe7da Li Yang 2007-10-16 1248 DPRINTK("serror @host_intr : 0x%x\n", SError);
faf0b2e5afe7da Li Yang 2007-10-16 1249 sata_fsl_error_intr(ap);
faf0b2e5afe7da Li Yang 2007-10-16 1250 }
faf0b2e5afe7da Li Yang 2007-10-16 1251
100f586bd0959f Shaohui Xie 2012-09-11 1252 if (unlikely(hstatus & status_mask)) {
faf0b2e5afe7da Li Yang 2007-10-16 1253 DPRINTK("error interrupt!!\n");
faf0b2e5afe7da Li Yang 2007-10-16 1254 sata_fsl_error_intr(ap);
faf0b2e5afe7da Li Yang 2007-10-16 1255 return;
faf0b2e5afe7da Li Yang 2007-10-16 1256 }
faf0b2e5afe7da Li Yang 2007-10-16 1257
034d8e8f273fcb Ashish Kalra 2008-05-20 1258 VPRINTK("Status of all queues :\n");
e3ed8939644166 Jens Axboe 2018-05-11 1259 VPRINTK("done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x,CQ=0x%x,apqa=0x%llx\n",
752e386c247664 Tejun Heo 2010-06-25 1260 done_mask,
034d8e8f273fcb Ashish Kalra 2008-05-20 1261 ioread32(hcr_base + CA),
034d8e8f273fcb Ashish Kalra 2008-05-20 1262 ioread32(hcr_base + CE),
034d8e8f273fcb Ashish Kalra 2008-05-20 1263 ioread32(hcr_base + CQ),
034d8e8f273fcb Ashish Kalra 2008-05-20 1264 ap->qc_active);
034d8e8f273fcb Ashish Kalra 2008-05-20 1265
752e386c247664 Tejun Heo 2010-06-25 1266 if (done_mask & ap->qc_active) {
034d8e8f273fcb Ashish Kalra 2008-05-20 1267 int i;
faf0b2e5afe7da Li Yang 2007-10-16 1268 /* clear CC bit, this will also complete the interrupt */
752e386c247664 Tejun Heo 2010-06-25 1269 iowrite32(done_mask, hcr_base + CC);
faf0b2e5afe7da Li Yang 2007-10-16 1270
faf0b2e5afe7da Li Yang 2007-10-16 1271 DPRINTK("Status of all queues :\n");
752e386c247664 Tejun Heo 2010-06-25 1272 DPRINTK("done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x\n",
752e386c247664 Tejun Heo 2010-06-25 1273 done_mask, ioread32(hcr_base + CA),
faf0b2e5afe7da Li Yang 2007-10-16 1274 ioread32(hcr_base + CE));
faf0b2e5afe7da Li Yang 2007-10-16 1275
faf0b2e5afe7da Li Yang 2007-10-16 1276 for (i = 0; i < SATA_FSL_QUEUE_DEPTH; i++) {
1aadf5c3bbbbb0 Tejun Heo 2010-06-25 1277 if (done_mask & (1 << i))
faf0b2e5afe7da Li Yang 2007-10-16 1278 DPRINTK
faf0b2e5afe7da Li Yang 2007-10-16 1279 ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n",
faf0b2e5afe7da Li Yang 2007-10-16 1280 i, ioread32(hcr_base + CC),
faf0b2e5afe7da Li Yang 2007-10-16 @1281 ioread32(hcr_base + CA));
faf0b2e5afe7da Li Yang 2007-10-16 1282 }
8385d756e114f2 Sascha Hauer 2019-12-13 1283 ata_qc_complete_multiple(ap, ata_qc_get_active(ap) ^ done_mask);
faf0b2e5afe7da Li Yang 2007-10-16 1284 return;
faf0b2e5afe7da Li Yang 2007-10-16 1285
88e10092f6a623 Jens Axboe 2018-05-11 1286 } else if ((ap->qc_active & (1ULL << ATA_TAG_INTERNAL))) {
faf0b2e5afe7da Li Yang 2007-10-16 1287 iowrite32(1, hcr_base + CC);
034d8e8f273fcb Ashish Kalra 2008-05-20 1288 qc = ata_qc_from_tag(ap, ATA_TAG_INTERNAL);
faf0b2e5afe7da Li Yang 2007-10-16 1289
034d8e8f273fcb Ashish Kalra 2008-05-20 1290 DPRINTK("completing non-ncq cmd, CC=0x%x\n",
034d8e8f273fcb Ashish Kalra 2008-05-20 1291 ioread32(hcr_base + CC));
faf0b2e5afe7da Li Yang 2007-10-16 1292
034d8e8f273fcb Ashish Kalra 2008-05-20 1293 if (qc) {
faf0b2e5afe7da Li Yang 2007-10-16 1294 ata_qc_complete(qc);
034d8e8f273fcb Ashish Kalra 2008-05-20 1295 }
faf0b2e5afe7da Li Yang 2007-10-16 1296 } else {
faf0b2e5afe7da Li Yang 2007-10-16 1297 /* Spurious Interrupt!! */
faf0b2e5afe7da Li Yang 2007-10-16 1298 DPRINTK("spurious interrupt!!, CC = 0x%x\n",
faf0b2e5afe7da Li Yang 2007-10-16 1299 ioread32(hcr_base + CC));
752e386c247664 Tejun Heo 2010-06-25 1300 iowrite32(done_mask, hcr_base + CC);
faf0b2e5afe7da Li Yang 2007-10-16 1301 return;
faf0b2e5afe7da Li Yang 2007-10-16 1302 }
faf0b2e5afe7da Li Yang 2007-10-16 1303 }
faf0b2e5afe7da Li Yang 2007-10-16 1304
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* Re: [PATCH] arm64: fix build error when use rodata_enabled
From: kernel test robot @ 2022-01-05 10:22 UTC (permalink / raw)
To: kbuild-all
In-Reply-To: <1641352075-25200-1-git-send-email-alios_sys_security@linux.alibaba.com>
[-- Attachment #1: Type: text/plain, Size: 5050 bytes --]
Hi AliOS,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-s032-20220105 (https://download.01.org/0day-ci/archive/20220105/202201051817.4KPMZJag-lkp(a)intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/6af4245e93d33d4f4a79a560a707539be994f73e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
git checkout 6af4245e93d33d4f4a79a560a707539be994f73e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
arch/arm64/mm/mmu.c: In function 'map_entry_trampoline':
>> arch/arm64/mm/mmu.c:627:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
627 | phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
| ^~~~~~~~~~~
vim +627 arch/arm64/mm/mmu.c
28b066da69b937 Ard Biesheuvel 2017-03-09 618
51a0048beb4496 Will Deacon 2017-11-14 619 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
51a0048beb4496 Will Deacon 2017-11-14 620 static int __init map_entry_trampoline(void)
51a0048beb4496 Will Deacon 2017-11-14 621 {
6af4245e93d33d AliOS system security 2022-01-05 622 pgprot_t prot = PAGE_KERNEL_EXEC;
6af4245e93d33d AliOS system security 2022-01-05 623 #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
6af4245e93d33d AliOS system security 2022-01-05 624 if (rodata_enabled)
6af4245e93d33d AliOS system security 2022-01-05 625 prot = PAGE_KERNEL_ROX;
6af4245e93d33d AliOS system security 2022-01-05 626 #endif
51a0048beb4496 Will Deacon 2017-11-14 @627 phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
51a0048beb4496 Will Deacon 2017-11-14 628
51a0048beb4496 Will Deacon 2017-11-14 629 /* The trampoline is always mapped and can therefore be global */
51a0048beb4496 Will Deacon 2017-11-14 630 pgprot_val(prot) &= ~PTE_NG;
51a0048beb4496 Will Deacon 2017-11-14 631
51a0048beb4496 Will Deacon 2017-11-14 632 /* Map only the text into the trampoline page table */
51a0048beb4496 Will Deacon 2017-11-14 633 memset(tramp_pg_dir, 0, PGD_SIZE);
51a0048beb4496 Will Deacon 2017-11-14 634 __create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
475ba3fc194b64 Will Deacon 2019-04-08 635 prot, __pgd_pgtable_alloc, 0);
51a0048beb4496 Will Deacon 2017-11-14 636
6c27c4082f4f70 Will Deacon 2017-12-06 637 /* Map both the text and data into the kernel page table */
51a0048beb4496 Will Deacon 2017-11-14 638 __set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
6c27c4082f4f70 Will Deacon 2017-12-06 639 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
6c27c4082f4f70 Will Deacon 2017-12-06 640 extern char __entry_tramp_data_start[];
6c27c4082f4f70 Will Deacon 2017-12-06 641
6c27c4082f4f70 Will Deacon 2017-12-06 642 __set_fixmap(FIX_ENTRY_TRAMP_DATA,
6c27c4082f4f70 Will Deacon 2017-12-06 643 __pa_symbol(__entry_tramp_data_start),
6c27c4082f4f70 Will Deacon 2017-12-06 644 PAGE_KERNEL_RO);
6c27c4082f4f70 Will Deacon 2017-12-06 645 }
6c27c4082f4f70 Will Deacon 2017-12-06 646
51a0048beb4496 Will Deacon 2017-11-14 647 return 0;
51a0048beb4496 Will Deacon 2017-11-14 648 }
51a0048beb4496 Will Deacon 2017-11-14 649 core_initcall(map_entry_trampoline);
51a0048beb4496 Will Deacon 2017-11-14 650 #endif
51a0048beb4496 Will Deacon 2017-11-14 651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply
* Re: [PATCH] arm64: fix build error when use rodata_enabled
From: kernel test robot @ 2022-01-05 10:22 UTC (permalink / raw)
To: AliOS system security, catalin.marinas, will
Cc: kbuild-all, linux-arm-kernel, linux-kernel, AliOS system security
In-Reply-To: <1641352075-25200-1-git-send-email-alios_sys_security@linux.alibaba.com>
Hi AliOS,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-s032-20220105 (https://download.01.org/0day-ci/archive/20220105/202201051817.4KPMZJag-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/6af4245e93d33d4f4a79a560a707539be994f73e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
git checkout 6af4245e93d33d4f4a79a560a707539be994f73e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
arch/arm64/mm/mmu.c: In function 'map_entry_trampoline':
>> arch/arm64/mm/mmu.c:627:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
627 | phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
| ^~~~~~~~~~~
vim +627 arch/arm64/mm/mmu.c
28b066da69b937 Ard Biesheuvel 2017-03-09 618
51a0048beb4496 Will Deacon 2017-11-14 619 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
51a0048beb4496 Will Deacon 2017-11-14 620 static int __init map_entry_trampoline(void)
51a0048beb4496 Will Deacon 2017-11-14 621 {
6af4245e93d33d AliOS system security 2022-01-05 622 pgprot_t prot = PAGE_KERNEL_EXEC;
6af4245e93d33d AliOS system security 2022-01-05 623 #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
6af4245e93d33d AliOS system security 2022-01-05 624 if (rodata_enabled)
6af4245e93d33d AliOS system security 2022-01-05 625 prot = PAGE_KERNEL_ROX;
6af4245e93d33d AliOS system security 2022-01-05 626 #endif
51a0048beb4496 Will Deacon 2017-11-14 @627 phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
51a0048beb4496 Will Deacon 2017-11-14 628
51a0048beb4496 Will Deacon 2017-11-14 629 /* The trampoline is always mapped and can therefore be global */
51a0048beb4496 Will Deacon 2017-11-14 630 pgprot_val(prot) &= ~PTE_NG;
51a0048beb4496 Will Deacon 2017-11-14 631
51a0048beb4496 Will Deacon 2017-11-14 632 /* Map only the text into the trampoline page table */
51a0048beb4496 Will Deacon 2017-11-14 633 memset(tramp_pg_dir, 0, PGD_SIZE);
51a0048beb4496 Will Deacon 2017-11-14 634 __create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
475ba3fc194b64 Will Deacon 2019-04-08 635 prot, __pgd_pgtable_alloc, 0);
51a0048beb4496 Will Deacon 2017-11-14 636
6c27c4082f4f70 Will Deacon 2017-12-06 637 /* Map both the text and data into the kernel page table */
51a0048beb4496 Will Deacon 2017-11-14 638 __set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
6c27c4082f4f70 Will Deacon 2017-12-06 639 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
6c27c4082f4f70 Will Deacon 2017-12-06 640 extern char __entry_tramp_data_start[];
6c27c4082f4f70 Will Deacon 2017-12-06 641
6c27c4082f4f70 Will Deacon 2017-12-06 642 __set_fixmap(FIX_ENTRY_TRAMP_DATA,
6c27c4082f4f70 Will Deacon 2017-12-06 643 __pa_symbol(__entry_tramp_data_start),
6c27c4082f4f70 Will Deacon 2017-12-06 644 PAGE_KERNEL_RO);
6c27c4082f4f70 Will Deacon 2017-12-06 645 }
6c27c4082f4f70 Will Deacon 2017-12-06 646
51a0048beb4496 Will Deacon 2017-11-14 647 return 0;
51a0048beb4496 Will Deacon 2017-11-14 648 }
51a0048beb4496 Will Deacon 2017-11-14 649 core_initcall(map_entry_trampoline);
51a0048beb4496 Will Deacon 2017-11-14 650 #endif
51a0048beb4496 Will Deacon 2017-11-14 651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [PATCH net-next] mlxsw: pci: Avoid flow control for EMAD packets
From: Ido Schimmel @ 2022-01-05 10:22 UTC (permalink / raw)
To: netdev; +Cc: davem, kuba, petrm, danieller, mlxsw, Ido Schimmel
From: Danielle Ratson <danieller@nvidia.com>
Locally generated packets ingress the device through its CPU port. When
the CPU port is congested and there are not enough credits in its
headroom buffer, packets can be dropped.
While this might be acceptable for data packets that traverse the
network, configuration packets exchanged between the host and the device
(EMADs) should not be subjected to this flow control.
The "sdq_lp" bit in the SDQ (Send Descriptor Queue) context allows the
host to instruct the device to treat packets sent on this queue as
"local processing" and always process them, regardless of the state of
the CPU port's headroom.
Add the definition of this bit and set it for the dedicated SDQ reserved
for the transmission of EMAD packets. This makes the "local processing"
bit in the WQE (Work Queue Element) redundant, so clear it.
Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/cmd.h | 12 ++++++++++++
drivers/net/ethernet/mellanox/mlxsw/pci.c | 6 +++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/cmd.h b/drivers/net/ethernet/mellanox/mlxsw/cmd.h
index 392ce3cb27f7..51b260d54237 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/cmd.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/cmd.h
@@ -935,6 +935,18 @@ static inline int mlxsw_cmd_sw2hw_rdq(struct mlxsw_core *mlxsw_core,
*/
MLXSW_ITEM32(cmd_mbox, sw2hw_dq, cq, 0x00, 24, 8);
+enum mlxsw_cmd_mbox_sw2hw_dq_sdq_lp {
+ MLXSW_CMD_MBOX_SW2HW_DQ_SDQ_LP_WQE,
+ MLXSW_CMD_MBOX_SW2HW_DQ_SDQ_LP_IGNORE_WQE,
+};
+
+/* cmd_mbox_sw2hw_dq_sdq_lp
+ * SDQ local Processing
+ * 0: local processing by wqe.lp
+ * 1: local processing (ignoring wqe.lp)
+ */
+MLXSW_ITEM32(cmd_mbox, sw2hw_dq, sdq_lp, 0x00, 23, 1);
+
/* cmd_mbox_sw2hw_dq_sdq_tclass
* SDQ: CPU Egress TClass
* RDQ: Reserved
diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
index cd3331a077bb..f91dde4df152 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
@@ -285,6 +285,7 @@ static int mlxsw_pci_sdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
struct mlxsw_pci_queue *q)
{
int tclass;
+ int lp;
int i;
int err;
@@ -292,9 +293,12 @@ static int mlxsw_pci_sdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
q->consumer_counter = 0;
tclass = q->num == MLXSW_PCI_SDQ_EMAD_INDEX ? MLXSW_PCI_SDQ_EMAD_TC :
MLXSW_PCI_SDQ_CTL_TC;
+ lp = q->num == MLXSW_PCI_SDQ_EMAD_INDEX ? MLXSW_CMD_MBOX_SW2HW_DQ_SDQ_LP_IGNORE_WQE :
+ MLXSW_CMD_MBOX_SW2HW_DQ_SDQ_LP_WQE;
/* Set CQ of same number of this SDQ. */
mlxsw_cmd_mbox_sw2hw_dq_cq_set(mbox, q->num);
+ mlxsw_cmd_mbox_sw2hw_dq_sdq_lp_set(mbox, lp);
mlxsw_cmd_mbox_sw2hw_dq_sdq_tclass_set(mbox, tclass);
mlxsw_cmd_mbox_sw2hw_dq_log2_dq_sz_set(mbox, 3); /* 8 pages */
for (i = 0; i < MLXSW_PCI_AQ_PAGES; i++) {
@@ -1678,7 +1682,7 @@ static int mlxsw_pci_skb_transmit(void *bus_priv, struct sk_buff *skb,
wqe = elem_info->elem;
mlxsw_pci_wqe_c_set(wqe, 1); /* always report completion */
- mlxsw_pci_wqe_lp_set(wqe, !!tx_info->is_emad);
+ mlxsw_pci_wqe_lp_set(wqe, 0);
mlxsw_pci_wqe_type_set(wqe, MLXSW_PCI_WQE_TYPE_ETHERNET);
err = mlxsw_pci_wqe_frag_map(mlxsw_pci, wqe, 0, skb->data,
--
2.33.1
^ permalink raw reply related
* Re: [PATCH] arm64: fix build error when use rodata_enabled
From: kernel test robot @ 2022-01-05 10:22 UTC (permalink / raw)
To: AliOS system security, catalin.marinas, will
Cc: kbuild-all, linux-arm-kernel, linux-kernel, AliOS system security
In-Reply-To: <1641352075-25200-1-git-send-email-alios_sys_security@linux.alibaba.com>
Hi AliOS,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-s032-20220105 (https://download.01.org/0day-ci/archive/20220105/202201051817.4KPMZJag-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/6af4245e93d33d4f4a79a560a707539be994f73e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
git checkout 6af4245e93d33d4f4a79a560a707539be994f73e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
arch/arm64/mm/mmu.c: In function 'map_entry_trampoline':
>> arch/arm64/mm/mmu.c:627:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
627 | phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
| ^~~~~~~~~~~
vim +627 arch/arm64/mm/mmu.c
28b066da69b937 Ard Biesheuvel 2017-03-09 618
51a0048beb4496 Will Deacon 2017-11-14 619 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
51a0048beb4496 Will Deacon 2017-11-14 620 static int __init map_entry_trampoline(void)
51a0048beb4496 Will Deacon 2017-11-14 621 {
6af4245e93d33d AliOS system security 2022-01-05 622 pgprot_t prot = PAGE_KERNEL_EXEC;
6af4245e93d33d AliOS system security 2022-01-05 623 #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
6af4245e93d33d AliOS system security 2022-01-05 624 if (rodata_enabled)
6af4245e93d33d AliOS system security 2022-01-05 625 prot = PAGE_KERNEL_ROX;
6af4245e93d33d AliOS system security 2022-01-05 626 #endif
51a0048beb4496 Will Deacon 2017-11-14 @627 phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
51a0048beb4496 Will Deacon 2017-11-14 628
51a0048beb4496 Will Deacon 2017-11-14 629 /* The trampoline is always mapped and can therefore be global */
51a0048beb4496 Will Deacon 2017-11-14 630 pgprot_val(prot) &= ~PTE_NG;
51a0048beb4496 Will Deacon 2017-11-14 631
51a0048beb4496 Will Deacon 2017-11-14 632 /* Map only the text into the trampoline page table */
51a0048beb4496 Will Deacon 2017-11-14 633 memset(tramp_pg_dir, 0, PGD_SIZE);
51a0048beb4496 Will Deacon 2017-11-14 634 __create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
475ba3fc194b64 Will Deacon 2019-04-08 635 prot, __pgd_pgtable_alloc, 0);
51a0048beb4496 Will Deacon 2017-11-14 636
6c27c4082f4f70 Will Deacon 2017-12-06 637 /* Map both the text and data into the kernel page table */
51a0048beb4496 Will Deacon 2017-11-14 638 __set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
6c27c4082f4f70 Will Deacon 2017-12-06 639 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
6c27c4082f4f70 Will Deacon 2017-12-06 640 extern char __entry_tramp_data_start[];
6c27c4082f4f70 Will Deacon 2017-12-06 641
6c27c4082f4f70 Will Deacon 2017-12-06 642 __set_fixmap(FIX_ENTRY_TRAMP_DATA,
6c27c4082f4f70 Will Deacon 2017-12-06 643 __pa_symbol(__entry_tramp_data_start),
6c27c4082f4f70 Will Deacon 2017-12-06 644 PAGE_KERNEL_RO);
6c27c4082f4f70 Will Deacon 2017-12-06 645 }
6c27c4082f4f70 Will Deacon 2017-12-06 646
51a0048beb4496 Will Deacon 2017-11-14 647 return 0;
51a0048beb4496 Will Deacon 2017-11-14 648 }
51a0048beb4496 Will Deacon 2017-11-14 649 core_initcall(map_entry_trampoline);
51a0048beb4496 Will Deacon 2017-11-14 650 #endif
51a0048beb4496 Will Deacon 2017-11-14 651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ 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.