Michael S. Tsirkin | 30 Nov 09:53 2015

[PATCH RFC] virtio: skip avail/used index reads

This adds a new vring feature bit: when enabled, host and guest poll the
available/used ring directly instead of looking at the index field

To guarantee it is possible to detect updates, the high bits (above
vring.num - 1) in the ring head ID value are modified to match the index
bits - these change on each wrap-around.  Writer also XORs this with
0x8000 such that rings can be zero-initialized.

Reader is modified to ignore these high bits when looking
up descriptors.

The point is to reduce the number of cacheline misses
for both reads and writes.

I see a speedup of about 20% on a multithreaded micro-benchmark
(virtio-test), but regression of about 2% on a single-threaded one
(vring_bench).  I think this has to do with the fact that
complete_multi_user is implemented suboptimally.

	investigate single-threaded regression
	better name for a feature flag
	split the patch to make it easier to review
	look at more aggressive ring layout changes
	write a spec patch

This is on top of the following patches in my tree:
	virtio_ring: Shadow available ring flags & index
	vhost: replace % with & on data path
(Continue reading)

Emilio López | 25 Nov 16:45 2015

[PATCH v1 0/1] ioctl to disallow detaching kernel USB drivers

Hi everyone,

This patch introduces a new ioctl, USBDEVFS_DROP_PRIVILEGES,
to voluntarily forgo the ability to issue ioctls which may
interfere with other users of the USB device.

This feature allows a privileged process (in the case of Chrome OS,
permission_broker) to open a USB device node and then drop a number
of capabilities that are considered "privileged". These privileges
include the ability to reset the device if there are other users
(most notably a kernel driver) or to disconnect a kernel driver
from the device. The file descriptor can then be passed to an
unprivileged process.

This is useful for granting a process access to a device with
multiple functions. It won't be able to use its access to one
function to disrupt or take over control of another function.

This patch is currently being used in Chrome OS; I have updated it
to be in line with changes in v4.4-rc.


Reilly Grant (1):
  usb: devio: Add ioctl to disallow detaching kernel USB drivers.

 drivers/usb/core/devio.c          | 50 +++++++++++++++++++++++++++++++++++----
 include/uapi/linux/usbdevice_fs.h |  1 +
 2 files changed, 47 insertions(+), 4 deletions(-)
(Continue reading)

Vladimir Murzin | 25 Nov 11:33 2015

[RFC PATCH 00/10] Support for Cortex-M Prototyping System


This patch series provide the basic support for running ucLinux on V2M-MPS2

With these patches applied ucLinux can be run on both HW and FVP models
with Cortex-M3/M4/M7 configurations.

Board description:


Application notes (cover Cortex-M3/M4/M7):


Cortex-M System Design Kit (referenced as CMDK from documents above):


I'd be happy to hear any feedback/comments on this series!

Remain questions:

 - Application notes 399/400 have PSRAM located at address different to what
   we have for AN385/AN386, so I'm wondering what is the best practice to handle
   CONFIG_DRAM_BASE? Different defconfig or there is better place?
(Continue reading)

Gabriel L. Somlo | 23 Nov 16:57 2015

[PATCH v5 0/4] SysFS driver for QEMU fw_cfg device

Allow access to QEMU firmware blobs, passed into the guest VM via
the fw_cfg device, through SysFS entries. Blob meta-data (e.g. name,
size, and fw_cfg key), as well as the raw binary blob data may be

The SysFS access location is /sys/firmware/qemu_fw_cfg/... and was
selected based on overall similarity to the type of information
exposed under /sys/firmware/dmi/entries/...

New since v4:

	Documentation (Patches 1/4 and 4/4) now points to the authoritative
	file in the QEMU source tree for any details related to the "hardware
	interface" of the fw_cfg device; Only details specific to sysfs (1/4) 
	and DT (4/4) should stay in the kernel docs.


>New (since v3):
>	Patch 1/4: Device probing now works with either ACPI, DT, or
>		   optionally by manually specifying a base, size, and
>		   register offsets on the command line. This way, all
>		   architectures offering fw_cfg can be supported, although
>		   x86 and ARM get *automatic* support via ACPI and/or DT.
>		   HUGE thanks to Laszlo Ersek <lersek@...> for
>		   pointing out drivers/virtio/virtio_mmio.c, as an example
>		   on how to pull this off !!!
(Continue reading)

Sriram Raghunathan | 19 Nov 18:15 2015

[PATCH 1/1] Replacing return statements with existinig goto statement

The below code, calls the goto variable, instead of calling the a return. 
goto does the same function call. Patch intends more of a cleanup than a change 
to existing behavior.

Signed-off-by: Sriram Raghunathan <sriram@...>
 tools/testing/selftests/ipc/msgque.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c
index 1b2ce33..7b68381 100644
--- a/tools/testing/selftests/ipc/msgque.c
+++ b/tools/testing/selftests/ipc/msgque.c
 <at>  <at>  -197,13 +197,13  <at>  <at>  int main(int argc, char **argv)

 	if (getuid() != 0) {
 		printf("Please run the test as root - Exiting.\n");
-		return ksft_exit_fail();
+		goto err_out;

 	msgque.key = ftok(argv[0], 822155650);
 	if (msgque.key == -1) {
 		printf("Can't make key: %d\n", -errno);
-		return ksft_exit_fail();
+		goto err_out;

 	msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666);
 <at>  <at>  -247,7 +247,7  <at>  <at>  int main(int argc, char **argv)
(Continue reading)

Prarit Bhargava | 18 Nov 18:04 2015

[PATCH] tools, testing, add test for intel_pstate driver

This test used the cpupower utility to set the cpu frequency from the
maximum turbo value to the minimum supported value in steps of 100 MHz.

The results are displayed in a table which indicate the "Target" state,
or the requested frequency in MHz, the Actual frequency, as read from
/proc/cpuinfo, the difference between the Target and Actual frequencies,
and the value of MSR 0x199 (MSR_IA32_PERF_CTL) which indicates what
pstate the cpu is in, and the value of
/sys/devices/system/cpu/intel_pstate/max_perf_pct X maximum turbo state

Cc: Shuah Khan <shuahkh@...>
Cc: linux-api@...
Signed-off-by: Prarit Bhargava <prarit@...>
 tools/testing/selftests/intel_pstate/Makefile |   15 ++++
 tools/testing/selftests/intel_pstate/aperf.c  |   80 +++++++++++++++++
 tools/testing/selftests/intel_pstate/msr.c    |   39 +++++++++
 tools/testing/selftests/intel_pstate/run.sh   |  113 +++++++++++++++++++++++++
 4 files changed, 247 insertions(+)
 create mode 100644 tools/testing/selftests/intel_pstate/Makefile
 create mode 100644 tools/testing/selftests/intel_pstate/aperf.c
 create mode 100644 tools/testing/selftests/intel_pstate/msr.c
 create mode 100755 tools/testing/selftests/intel_pstate/run.sh

diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile
new file mode 100644
index 0000000..f5f1a28
--- /dev/null
+++ b/tools/testing/selftests/intel_pstate/Makefile
 <at>  <at>  -0,0 +1,15  <at>  <at> 
(Continue reading)

Andrew F. Davis | 17 Nov 18:07 2015

Re: [PATCH 2/2] iio: health: Add driver for the TI AFE4404 heart monitor

On 11/15/2015 06:07 AM, Jonathan Cameron wrote:
> On 10/11/15 19:19, Andrew F. Davis wrote:
>> On 11/05/2015 01:09 PM, Jonathan Cameron wrote:
>>> Lars, Hartmut, Peter,
>>> This is becoming a really involved ABI discussion so I'd like some
>>> input on this if any of you have the time.
>>> I'm going to be busy now until at least the weekend...
>>> On 04/11/15 21:17, Andrew F. Davis wrote:
>>>> On 11/04/2015 01:40 PM, Jonathan Cameron wrote:
>>>>> On 02/11/15 20:37, Andrew F. Davis wrote:
>>>>>> On 11/01/2015 02:52 PM, Jonathan Cameron wrote:
>>>>>>> On 31/10/15 16:31, Andrew F. Davis wrote:
>>>>>>>> Add driver for the TI AFE4404 heart rate monitor and pulse oximeter.
>>>>>>>> This device detects reflected LED light fluctuations and presents an ADC
>>>>>>>> value to the user space for further signal processing.
>>>>>>>> Data sheet located here:
>>>>>>>> http://www.ti.com/product/AFE4404/datasheet
>>>>>>>> Signed-off-by: Andrew F. Davis <afd@...>
>>>>>>> Hi Andrew,
>>>>>>> Good to see this resurface.  It's a fascinating little device.
>>>>>>> Anyhow, most of the interesting bit in here is unsuprisingly concerned
>>>>>>> with the interface.  I know we went round a few loops of this before but
>>>>>>> it still feels like we haven't worked out to handle it well.  I would like
(Continue reading)

Bamvor Jian Zhang | 17 Nov 15:35 2015

[PATCH V2 0/3] Clean up and enable two testcases in kselftest

These patches try to enable two testcases (capabilities and ipc) and
make them build successful in cross compiling environment.

Clean up the Makefile of capabilities according to the usage in

Changes since v1
1.  Update Makefile of capabilities according to Michael's suggestion.
    reference commit message for details.

Bamvor Jian Zhang (3):
  selftests/capabilities: clean up for Makefile
  selftests/capabilities: actually test it
  selftest/ipc: actually test it

 tools/testing/selftests/Makefile              |  2 ++
 tools/testing/selftests/capabilities/Makefile | 21 +++++++++------------
 2 files changed, 11 insertions(+), 12 deletions(-)



Bamvor Jian Zhang | 17 Nov 15:34 2015

[PATCH V2 0/2] Create specific kconfig for kselftest

There is a discussion about improving the usability of kselftest by
creating test-specific kconfig in recent kernel Summit. Furthormore,
there are different approaches to do it:

1) keep test-specific kconfig fragments inside each selftest so that
merge_configs.sh could build up a kernel that can test the specific
or all feature(s).

2) In the main menu, have an additional option/flag for each feature
that should be enabled when ksefltests are wanted.  Similar to the

Patch 1/2: do option 1. Hope it is a good start for discussion.

Patch 2/2: add config option(kselftest-mergeconfig) in make file as a
helper to merge all the test config dependecies to .config.

Changes since v1[1]:
1.  Add kselftest-mergeconfig in scripts/kconfig/Makefile according
    to the suggestion from Michael.

[1] http://www.spinics.net/lists/linux-api/msg15533.html

Bamvor Jian Zhang (2):
  selftests: create test-specific kconfig fragments
  scripts/kconfig/Makefile: add kselftest-mergeconfig

 scripts/kconfig/Makefile                      | 9 +++++++++
 tools/testing/selftests/cpu-hotplug/config    | 2 ++
 tools/testing/selftests/firmware/config       | 1 +
(Continue reading)

Andy Lutomirski | 16 Nov 19:49 2015

Re: [PATCH 2/3] selftests/capabilities: actually test it

On Sun, Nov 15, 2015 at 9:18 PM, Michael Ellerman <mpe@...> wrote:
> On Sat, 2015-11-14 at 14:01 +0800, Bamvor Jian Zhang wrote:
>> The capatabilities exist in selftest but no in the TARGET list.
>> Add it to the TARGET.
>> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@...>
>> ---
>>  tools/testing/selftests/Makefile | 1 +
>>  1 file changed, 1 insertion(+)
>> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
>> index 2458288..71b147e 100644
>> --- a/tools/testing/selftests/Makefile
>> +++ b/tools/testing/selftests/Makefile
>>  <at>  <at>  -1,4 +1,5  <at>  <at> 
>>  TARGETS = breakpoints
>> +TARGETS += capabilities
>>  TARGETS += cpu-hotplug
>>  TARGETS += efivarfs
>>  TARGETS += exec
> This breaks when you use TARGETS on the command line, eg:

Taking a step back for a second: isn't the variable you want

(Continue reading)

Bamvor Zhang Jian | 16 Nov 09:52 2015

Re: [PATCH 1/3] selftests/capabilities: align the usage of CFLAGS with others

Hi, Michael

On 11/16/2015 01:16 PM, Michael Ellerman wrote:
> On Sat, 2015-11-14 at 14:01 +0800, Bamvor Jian Zhang wrote:
>> User need to provide cap-ng.h and libcap-ng.so for cross compiling
>> which could be done by pass extra cflags to EXTRA_CLAGS. But other
>> testcases pass CFLAGS instead.
>> Change CLAGS ':=' to CLAGS '+=' to align with others. Delete useless
>> EXTRA_CLAGS at the same time.
> Actually I think you can clean this up even more. I don't see any reason it
> can't use the implicit rule for compilation.
> Also libraries should be in LDLIBS, not CFLAGS. And we can change the ordering
> so that we don't need to define all multiple times.
> Can you test this works for you?
> cheers
> diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1f0889..5f690c1ae894 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
>  <at>  <at>  -1,18 +1,14  <at>  <at> 
> -all:
> -
> -include ../lib.mk
(Continue reading)