Commit Graph

1059046 Commits

Author SHA1 Message Date
Marc Zyngier
c44b76e9b0 UPSTREAM: KVM: arm64: Restructure the point where has_run_once is advertised
Restructure kvm_vcpu_first_run_init() to set the has_run_once
flag after having completed all the "run once" activities.

This includes moving the flip of the userspace irqchip static key
to a point where nothing can fail.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 1408e73d21)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I034562031b0ad89815d2623da1fff8930b964694
2022-08-08 14:54:43 +01:00
Marc Zyngier
9c7b943604 UPSTREAM: KVM: arm64: Move kvm_arch_vcpu_run_pid_change() out of line
Having kvm_arch_vcpu_run_pid_change() inline doesn't bring anything
to the table. Move it next to kvm_vcpu_first_run_init(), which will
be convenient for what is next to come.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 052f064d42)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I78e24d8bbfa44a4ebd96f6e1f1441079a627476a
2022-08-08 14:52:26 +01:00
Marc Zyngier
204147ce6f BACKPORT: KVM: arm64: Move SVE state mapping at HYP to finalize-time
We currently map the SVE state to HYP on detection of a PID change.
Although this matches what we do for FPSIMD, this is pretty pointless
for SVE, as the buffer is per-vcpu and has nothing to do with the
thread that is being run.

Move the mapping of the SVE state to finalize-time, which is where
we allocate the state memory, and thus the most logical place to
do this.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit bff01a61af)
[willdeacon@: Fixed context conflict due to removal of EL2 thread_info mapping]
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I672f411b50a827a45d30ac5fb154c7f1a5102d7d
2022-08-08 14:51:18 +01:00
Marc Zyngier
d3af34fbf4 UPSTREAM: arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM
The bit of documentation that talks about TIF_FOREIGN_FPSTATE
does not mention the ungodly tricks that KVM plays with this flag.

Try and document this for the posterity.

Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 31aa126de8)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: Iec0b06e35ad286d6bcea15745f2a1b160ff967cc
2022-08-08 14:48:30 +01:00
Marc Zyngier
68f75f2392 BACKPORT: KVM: arm64: Stop mapping current thread_info at EL2
Now that we can track an equivalent of TIF_FOREIGN_FPSTATE, drop
the mapping of current's thread_info at EL2.

Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit bee14bca73)
[willdeacon@: Don't drop inclusion of asm/thread_info.h from vhe/switch.c]
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I8d113a0f7551302a03446f9cfac1248b0a975184
2022-08-08 14:44:33 +01:00
Marc Zyngier
53245b87fd UPSTREAM: KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE
We currently have to maintain a mapping the thread_info structure
at EL2 in order to be able to check the TIF_FOREIGN_FPSTATE flag.

In order to eventually get rid of this, start with a vcpu flag that
shadows the thread flag on each entry into the hypervisor.

Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit af9a0e21d8)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I3a59991de7eca3a08fc3de9ddb11213d889165b5
2022-08-08 14:40:38 +01:00
Marc Zyngier
f3d0040ef2 BACKPORT: KVM: arm64: Remove unused __sve_save_state
Now that we don't have any users left for __sve_save_state, remove
it altogether. Should we ever need to save the SVE state from the
hypervisor again, we can always re-introduce it.

Suggested-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit e66425fc9b)
[willdeacon@: Resolved conflict due to different __sve_save_state code]
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: Ie6a95dfad3e510361730713fa92a61fcf9f22a7e
2022-08-08 14:39:39 +01:00
Marc Zyngier
5c83a1028b UPSTREAM: KVM: arm64: Get rid of host SVE tracking/saving
The SVE host tracking in KVM is pretty involved. It relies on a
set of flags tracking the ownership of the SVE register, as well
as that of the EL0 access.

It is also pretty scary: __hyp_sve_save_host() computes
a thread_struct pointer and obtains a sve_state which gets directly
accessed without further ado, even on nVHE. How can this even work?

The answer to that is that it doesn't, and that this is mostly dead
code. Closer examination shows that on executing a syscall, userspace
loses its SVE state entirely. This is part of the ABI. Another
thing to notice is that although the kernel provides helpers such as
kernel_neon_begin()/end(), they only deal with the FP/NEON state,
and not SVE.

Given that you can only execute a guest as the result of a syscall,
and that the kernel cannot use SVE by itself, it becomes pretty
obvious that there is never any host SVE state to save, and that
this code is only there to increase confusion.

Get rid of the TIF_SVE tracking and host save infrastructure altogether.

Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 8383741ab2)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I8f26c83393bac40056ce849a1082b7516130cb0a
2022-08-08 14:36:53 +01:00
Marc Zyngier
da8f32de1b UPSTREAM: KVM: arm64: Reorder vcpu flag definitions
The vcpu arch flags are in an interesting, semi random order.
As I have made the mistake of reusing a flag once, let's rework
this in an order that I find a bit less confusing.

Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 892fd259cb)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I79f0f8de29bb111d95a923a744055d69e0dbad60
2022-08-08 14:35:52 +01:00
Jiyong Park
082fc3b2b7 ANDROID: remove microdroid configs
They are moved to common-modules/virtual-device which is a better place
for project-specific configs.

Bug: 233192153
Test: N/A
Signed-off-by: Jiyong Park <jiyong@google.com>
Change-Id: Ia1bb78861977d7dd39479fe7bb0ed9e568064fb0
2022-08-08 03:45:51 +00:00
Carlos Llamas
9a48f07d6d UPSTREAM: binder: fix redefinition of seq_file attributes
The patchset in [1] exported some definitions to binder_internal.h in
order to make the debugfs entries such as 'stats' and 'transaction_log'
available in a binderfs instance. However, the DEFINE_SHOW_ATTRIBUTE
macro expands into a static function/variable pair, which in turn get
redefined each time a source file includes this internal header.

This problem was made evident after a report from the kernel test robot
<lkp@intel.com> where several W=1 build warnings are seen in downstream
kernels. See the following example:

  include/../drivers/android/binder_internal.h:111:23: warning: 'binder_stats_fops' defined but not used [-Wunused-const-variable=]
     111 | DEFINE_SHOW_ATTRIBUTE(binder_stats);
         |                       ^~~~~~~~~~~~
  include/linux/seq_file.h:174:37: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
     174 | static const struct file_operations __name ## _fops = {                 \
         |                                     ^~~~~~

This patch fixes the above issues by moving back the definitions into
binder.c and instead creates an array of the debugfs entries which is
more convenient to share with binderfs and iterate through.

  [1] https://lore.kernel.org/all/20190903161655.107408-1-hridya@google.com/

Fixes: 0e13e452da ("binder: Add stats, state and transactions files")
Fixes: 03e2e07e38 ("binder: Make transaction_log available in binderfs")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20220701182041.2134313-1-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 240404657
(cherry picked from commit b7e241bbff)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I7e9ca1ab1f3a5a4a272e50f24d404c17cad55d32
2022-08-05 20:33:25 +00:00
Greg Kroah-Hartman
046ce7a74e Merge 5.15.59 into android14-5.15
Changes in 5.15.59
	Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put
	Revert "ocfs2: mount shared volume without ha stack"
	ntfs: fix use-after-free in ntfs_ucsncmp()
	fs: sendfile handles O_NONBLOCK of out_fd
	secretmem: fix unhandled fault in truncate
	mm: fix page leak with multiple threads mapping the same page
	hugetlb: fix memoryleak in hugetlb_mcopy_atomic_pte
	asm-generic: remove a broken and needless ifdef conditional
	s390/archrandom: prevent CPACF trng invocations in interrupt context
	nouveau/svm: Fix to migrate all requested pages
	drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid()
	watch_queue: Fix missing rcu annotation
	watch_queue: Fix missing locking in add_watch_to_object()
	tcp: Fix data-races around sysctl_tcp_dsack.
	tcp: Fix a data-race around sysctl_tcp_app_win.
	tcp: Fix a data-race around sysctl_tcp_adv_win_scale.
	tcp: Fix a data-race around sysctl_tcp_frto.
	tcp: Fix a data-race around sysctl_tcp_nometrics_save.
	tcp: Fix data-races around sysctl_tcp_no_ssthresh_metrics_save.
	ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)
	ice: do not setup vlan for loopback VSI
	scsi: ufs: host: Hold reference returned by of_parse_phandle()
	Revert "tcp: change pingpong threshold to 3"
	octeontx2-pf: Fix UDP/TCP src and dst port tc filters
	tcp: Fix data-races around sysctl_tcp_moderate_rcvbuf.
	tcp: Fix a data-race around sysctl_tcp_limit_output_bytes.
	tcp: Fix a data-race around sysctl_tcp_challenge_ack_limit.
	scsi: core: Fix warning in scsi_alloc_sgtables()
	scsi: mpt3sas: Stop fw fault watchdog work item during system shutdown
	net: ping6: Fix memleak in ipv6_renew_options().
	ipv6/addrconf: fix a null-ptr-deref bug for ip6_ptr
	net/tls: Remove the context from the list in tls_device_down
	igmp: Fix data-races around sysctl_igmp_qrv.
	net: pcs: xpcs: propagate xpcs_read error to xpcs_get_state_c37_sgmii
	net: sungem_phy: Add of_node_put() for reference returned by of_get_parent()
	tcp: Fix a data-race around sysctl_tcp_min_tso_segs.
	tcp: Fix a data-race around sysctl_tcp_min_rtt_wlen.
	tcp: Fix a data-race around sysctl_tcp_autocorking.
	tcp: Fix a data-race around sysctl_tcp_invalid_ratelimit.
	Documentation: fix sctp_wmem in ip-sysctl.rst
	macsec: fix NULL deref in macsec_add_rxsa
	macsec: fix error message in macsec_add_rxsa and _txsa
	macsec: limit replay window size with XPN
	macsec: always read MACSEC_SA_ATTR_PN as a u64
	net: macsec: fix potential resource leak in macsec_add_rxsa() and macsec_add_txsa()
	net: mld: fix reference count leak in mld_{query | report}_work()
	tcp: Fix data-races around sk_pacing_rate.
	net: Fix data-races around sysctl_[rw]mem(_offset)?.
	tcp: Fix a data-race around sysctl_tcp_comp_sack_delay_ns.
	tcp: Fix a data-race around sysctl_tcp_comp_sack_slack_ns.
	tcp: Fix a data-race around sysctl_tcp_comp_sack_nr.
	tcp: Fix data-races around sysctl_tcp_reflect_tos.
	ipv4: Fix data-races around sysctl_fib_notify_on_flag_change.
	i40e: Fix interface init with MSI interrupts (no MSI-X)
	sctp: fix sleep in atomic context bug in timer handlers
	octeontx2-pf: cn10k: Fix egress ratelimit configuration
	netfilter: nf_queue: do not allow packet truncation below transport header offset
	virtio-net: fix the race between refill work and close
	perf symbol: Correct address for bss symbols
	sfc: disable softirqs for ptp TX
	sctp: leave the err path free in sctp_stream_init to sctp_stream_free
	ARM: crypto: comment out gcc warning that breaks clang builds
	mm/hmm: fault non-owner device private entries
	page_alloc: fix invalid watermark check on a negative value
	ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow
	EDAC/ghes: Set the DIMM label unconditionally
	docs/kernel-parameters: Update descriptions for "mitigations=" param with retbleed
	locking/rwsem: Allow slowpath writer to ignore handoff bit if not set by first waiter
	x86/bugs: Do not enable IBPB at firmware entry when IBPB is not available
	Linux 5.15.59

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4f2002d38aea467e150a912f50d456c41b23de89
2022-08-04 15:18:41 +02:00
Will Deacon
b8ba6dcba1 ANDROID: Remove stale symbols from symbol lists
The following symbols no longer exist after reverting the out-of-tree
pKVM patches inherited from android13-5.15:

 - pkvm_iommu_finalize
 - pkvm_iommu_resume
 - pkvm_iommu_s2mpu_register
 - pkvm_iommu_suspend
 - pkvm_iommu_sysmmu_sync_register

Additionally, mem_encrypt_active does not make sense outside of a pKVM
guest (as it will always return 0).

Remove references to these symbols from the symbol lists so that we can
get presubmit working again before re-introducing the symbols in a newer
version of the pKVM series.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I1413e12e5e0f078fc7c7dfdbcac74c0078dadafd
2022-08-04 13:03:53 +00:00
Marc Zyngier
6e970380e0 ANDROID: arm64: Register earlycon fixmap with the MMIO guard
On initialising the MMIO guard infrastructure, register the
earlycon mapping if present.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Bug: 233587962
Change-Id: I379387253d08e2414fa386a3360a45391da7d90d
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-08-04 13:03:53 +00:00
Marc Zyngier
94fb783d60 ANDROID: arm64: Add a helper to retrieve the PTE of a fixmap
In order to transfer the early mapping state into KVM's MMIO
guard infrastructure, provide a small helper that will retrieve
the associated PTE.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Bug: 233587962
Change-Id: Iefc1c57d5e9476b718a8a68f60e562a57b09fb6a
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-08-04 13:03:53 +00:00
Marc Zyngier
82e2a5389c ANDROID: BACKPORT: arm64: Enroll into KVM's MMIO guard if required
Should a guest desire to enroll into the MMIO guard, allow it to
do so with a command-line option.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Bug: 233587962
Change-Id: Ia9a77f693531740500739693c52b4959abacafd4
[willdeacon@: Add hypercall IDs]
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-08-04 13:03:53 +00:00
Marc Zyngier
b3abe649ca ANDROID: BACKPORT: arm64: Implement ioremap/iounmap hooks calling into KVM's MMIO guard
Implement the previously defined ioremap/iounmap hooks for arm64,
calling into KVM's MMIO guard if available.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Bug: 233587962
Change-Id: I86a78f8941fb60078fb873a34c5eb32830a00259
[willdeacon@: Add hypercall IDs and slab_is_available() check]
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-08-04 13:03:53 +00:00
Marc Zyngier
d7ddd989d6 ANDROID: mm/vmalloc: Add arch-specific callbacks to track io{remap,unmap} physical pages
Add a pair of hooks (ioremap_phys_range_hook/iounmap_phys_range_hook)
that can be implemented by an architecture. Contrary to the existing
arch_sync_kernel_mappings(), this one tracks things at the physical
address level.

This is specially useful in these virtualised environments where
the guest has to tell the host whether (and how) it intends to use
a MMIO device.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Bug: 233587962
Change-Id: I970c2e632cb2b01060d5e66e4194fa9248188f43
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-08-04 13:03:53 +00:00
Will Deacon
9f78e5888d ANDROID: BACKPORT: arm64: mm: Implement memory encryption API using KVM sharing hypercalls
When running as a protected guest, the KVM host does not have access to
any pages mapped into the guest. Consequently, KVM exposes hypercalls to
the guest so that pages can be shared back with the host for the purposes
of shared memory communication such as virtio.

Detect the presence of these hypercalls when running as a guest and use
them to implement the memory encryption interfaces gated by
CONFIG_ARCH_HAS_MEM_ENCRYPT which are called from the DMA layer to share
SWIOTLB bounce buffers for virtio.

Although no encryption is actually performed, "sharing" a page is akin
to decryption, whereas "unsharing" a page maps to encryption, albeit
without destruction of the underlying page contents.

Signed-off-by: Will Deacon <will@kernel.org>
[willdeacon@: Use asm/mem_encrypt.h instead of asm/set_memory.h;
 Implement mem_encrypt_active(); Add hypercall IDs;
 Drop unneeded GIC change]
Bug: 233587962
Change-Id: I5955ff0dca65561183f9a60e94be87f28fbf14ec
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-08-04 13:03:53 +00:00
Marc Zyngier
320c97c077 FROMLIST: firmware/smccc: Call arch-specific hook on discovering KVM services
arm64 will soon require its own callback to initialise services
that are only availably on this architecture. Introduce a hook
that can be overloaded by the architecture.

Link: https://lore.kernel.org/r/20211004174849.2831548-12-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Bug: 233587962
Change-Id: I743e1786df1477b3c9fab0fe2e5ea52a7dcdf01f
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-08-04 13:03:53 +00:00
Will Deacon
f752f78575 UPSTREAM: virtio_ring: Fix querying of maximum DMA mapping size for virtio device
virtio_max_dma_size() returns the maximum DMA mapping size of the virtio
device by querying dma_max_mapping_size() for the device when the DMA
API is in use for the vring. Unfortunately, the device passed is
initialised by register_virtio_device() and does not inherit the DMA
configuration from its parent, resulting in SWIOTLB errors when bouncing
is enabled and the default 256K mapping limit (IO_TLB_SEGSIZE) is not
respected:

  | virtio-pci 0000:00:01.0: swiotlb buffer is full (sz: 294912 bytes), total 1024 (slots), used 725 (slots)

Follow the pattern used elsewhere in the virtio_ring code when calling
into the DMA layer and pass the parent device to dma_max_mapping_size()
instead.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211201112018.25276-1-will@kernel.org
Acked-by: Jason Wang <jasowang@redhat.com>
Tested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Fixes: e6d6dd6c87 ("virtio: Introduce virtio_max_dma_size()")
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 817fc978b5)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 233587962
Change-Id: I239a73519eb99981844b8824fde35cad5f435e2c
2022-08-04 13:03:53 +00:00
David Brazdil
7a9e035467 UPSTREAM: dt-bindings: reserved-memory: Open Profile for DICE
Add DeviceTree bindings for Open Profile for DICE, an open protocol for
measured boot. Firmware uses DICE to measure the hardware/software
combination and generates Compound Device Identifier (CDI) certificates.
These are stored in memory and the buffer is described in the DT as
a reserved memory region compatible with 'google,open-dice'.

'no-map' is required to ensure the memory region is never treated by
the kernel as system memory.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Brazdil <dbrazdil@google.com>
Link: https://lore.kernel.org/r/20220126231237.529308-2-dbrazdil@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c194a38675)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 198197082
Bug: 233587962
Change-Id: I0499d1498d97f3f88bfc2c8aefe0e49cfa441a5a
2022-08-04 13:03:53 +00:00
David Brazdil
eb262a9628 BACKPORT: misc: open-dice: Add driver to expose DICE data to userspace
Open Profile for DICE is an open protocol for measured boot compatible
with the Trusted Computing Group's Device Identifier Composition
Engine (DICE) specification. The generated Compound Device Identifier
(CDI) certificates represent the hardware/software combination measured
by DICE, and can be used for remote attestation and sealing.

Add a driver that exposes reserved memory regions populated by firmware
with DICE CDIs and exposes them to userspace via a character device.

Userspace obtains the memory region's size from read() and calls mmap()
to create a mapping of the memory region in its address space. The
mapping is not allowed to be write+shared, giving userspace a guarantee
that the data were not overwritten by another process.

Userspace can also call write(), which triggers a wipe of the DICE data
by the driver. Because both the kernel and userspace mappings use
write-combine semantics, all clients observe the memory as zeroed after
the syscall has returned.

Cc: Andrew Scull <ascull@google.com>
Cc: Will Deacon <will@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Brazdil <dbrazdil@google.com>
Link: https://lore.kernel.org/r/20220126231237.529308-3-dbrazdil@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f396ededbd)
[willdeacon@: Fix trivial context conflict in drivers/misc/Makefile]
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 198197082
Bug: 233587962
Change-Id: I3b4809aab98bd0ff96d1a27ab645708d8803999b
2022-08-04 13:03:53 +00:00
Will Deacon
efe3d34d62 Revert "FROMGIT: KVM: arm64: Reorder vcpu flag definitions"
This reverts commit 63f327d8f6.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I3cf655950207bb4f6b71740356b28521633a63a8
2022-08-04 13:03:53 +00:00
Will Deacon
bf9c72b54c Revert "FROMGIT: KVM: arm64: Get rid of host SVE tracking/saving"
This reverts commit 1b9dd8ee91.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I565e93d24b162c45d13c2d789cfa6ba2189b989f
2022-08-04 13:03:53 +00:00
Will Deacon
7944260d4d Revert "BACKPORT: FROMGIT: KVM: arm64: Remove unused __sve_save_state"
This reverts commit 0b3870c036.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Iff67fbdfc355fb58bbb955f45dbeb89a3417a717
2022-08-04 13:03:53 +00:00
Will Deacon
3604ba34a5 Revert "FROMGIT: KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE"
This reverts commit 71d0d497f2.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I0e86bc4960b61e2bd80311f0acdaf8221a5f7059
2022-08-04 13:03:53 +00:00
Will Deacon
34bc0dc4bc Revert "FROMGIT: KVM: arm64: Stop mapping current thread_info at EL2"
This reverts commit da67268e10.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I60410105a426bfe53ee739e0dabd346db2f2e18d
2022-08-04 13:03:53 +00:00
Will Deacon
c9d22fd9ef Revert "FROMGIT: arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM"
This reverts commit 2e202f3849.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Iab9a6f03411550b9cb35074f721262c31ea6b70e
2022-08-04 13:03:53 +00:00
Will Deacon
cd0a5c094f Revert "BACKPORT: FROMGIT: KVM: arm64: Move SVE state mapping at HYP to finalize-time"
This reverts commit 2e8036db25.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ife6db5d19ba51bcd07345962e3b3a7b8a789eb05
2022-08-04 13:03:53 +00:00
Will Deacon
2acfd68253 Revert "FROMGIT: KVM: arm64: Move kvm_arch_vcpu_run_pid_change() out of line"
This reverts commit b0f186eadf.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I32d30c6d168f15a7c569b35ee00593a2cab534bc
2022-08-04 13:03:53 +00:00
Will Deacon
b4b11955a2 Revert "FROMGIT: KVM: arm64: Restructure the point where has_run_once is advertised"
This reverts commit f60ecc8f75.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ife37ffa0d41041ed3e5736d68ec91dcbec3f3bc8
2022-08-04 13:03:53 +00:00
Will Deacon
85273db668 Revert "FROMGIT: KVM: arm64: Merge kvm_arch_vcpu_run_pid_change() and kvm_vcpu_first_run_init()"
This reverts commit d4a75950cb.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Icef82bccb6f723f8327078b906160619edf8346f
2022-08-04 13:03:53 +00:00
Will Deacon
74a0146b57 Revert "FROMGIT: KVM: arm64: Drop vcpu->arch.has_run_once for vcpu->pid"
This reverts commit b97f3540d5.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I72dec18803e3fc1ccf7fea9819fda353367cc510
2022-08-04 13:03:53 +00:00
Will Deacon
db179c8cff Revert "FROMGIT: KVM: arm64: Add minimal handling for the ARMv8.7 PMU"
This reverts commit a8ec5752e7.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I49b8b11423c2dcad60999e54f64154fe885cb9b5
2022-08-04 13:03:53 +00:00
Will Deacon
af44bbb4f2 Revert "FROMGIT: KVM: arm64: Constify kvm_io_gic_ops"
This reverts commit 8aefe3af04.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: If8629e1aef52d058b2e9047bcd37fb550e3beeae
2022-08-04 13:03:53 +00:00
Will Deacon
6765ec5681 Revert "FROMGIT: arm64: Add missing include of asm/cpufeature.h to asm/mmu.h"
This reverts commit 06266d8715.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I91a9d66ea860dd646463629ee887fedd16c06f5a
2022-08-04 13:03:53 +00:00
Will Deacon
6544eca600 Revert "FROMGIT: KVM: arm64: Generate hyp_constants.h for the host"
This reverts commit f892fc0633.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ica5df401df4af3c7dc07893a44e1876427907679
2022-08-04 13:03:53 +00:00
Will Deacon
a93d68f3ea Revert "FROMGIT: KVM: arm64: Move host EL1 code out of hyp/ directory"
This reverts commit 8549f68c4f.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Iaa456873182c7407d8f6b7d04c2332cbe98ed729
2022-08-04 13:03:53 +00:00
Will Deacon
f884005542 Revert "FROMGIT: KVM: Drop stale kvm_is_transparent_hugepage() declaration"
This reverts commit 03761cf7c7.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I8d3741c7173b36b4e8f0d651a3f6600b0bbd9b72
2022-08-04 13:03:53 +00:00
Will Deacon
21c4038d1c Revert "FROMLIST: virtio_ring: Fix querying of maximum DMA mapping size for virtio device"
This reverts commit 25b14230af.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I8bb15175f5e1befe690c6aa3a7f7b6d86faca7da
2022-08-04 13:03:53 +00:00
Will Deacon
dc9a1fcadb Revert "FROMLIST: KVM: arm64: Check if running in VHE from kvm_host_owns_hyp_mappings()"
This reverts commit 0ebed5c7ab.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I1f8355defaded5113c673aa8e0e83b9664d4ef18
2022-08-04 13:03:53 +00:00
Will Deacon
fae455e8a8 Revert "FROMLIST: KVM: arm64: Provide {get,put}_page() stubs for early hyp allocator"
This reverts commit 2183d4b524.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I11207dfcc8afea050205a7fa79b13cf7680d9768
2022-08-04 13:03:53 +00:00
Will Deacon
ebd697a965 Revert "FROMLIST: KVM: arm64: Refcount hyp stage-1 pgtable pages"
This reverts commit b91c0e5d96.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I8a683993c2cccaf32a0fdf312bfd6079a4cb535c
2022-08-04 13:03:53 +00:00
Will Deacon
b0614d9fa4 Revert "FROMLIST: KVM: arm64: Fixup hyp stage-1 refcount"
This reverts commit 59b96bd25e.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I55daea425178855d65ba346aa5422715ee83a09f
2022-08-04 13:03:53 +00:00
Will Deacon
f219189854 Revert "FROMLIST: KVM: arm64: Hook up ->page_count() for hypervisor stage-1 page-table"
This reverts commit 75ed01242c.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Id98fce82b931e2a92b782028ef26d597dc6bc007
2022-08-04 13:03:53 +00:00
Will Deacon
925c5e94e2 Revert "FROMLIST: KVM: arm64: Implement kvm_pgtable_hyp_unmap() at EL2"
This reverts commit d6d544e4af.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ia0ffbc2b4d65e6c56c29833babf53984c5644de4
2022-08-04 13:03:53 +00:00
Will Deacon
7b5b488c94 Revert "FROMLIST: KVM: arm64: Introduce kvm_share_hyp()"
This reverts commit 7c979b8271.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ib9b1023db3ce15b605f5567c5d9b4ebd55268d26
2022-08-04 13:03:53 +00:00
Will Deacon
38840baf92 Revert "FROMLIST: KVM: arm64: pkvm: Refcount the pages shared with EL2"
This reverts commit e41cc0f83a.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ib8d89f9a92ad85cc412114601af9b4d2c2f8bb95
2022-08-04 13:03:53 +00:00
Will Deacon
e803cccee4 Revert "FROMLIST: KVM: arm64: Extend pkvm_page_state enumeration to handle absent pages"
This reverts commit 1d5d8f2493.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I5fa9fc8a91c34020e521a55f445d9c5a1258151e
2022-08-04 13:03:53 +00:00