Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Files #1

Merged
merged 119 commits into from
May 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
839c422
Input: synaptics-rmi4 - fix an unchecked out of memory error path
tititiou36 Apr 6, 2018
6bd6ae6
Input: leds - fix out of bound access
dtor Apr 6, 2018
349fa7d
ext4: prevent right-shifting extents beyond EXT_MAX_BLOCKS
ebiggers Apr 12, 2018
f0cf47d
KVM: arm/arm64: Close VMID generation race
Apr 4, 2018
6522404
MAINTAINERS: Update e-mail address for Christoffer Dall
christofferdall-arm Apr 16, 2018
165d102
arm64: KVM: Demote SVE and LORegion warnings to debug only
Mar 26, 2018
bf9a413
KVM: arm/arm64: vgic: Kick new VCPU on interrupt migration
Andre-ARM Apr 17, 2018
b42db08
xfs: enhance dinode verifier
sandeen Apr 17, 2018
2c4306f
xfs: set format back to extents if xfs_bmap_extents_to_btree
Apr 17, 2018
7d83fb1
xfs: prevent creating negative-sized file via INSERT_RANGE
djwong Apr 17, 2018
7b38460
xfs: don't fail when converting shortform attr to long form during AT…
djwong Apr 18, 2018
14a8f0d
i2c: Remove depends on HAS_DMA in case of platform dependency
geertu Apr 17, 2018
675edea
Documentation/i2c: whitespace cleanup
samhansen Apr 13, 2018
b50cb3e
Documentation/i2c: sync docs with current state of i2c-tools
samhansen Apr 13, 2018
40d802c
Documentation/i2c: adopt kernel commenting style in examples
samhansen Apr 13, 2018
b256926
ext4: set h_journal if there is a failure starting a reserved handle
tytso Apr 18, 2018
85bd0ba
arm/arm64: KVM: Add PSCI version selection API
Jan 21, 2018
b346e49
crypto: api - fix finding algorithm currently being tested
ebiggers Apr 16, 2018
eea0d3e
crypto: drbg - set freed buffers to NULL
smuellerDD Apr 12, 2018
f286299
scsi: storvsc: Set up correct queue depth values for IDE devices
longlimsft Mar 22, 2018
4bc83b3
scsi: isci: Fix infinite loop in while loop
Apr 20, 2018
f5957da
scsi: target: Fix fortify_panic kernel exception
bgly Apr 17, 2018
7010adc
x86/jailhouse: Fix incorrect SPDX identifier
KAGA-KOKO Apr 22, 2018
ee05d21
perf machine: Set main kernel end address properly
namhyung Feb 19, 2018
ce04abf
perf list: Remove s390 specific strcmp_cpuid_cmp function
Apr 23, 2018
b31a8cc
perf test: Adapt test case record+probe_libc_inet_pton.sh for s390
Apr 23, 2018
129193b
perf stat: Keep the / modifier separator in fallback
olsajiri Apr 23, 2018
9a4a931
perf pmu: Fix pmu events parsing rule
olsajiri Apr 23, 2018
e9add8b
perf evsel: Disable write_backward for leader sampling group events
olsajiri Apr 23, 2018
3138a2e
perf mem: Document incorrect and missing options
qpakzk Apr 22, 2018
5d9946c
perf record: Fix s390 undefined record__auxtrace_init() return value
Apr 23, 2018
9c71b2c
Input: alps - fix reporting pressure of v3 trackstick
pali Apr 23, 2018
6f226cf
Input: hideep_ts - fix a typo in Kconfig
standby24x7 Apr 23, 2018
596ea7a
MAINTAINERS: Rakesh Iyer can't be reached anymore
Apr 23, 2018
fb5924f
powerpc/mm: Flush cache on memory hot(un)plug
bsingharora Apr 6, 2018
7fd6641
powerpc/powernv/memtrace: Let the arch hotunplug code flush cache
bsingharora Apr 6, 2018
28a5933
powerpc/powernv/npu: Add lock to prevent race in concurrent context i…
apopple Apr 11, 2018
a1409ad
powerpc/powernv/npu: Prevent overwriting of pnv_npu2_init_contex() ca…
apopple Apr 11, 2018
d0cf9b5
powerpc/powernv/npu: Do a PID GPU TLB flush when invalidating a large…
apopple Apr 17, 2018
75ecfb4
powerpc/mce: Fix a bug where mce loops on memory UE.
maheshsal Apr 23, 2018
84749d8
x86/microcode/intel: Save microcode patch unconditionally
suryasaimadhu Apr 21, 2018
09e182d
x86/microcode: Do not exit early from __reload_late()
suryasaimadhu Apr 21, 2018
117e3b7
CIFS: set *resp_buf_type to NO_BUFFER on error
smfrench Apr 22, 2018
23657ad
SMB3: Fix 3.11 encryption to Windows and handle encrypted smb3 tcon
Apr 22, 2018
22be37a
ext4: fix bitmap position validation
Apr 24, 2018
292c34c
perf pmu: Fix core PMU alias list for X86 platform
Apr 24, 2018
30060ea
perf stat: Print out hint for mixed PMU group error
Apr 24, 2018
121f325
perf evsel: Only fall back group read for leader
Apr 24, 2018
80ee8c5
perf stat: Fix duplicate PMU name for interval print
Apr 24, 2018
682e6b4
rtc: opal: Fix OPAL RTC driver OPAL_BUSY loops
npiggin Apr 10, 2018
d2479a3
x86/pti: Fix boot problems from Global-bit setting
hansendc Apr 20, 2018
58e65b5
x86/pti: Fix boot warning from Global-bit setting
hansendc Apr 20, 2018
a44ca8f
x86/pti: Reduce amount of kernel text allowed to be Global
hansendc Apr 20, 2018
b7c21bc
x86/pti: Disallow global kernel text with RANDSTRUCT
hansendc Apr 20, 2018
316d097
x86/pti: Filter at vma->vm_page_prot population
hansendc Apr 20, 2018
ac61c11
powerpc: Fix smp_send_stop NMI IPI handling
npiggin Apr 25, 2018
06e22bb
Merge tag 'kvmarm-fixes-for-4.17-1' of git://git.kernel.org/pub/scm/l…
rkrcmar Apr 25, 2018
0d5ec28
SMB311: Fix reconnect
Apr 23, 2018
bb4c041
cifs: smbd: Don't use RDMA read/write when signing is used
longlimsft Apr 17, 2018
8bcda1d
cifs: smbd: Avoid allocating iov on the stack
longlimsft Apr 17, 2018
4e949e9
perf/x86/intel: Don't enable freeze-on-smi for PerfMon V1
Apr 25, 2018
7ef79ad
ext4: add MODULE_SOFTDEP to ensure crc32c is included in the initramfs
tytso Apr 26, 2018
d4652f6
Merge tag 'perf-urgent-for-mingo-4.17-20180425' of git://git.kernel.o…
Apr 26, 2018
9124130
x86/cpufeatures: Enumerate cldemote instruction
fyu1 Apr 23, 2018
e307280
x86/vector: Remove the macro VECTOR_OFFSET_START
douliyang Apr 25, 2018
7d87881
x86/vector: Remove the unused macro FPU_IRQ
douliyang Apr 26, 2018
1f71add
tick/sched: Do not mess with an enqueued hrtimer
KAGA-KOKO Apr 24, 2018
a3ed0e4
Revert: Unify CLOCK_MONOTONIC and CLOCK_BOOTTIME
KAGA-KOKO Apr 25, 2018
14d12bb
x86/mm: Make vmemmap and vmalloc base address constants unsigned long
Apr 12, 2018
da6fa7e
x86/smpboot: Don't use mwait_play_dead() on AMD systems
yghannam Apr 3, 2018
0c92c7a
tracing: Fix bad use of igrab in trace_uprobe.c
liu-song-6 Apr 23, 2018
61f9420
tracing: Remove igrab() iput() call from uprobes.c
liu-song-6 Apr 23, 2018
0566e40
tracing: initcall: Ordered comparison of function pointers
Apr 25, 2018
b837913
x86/cpu/intel: Add missing TLB cpuid values
J-cztery Apr 23, 2018
608940d
tracing: Restore proper field flag printing when displaying triggers
tzanussi Apr 27, 2018
5ec432d
tracing: Add field parsing hist error for hist triggers
tzanussi Apr 27, 2018
dcf2345
tracing: Add field modifier parsing hist error for hist triggers
tzanussi Apr 27, 2018
c0f7f5b
cpufreq: powernv: Fix hardlockup due to synchronous smp_call in timer…
shilpasri Apr 25, 2018
6029755
powerpc: Fix deadlock with multiple calls to smp_send_stop
npiggin Apr 27, 2018
b2d7ecb
powerpc/kvm/booke: Fix altivec related build break
tudorl Apr 26, 2018
23a2772
i2c: dev: prevent ZERO_SIZE_PTR deref in i2cdev_ioctl_rdwr()
a13xp0p0v Apr 19, 2018
da33aa0
i2c: sprd: Prevent i2c accesses after suspend is called
wangbaolin719 Apr 9, 2018
2a01046
i2c: sprd: Fix the i2c count issue
wangbaolin719 Apr 9, 2018
b4678df
errseq: Always report a writeback error once
Apr 24, 2018
3db3eb2
x86/setup: Do not reserve a crash kernel region if booted on Xen PV
Apr 25, 2018
1a512c0
x86/ipc: Fix x32 version of shmid64_ds and msqid64_ds
arndb Apr 24, 2018
8bb2610
x86/entry/64/compat: Preserve r8-r11 in int $0x80
amluto Apr 17, 2018
a468f2d
kvm: apic: Flush TLB after APIC mode/address change if VPIDs are in use
Apr 26, 2018
5e62493
x86/headers/UAPI: Move DISABLE_EXITS KVM capability bits to the UAPI
Apr 17, 2018
46dc111
rMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
torvalds Apr 27, 2018
0d95cfa
Merge tag 'powerpc-4.17-4' of git://git.kernel.org/pub/scm/linux/kern…
torvalds Apr 28, 2018
cac2642
Merge tag '4.17-rc2-smb3' of git://git.samba.org/sfrench/cifs-2.6
torvalds Apr 28, 2018
6e041ff
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git…
torvalds Apr 28, 2018
a97d8ef
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/…
torvalds Apr 28, 2018
bf8f5de
MAINTAINERS: add myself as maintainer of AFFS
kdave Apr 28, 2018
19b9ad6
<linux/stringhash.h>: fix end_name_hash() for 64bit long
amir73il Feb 5, 2018
cdface5
Merge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/ke…
torvalds Apr 29, 2018
7d9e55f
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…
torvalds Apr 29, 2018
810fb07
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…
torvalds Apr 29, 2018
65f4d6d
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linu…
torvalds Apr 29, 2018
c61a56a
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/l…
torvalds Apr 29, 2018
6da6c0d
Linux v4.17-rc3
torvalds Apr 29, 2018
d66a270
tracepoint: Do not warn on ENOMEM
compudj Mar 15, 2018
d3c68d0
sparc64: Fix mistake in oradax license text
Apr 20, 2018
00ad691
sparc: vio: use put_device() instead of kfree()
ArvindYadavCs Apr 25, 2018
8188fc8
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
torvalds Apr 30, 2018
fff75eb
Merge tag 'errseq-v4.17' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds Apr 30, 2018
f212599
Merge tag 'xfs-4.17-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/x…
torvalds May 1, 2018
f372b81
Input: atmel_mxt_ts - add touchpad button mapping for Samsung Chromeb…
VittGam Apr 25, 2018
068bdb6
Input: atmel_mxt_ts - fix the firmware update
ndyer May 1, 2018
a57ab96
hexagon: add memset_io() helper
arndb Apr 6, 2018
330e261
hexagon: export csum_partial_copy_nocheck
arndb Apr 6, 2018
f6eeb9e
Input: atmel_mxt_ts - add missing compatible strings to OF device table
martinezjavier May 1, 2018
2d618bd
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds May 2, 2018
892a0be
swiotlb: fix inversed DMA_ATTR_NO_WARN test
May 1, 2018
3b6f979
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…
torvalds May 3, 2018
ecd649b
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds May 3, 2018
f4ef6a4
Merge tag 'trace-v4.17-rc1-2' of git://git.kernel.org/pub/scm/linux/k…
torvalds May 3, 2018
c15f6d8
Merge tag 'dma-mapping-4.17-4' of git://git.infradead.org/users/hch/d…
torvalds May 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Documentation/devicetree/bindings/input/atmel,maxtouch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Required properties:
- compatible:
atmel,maxtouch

The following compatibles have been used in various products but are
deprecated:
atmel,qt602240_ts
atmel,atmel_mxt_ts
atmel,atmel_mxt_tp
atmel,mXT224

- reg: The I2C address of the device

- interrupts: The sink for the touchpad's IRQ output
Expand Down
32 changes: 14 additions & 18 deletions Documentation/i2c/dev-interface
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ i2c adapters present on your system at a given time. i2cdetect is part of
the i2c-tools package.

I2C device files are character device files with major device number 89
and a minor device number corresponding to the number assigned as
explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ...,
and a minor device number corresponding to the number assigned as
explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ...,
i2c-10, ...). All 256 minor device numbers are reserved for i2c.


Expand All @@ -23,11 +23,6 @@ First, you need to include these two headers:
#include <linux/i2c-dev.h>
#include <i2c/smbus.h>

(Please note that there are two files named "i2c-dev.h" out there. One is
distributed with the Linux kernel and the other one is included in the
source tree of i2c-tools. They used to be different in content but since 2012
they're identical. You should use "linux/i2c-dev.h").

Now, you have to decide which adapter you want to access. You should
inspect /sys/class/i2c-dev/ or run "i2cdetect -l" to decide this.
Adapter numbers are assigned somewhat dynamically, so you can not
Expand All @@ -38,7 +33,7 @@ Next thing, open the device file, as follows:
int file;
int adapter_nr = 2; /* probably dynamically determined */
char filename[20];

snprintf(filename, 19, "/dev/i2c-%d", adapter_nr);
file = open(filename, O_RDWR);
if (file < 0) {
Expand Down Expand Up @@ -72,8 +67,10 @@ the device supports them. Both are illustrated below.
/* res contains the read word */
}

/* Using I2C Write, equivalent of
i2c_smbus_write_word_data(file, reg, 0x6543) */
/*
* Using I2C Write, equivalent of
* i2c_smbus_write_word_data(file, reg, 0x6543)
*/
buf[0] = reg;
buf[1] = 0x43;
buf[2] = 0x65;
Expand Down Expand Up @@ -140,14 +137,14 @@ ioctl(file, I2C_RDWR, struct i2c_rdwr_ioctl_data *msgset)
set in each message, overriding the values set with the above ioctl's.

ioctl(file, I2C_SMBUS, struct i2c_smbus_ioctl_data *args)
Not meant to be called directly; instead, use the access functions
below.
If possible, use the provided i2c_smbus_* methods described below instead
of issuing direct ioctls.

You can do plain i2c transactions by using read(2) and write(2) calls.
You do not need to pass the address byte; instead, set it through
ioctl I2C_SLAVE before you try to access the device.

You can do SMBus level transactions (see documentation file smbus-protocol
You can do SMBus level transactions (see documentation file smbus-protocol
for details) through the following functions:
__s32 i2c_smbus_write_quick(int file, __u8 value);
__s32 i2c_smbus_read_byte(int file);
Expand All @@ -158,18 +155,17 @@ for details) through the following functions:
__s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 value);
__s32 i2c_smbus_process_call(int file, __u8 command, __u16 value);
__s32 i2c_smbus_read_block_data(int file, __u8 command, __u8 *values);
__s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length,
__s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length,
__u8 *values);
All these transactions return -1 on failure; you can read errno to see
what happened. The 'write' transactions return 0 on success; the
'read' transactions return the read value, except for read_block, which
returns the number of values read. The block buffers need not be longer
than 32 bytes.

The above functions are all inline functions, that resolve to calls to
the i2c_smbus_access function, that on its turn calls a specific ioctl
with the data in a specific format. Read the source code if you
want to know what happens behind the screens.
The above functions are made available by linking against the libi2c library,
which is provided by the i2c-tools project. See:
https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/.


Implementation details
Expand Down
14 changes: 11 additions & 3 deletions Documentation/trace/ftrace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,17 @@ of ftrace. Here is a list of some of the key files:
and ticks at the same rate as the hardware clocksource.

boot:
Same as mono. Used to be a separate clock which accounted
for the time spent in suspend while CLOCK_MONOTONIC did
not.
This is the boot clock (CLOCK_BOOTTIME) and is based on the
fast monotonic clock, but also accounts for time spent in
suspend. Since the clock access is designed for use in
tracing in the suspend path, some side effects are possible
if clock is accessed after the suspend time is accounted before
the fast mono clock is updated. In this case, the clock update
appears to happen slightly sooner than it normally would have.
Also on 32-bit systems, it's possible that the 64-bit boot offset
sees a partial update. These effects are rare and post
processing should be able to handle them. See comments in the
ktime_get_boot_fast_ns() function for more information.

To set a clock, simply echo the clock name into this file::

Expand Down
9 changes: 8 additions & 1 deletion Documentation/virtual/kvm/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,9 @@ ARM 32-bit VFP control registers have the following id bit patterns:
ARM 64-bit FP registers have the following id bit patterns:
0x4030 0000 0012 0 <regno:12>

ARM firmware pseudo-registers have the following bit pattern:
0x4030 0000 0014 <regno:16>


arm64 registers are mapped using the lower 32 bits. The upper 16 of
that is the register group type, or coprocessor number:
Expand All @@ -1976,6 +1979,9 @@ arm64 CCSIDR registers are demultiplexed by CSSELR value:
arm64 system registers have the following id bit patterns:
0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3>

arm64 firmware pseudo-registers have the following bit pattern:
0x6030 0000 0014 <regno:16>


MIPS registers are mapped using the lower 32 bits. The upper 16 of that is
the register group type:
Expand Down Expand Up @@ -2510,7 +2516,8 @@ Possible features:
and execute guest code when KVM_RUN is called.
- KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode.
Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only).
- KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 for the CPU.
- KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 (or a future revision
backward compatible with v0.2) for the CPU.
Depends on KVM_CAP_ARM_PSCI_0_2.
- KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU.
Depends on KVM_CAP_ARM_PMU_V3.
Expand Down
30 changes: 30 additions & 0 deletions Documentation/virtual/kvm/arm/psci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
KVM implements the PSCI (Power State Coordination Interface)
specification in order to provide services such as CPU on/off, reset
and power-off to the guest.

The PSCI specification is regularly updated to provide new features,
and KVM implements these updates if they make sense from a virtualization
point of view.

This means that a guest booted on two different versions of KVM can
observe two different "firmware" revisions. This could cause issues if
a given guest is tied to a particular PSCI revision (unlikely), or if
a migration causes a different PSCI version to be exposed out of the
blue to an unsuspecting guest.

In order to remedy this situation, KVM exposes a set of "firmware
pseudo-registers" that can be manipulated using the GET/SET_ONE_REG
interface. These registers can be saved/restored by userspace, and set
to a convenient value if required.

The following register is defined:

* KVM_REG_ARM_PSCI_VERSION:

- Only valid if the vcpu has the KVM_ARM_VCPU_PSCI_0_2 feature set
(and thus has already been initialized)
- Returns the current PSCI version on GET_ONE_REG (defaulting to the
highest PSCI version implemented by KVM and compatible with v0.2)
- Allows any PSCI version implemented by KVM and compatible with
v0.2 to be set with SET_ONE_REG
- Affects the whole VM (even if the register view is per-vcpu)
8 changes: 4 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,9 @@ S: Maintained
F: drivers/media/dvb-frontends/af9033*

AFFS FILE SYSTEM
M: David Sterba <dsterba@suse.com>
L: linux-fsdevel@vger.kernel.org
S: Orphan
S: Odd Fixes
F: Documentation/filesystems/affs.txt
F: fs/affs/

Expand Down Expand Up @@ -7744,7 +7745,7 @@ F: arch/x86/include/asm/svm.h
F: arch/x86/kvm/svm.c

KERNEL VIRTUAL MACHINE FOR ARM (KVM/arm)
M: Christoffer Dall <christoffer.dall@linaro.org>
M: Christoffer Dall <christoffer.dall@arm.com>
M: Marc Zyngier <marc.zyngier@arm.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
L: kvmarm@lists.cs.columbia.edu
Expand All @@ -7758,7 +7759,7 @@ F: virt/kvm/arm/
F: include/kvm/arm_*

KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
M: Christoffer Dall <christoffer.dall@linaro.org>
M: Christoffer Dall <christoffer.dall@arm.com>
M: Marc Zyngier <marc.zyngier@arm.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
L: kvmarm@lists.cs.columbia.edu
Expand Down Expand Up @@ -13852,7 +13853,6 @@ S: Supported
F: drivers/iommu/tegra*

TEGRA KBC DRIVER
M: Rakesh Iyer <riyer@nvidia.com>
M: Laxman Dewangan <ldewangan@nvidia.com>
S: Supported
F: drivers/input/keyboard/tegra-kbc.c
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
VERSION = 4
PATCHLEVEL = 17
SUBLEVEL = 0
EXTRAVERSION = -rc2
EXTRAVERSION = -rc3
NAME = Fearless Coyote

# *DOCUMENTATION*
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ struct kvm_arch {
/* Interrupt controller */
struct vgic_dist vgic;
int max_vcpus;

/* Mandated version of PSCI */
u32 psci_version;
};

#define KVM_NR_MEM_OBJS 40
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/include/uapi/asm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ struct kvm_arch_memory_slot {
#define KVM_REG_ARM_VFP_FPINST 0x1009
#define KVM_REG_ARM_VFP_FPINST2 0x100A

/* KVM-as-firmware specific pseudo-registers */
#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM | KVM_REG_SIZE_U64 | \
KVM_REG_ARM_FW | ((r) & 0xffff))
#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)

/* Device Control API: ARM VGIC */
#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
Expand Down
13 changes: 13 additions & 0 deletions arch/arm/kvm/guest.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/fs.h>
#include <kvm/arm_psci.h>
#include <asm/cputype.h>
#include <linux/uaccess.h>
#include <asm/kvm.h>
Expand Down Expand Up @@ -176,6 +177,7 @@ static unsigned long num_core_regs(void)
unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu)
{
return num_core_regs() + kvm_arm_num_coproc_regs(vcpu)
+ kvm_arm_get_fw_num_regs(vcpu)
+ NUM_TIMER_REGS;
}

Expand All @@ -196,6 +198,11 @@ int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices)
uindices++;
}

ret = kvm_arm_copy_fw_reg_indices(vcpu, uindices);
if (ret)
return ret;
uindices += kvm_arm_get_fw_num_regs(vcpu);

ret = copy_timer_indices(vcpu, uindices);
if (ret)
return ret;
Expand All @@ -214,6 +221,9 @@ int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
return get_core_reg(vcpu, reg);

if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
return kvm_arm_get_fw_reg(vcpu, reg);

if (is_timer_reg(reg->id))
return get_timer_reg(vcpu, reg);

Expand All @@ -230,6 +240,9 @@ int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
return set_core_reg(vcpu, reg);

if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
return kvm_arm_set_fw_reg(vcpu, reg);

if (is_timer_reg(reg->id))
return set_timer_reg(vcpu, reg);

Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ struct kvm_arch {

/* Interrupt controller */
struct vgic_dist vgic;

/* Mandated version of PSCI */
u32 psci_version;
};

#define KVM_NR_MEM_OBJS 40
Expand Down
6 changes: 6 additions & 0 deletions arch/arm64/include/uapi/asm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ struct kvm_arch_memory_slot {
#define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)
#define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2)

/* KVM-as-firmware specific pseudo-registers */
#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
KVM_REG_ARM_FW | ((r) & 0xffff))
#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)

/* Device Control API: ARM VGIC */
#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
Expand Down
14 changes: 13 additions & 1 deletion arch/arm64/kvm/guest.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/fs.h>
#include <kvm/arm_psci.h>
#include <asm/cputype.h>
#include <linux/uaccess.h>
#include <asm/kvm.h>
Expand Down Expand Up @@ -205,7 +206,7 @@ static int get_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu)
{
return num_core_regs() + kvm_arm_num_sys_reg_descs(vcpu)
+ NUM_TIMER_REGS;
+ kvm_arm_get_fw_num_regs(vcpu) + NUM_TIMER_REGS;
}

/**
Expand All @@ -225,6 +226,11 @@ int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices)
uindices++;
}

ret = kvm_arm_copy_fw_reg_indices(vcpu, uindices);
if (ret)
return ret;
uindices += kvm_arm_get_fw_num_regs(vcpu);

ret = copy_timer_indices(vcpu, uindices);
if (ret)
return ret;
Expand All @@ -243,6 +249,9 @@ int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
return get_core_reg(vcpu, reg);

if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
return kvm_arm_get_fw_reg(vcpu, reg);

if (is_timer_reg(reg->id))
return get_timer_reg(vcpu, reg);

Expand All @@ -259,6 +268,9 @@ int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
return set_core_reg(vcpu, reg);

if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
return kvm_arm_set_fw_reg(vcpu, reg);

if (is_timer_reg(reg->id))
return set_timer_reg(vcpu, reg);

Expand Down
6 changes: 2 additions & 4 deletions arch/arm64/kvm/sys_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,14 +996,12 @@ static u64 read_id_reg(struct sys_reg_desc const *r, bool raz)

if (id == SYS_ID_AA64PFR0_EL1) {
if (val & (0xfUL << ID_AA64PFR0_SVE_SHIFT))
pr_err_once("kvm [%i]: SVE unsupported for guests, suppressing\n",
task_pid_nr(current));
kvm_debug("SVE unsupported for guests, suppressing\n");

val &= ~(0xfUL << ID_AA64PFR0_SVE_SHIFT);
} else if (id == SYS_ID_AA64MMFR1_EL1) {
if (val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))
pr_err_once("kvm [%i]: LORegions unsupported for guests, suppressing\n",
task_pid_nr(current));
kvm_debug("LORegions unsupported for guests, suppressing\n");

val &= ~(0xfUL << ID_AA64MMFR1_LOR_SHIFT);
}
Expand Down
Loading