Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • baylibre/ti/ti-linux-kernel
1 result
Show changes
Commits on Source (114)
Showing
with 4079 additions and 3148 deletions
......@@ -6489,3 +6489,72 @@ When enabled, KVM will disable paravirtual features provided to the
guest according to the bits in the KVM_CPUID_FEATURES CPUID leaf
(0x40000001). Otherwise, a guest may use the paravirtual features
regardless of what has actually been exposed through the CPUID leaf.
8.31 KVM_CAP_PTP_KVM
--------------------
:Architectures: arm64
This capability indicates that the KVM virtual PTP service is
supported in the host. A VMM can check whether the service is
available to the guest on migration.
9. Known KVM API problems
=========================
In some cases, KVM's API has some inconsistencies or common pitfalls
that userspace need to be aware of. This section details some of
these issues.
Most of them are architecture specific, so the section is split by
architecture.
9.1. x86
--------
``KVM_GET_SUPPORTED_CPUID`` issues
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In general, ``KVM_GET_SUPPORTED_CPUID`` is designed so that it is possible
to take its result and pass it directly to ``KVM_SET_CPUID2``. This section
documents some cases in which that requires some care.
Local APIC features
~~~~~~~~~~~~~~~~~~~
CPU[EAX=1]:ECX[21] (X2APIC) is reported by ``KVM_GET_SUPPORTED_CPUID``,
but it can only be enabled if ``KVM_CREATE_IRQCHIP`` or
``KVM_ENABLE_CAP(KVM_CAP_IRQCHIP_SPLIT)`` are used to enable in-kernel emulation of
the local APIC.
The same is true for the ``KVM_FEATURE_PV_UNHALT`` paravirtualized feature.
CPU[EAX=1]:ECX[24] (TSC_DEADLINE) is not reported by ``KVM_GET_SUPPORTED_CPUID``.
It can be enabled if ``KVM_CAP_TSC_DEADLINE_TIMER`` is present and the kernel
has enabled in-kernel emulation of the local APIC.
CPU topology
~~~~~~~~~~~~
Several CPUID values include topology information for the host CPU:
0x0b and 0x1f for Intel systems, 0x8000001e for AMD systems. Different
versions of KVM return different values for this information and userspace
should not rely on it. Currently they return all zeroes.
If userspace wishes to set up a guest topology, it should be careful that
the values of these three leaves differ for each CPU. In particular,
the APIC ID is found in EDX for all subleaves of 0x0b and 0x1f, and in EAX
for 0x8000001e; the latter also encodes the core id and node id in bits
7:0 of EBX and ECX respectively.
Obsolete ioctls and capabilities
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KVM_CAP_DISABLE_QUIRKS does not let userspace know which quirks are actually
available. Use ``KVM_CHECK_EXTENSION(KVM_CAP_DISABLE_QUIRKS2)`` instead if
available.
Ordering of KVM_GET_*/KVM_SET_* ioctls
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TBD
......@@ -1498,9 +1498,7 @@ endif
PHONY += modules
# if KBUILD_BUILTIN && !KBUILD_MIXED_TREE, depend on vmlinux
modules: $(if $(KBUILD_BUILTIN), $(if $(KBUILD_MIXED_TREE),,vmlinux))
modules: modules_check modules_prepare
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
modules: $(if $(KBUILD_BUILTIN), $(if $(KBUILD_MIXED_TREE),,vmlinux)) modules_check modules_prepare
PHONY += modules_check
modules_check: modules.order
......@@ -1518,12 +1516,9 @@ PHONY += modules_prepare
modules_prepare: prepare
$(Q)$(MAKE) $(build)=scripts scripts/module.lds
# Target to install modules
PHONY += modules_install
modules_install: _modinst_ _modinst_post
PHONY += _modinst_
_modinst_:
modules_install: __modinst_pre
PHONY += __modinst_pre
__modinst_pre:
@rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/source
@mkdir -p $(MODLIB)/kernel
......@@ -1535,14 +1530,6 @@ _modinst_:
@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
@cp -f $(mixed-build-prefix)modules.builtin $(MODLIB)/
@cp -f $(or $(mixed-build-prefix),$(objtree)/)modules.builtin.modinfo $(MODLIB)/
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
# This depmod is only for convenience to give the initial
# boot a modules.dep even before / is mounted read-write. However the
# boot script depmod is the master version.
PHONY += _modinst_post
_modinst_post: _modinst_
$(call cmd,depmod)
ifeq ($(CONFIG_MODULE_SIG), y)
PHONY += modules_sign
......@@ -1550,20 +1537,6 @@ modules_sign:
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modsign
endif
else # CONFIG_MODULES
# Modules not configured
# ---------------------------------------------------------------------------
PHONY += modules modules_install
modules modules_install:
@echo >&2
@echo >&2 "The present kernel configuration has modules disabled."
@echo >&2 "Type 'make config' and enable loadable module support."
@echo >&2 "Then build a kernel with module support enabled."
@echo >&2
@exit 1
endif # CONFIG_MODULES
###
......@@ -1865,6 +1838,41 @@ PHONY += modules_prepare
endif # KBUILD_EXTMOD
# ---------------------------------------------------------------------------
# Modules
PHONY += modules modules_install
ifdef CONFIG_MODULES
modules: $(MODORDER)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
$(KERNELRELEASE) $(mixed-build-prefix)
modules_install:
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
$(call cmd,depmod)
else # CONFIG_MODULES
# Modules not configured
# ---------------------------------------------------------------------------
modules modules_install:
@echo >&2 '***'
@echo >&2 '*** The present kernel configuration has modules disabled.'
@echo >&2 '*** To use the module feature, please run "make menuconfig" etc.'
@echo >&2 '*** to enable CONFIG_MODULES.'
@echo >&2 '***'
@exit 1
KBUILD_MODULES :=
endif # CONFIG_MODULES
# Single targets
# ---------------------------------------------------------------------------
# To build individual files in subdirectories, you can do like this:
......@@ -2054,11 +2062,6 @@ tools/%: FORCE
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
cmd_rmfiles = rm -rf $(rm-files)
# Run depmod only if we have System.map and depmod is executable
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
$(KERNELRELEASE) $(mixed-build-prefix)
# read saved command lines for existing targets
existing-targets := $(wildcard $(sort $(targets)))
......
This diff is collapsed.
[abi_symbol_list]
activate_task
add_cpu
add_timer
add_timer_on
......@@ -16,6 +17,7 @@
alloc_chrdev_region
__alloc_disk_node
alloc_etherdev_mqs
alloc_iova_fast
alloc_netdev_mqs
alloc_pages_exact
__alloc_pages_nodemask
......@@ -352,6 +354,7 @@
csum_tcpudp_nofold
_ctype
datagram_poll
deactivate_task
debugfs_attr_read
debugfs_attr_write
debugfs_create_atomic_t
......@@ -878,6 +881,7 @@
frame_vector_create
frame_vector_destroy
frame_vector_to_pages
free_iova_fast
free_irq
free_netdev
__free_pages
......@@ -910,11 +914,13 @@
gen_pool_add_owner
gen_pool_alloc_algo_owner
gen_pool_avail
gen_pool_best_fit
gen_pool_create
gen_pool_destroy
gen_pool_first_fit_align
gen_pool_free_owner
gen_pool_has_addr
gen_pool_set_algo
gen_pool_size
get_cpu_device
get_cpu_idle_time
......@@ -1060,6 +1066,7 @@
inc_zone_page_state
in_egroup_p
init_dummy_netdev
init_iova_domain
init_net
init_pid_ns
init_pseudo
......@@ -1240,6 +1247,7 @@
kthread_bind_mask
kthread_cancel_delayed_work_sync
kthread_cancel_work_sync
kthread_create_on_cpu
kthread_create_on_node
kthread_create_worker
kthread_delayed_work_timer_fn
......@@ -1248,10 +1256,14 @@
kthread_flush_worker
__kthread_init_worker
kthread_mod_delayed_work
kthread_park
kthread_parkme
kthread_queue_delayed_work
kthread_queue_work
kthread_should_park
kthread_should_stop
kthread_stop
kthread_unpark
kthread_worker_fn
ktime_get
ktime_get_mono_fast_ns
......@@ -1490,6 +1502,7 @@
__page_frag_cache_drain
page_frag_free
page_mapping
page_pinner_inited
__page_pinner_put_page
panic
panic_notifier_list
......@@ -1671,6 +1684,7 @@
__put_cred
put_device
put_disk
put_iova_domain
__put_page
put_pid
put_sg_io_hdr
......@@ -1909,6 +1923,7 @@
set_page_dirty
set_page_dirty_lock
__SetPageMovable
set_task_cpu
set_user_nice
sg_alloc_table
sg_alloc_table_from_pages
......@@ -2238,6 +2253,7 @@
__traceiter_android_rvh_prepare_prio_fork
__traceiter_android_rvh_remove_entity_load_avg
__traceiter_android_rvh_sched_fork
__traceiter_android_rvh_sched_newidle_balance
__traceiter_android_rvh_select_task_rq_fair
__traceiter_android_rvh_select_task_rq_rt
__traceiter_android_rvh_set_iowait
......@@ -2374,6 +2390,7 @@
__tracepoint_android_rvh_prepare_prio_fork
__tracepoint_android_rvh_remove_entity_load_avg
__tracepoint_android_rvh_sched_fork
__tracepoint_android_rvh_sched_newidle_balance
__tracepoint_android_rvh_select_task_rq_fair
__tracepoint_android_rvh_select_task_rq_rt
__tracepoint_android_rvh_set_iowait
......
......@@ -1348,6 +1348,9 @@
serial8250_unregister_port
serial8250_update_uartclk
# required by 8822ce.ko
netdev_set_default_ethtool_ops
# required by act8865-regulator.ko
regulator_set_pull_down_regmap
......@@ -1359,6 +1362,30 @@
# required by aes-ce-ccm.ko
ce_aes_expandkey
# required by aic8800_fdrv.ko
cfg80211_cqm_rssi_notify
cfg80211_cqm_pktloss_notify
cfg80211_rx_unexpected_4addr_frame
cfg80211_notify_new_peer_candidate
cfg80211_ft_event
cfg80211_report_obss_beacon_khz
ieee80211_amsdu_to_8023s
skb_append
cfg80211_probe_status
cfg80211_ch_switch_started_notify
ieee80211_chandef_to_operating_class
cfg80211_cac_event
cfg80211_radar_event
# required by aic_btusb.ko
usb_interrupt_msg
usb_disable_autosuspend
__pskb_copy_fclone
# required by aic_load_fw.ko
send_sig
wait_for_completion_killable_timeout
# required by analogix_dp.ko
drm_dp_start_crc
drm_dp_stop_crc
......@@ -1584,6 +1611,10 @@
of_clk_add_hw_provider
of_clk_hw_simple_get
# required by clk-out.ko
__clk_hw_register_gate
of_clk_parent_fill
# required by clk-rk628.ko
devm_reset_controller_register
......@@ -1847,6 +1878,9 @@
regulator_register_notifier
regulator_unregister_notifier
# required by it662x.ko
snd_pcm_rate_to_rate_bit
# required by kalmia.ko
usb_bulk_msg
......@@ -1866,6 +1900,18 @@
# required by lzo.ko
lzo1x_1_compress
# moal.ko
cpu_latency_qos_request_active
cfg80211_auth_timeout
in4_pton
iw_handler_set_spy
iw_handler_get_spy
iw_handler_set_thrspy
iw_handler_get_thrspy
cfg80211_report_wowlan_wakeup
sdio_release_irq
sdio_claim_irq
# required by nvme-core.ko
bd_set_nr_sectors
blk_execute_rq
......@@ -2144,6 +2190,15 @@
mmc_pwrseq_register
mmc_pwrseq_unregister
# required by r8168.ko
pci_set_mwi
pci_clear_mwi
proc_get_parent_data
skb_checksum_help
__skb_gso_segment
remove_proc_subtree
pci_choose_state
# required by reboot-mode.ko
devres_release
kernel_kobj
......@@ -2530,6 +2585,9 @@
__rtc_register_device
rtc_update_irq
# required by rtkm.ko
stack_trace_print
# required by sdhci-of-arasan.ko
__sdhci_add_host
sdhci_cleanup_host
......@@ -2551,6 +2609,10 @@
sdhci_remove_host
sdhci_request
# required by sensorbox.ko
kernel_sigaction
hidraw_report_event
# required by sensor_dev.ko
class_create_file_ns
class_remove_file_ns
......@@ -2604,6 +2666,7 @@
snd_soc_dapm_new_widgets
# required by snd-soc-rockchip-i2s-tdm.ko
clk_has_parent
clk_is_match
pm_runtime_forbid
snd_pcm_stop_xrun
......@@ -2611,6 +2674,13 @@
# required by snd-soc-rockchip-i2s.ko
of_prop_next_string
# required by snd-soc-rockchip-multi-dais.ko
snd_soc_component_initialize
snd_soc_add_component
snd_soc_rtdcom_lookup
snd_pcm_format_size
snd_hwparams_to_dma_slave_config
# required by snd-soc-rockchip-multicodecs.ko
of_parse_phandle_with_fixed_args
round_jiffies_relative
......@@ -2723,6 +2793,9 @@
skb_tstamp_tx
synchronize_net
# required by swopwm.ko
devm_of_pwm_get
# required by sw_sync.ko
dma_fence_free
dma_fence_signal_locked
......@@ -2754,6 +2827,9 @@
clockevents_config_and_register
irq_of_parse_and_map
# required by touchE.ko
schedule_hrtimeout
# required by tps65132-regulator.ko
regulator_set_active_discharge_regmap
......@@ -2816,6 +2892,20 @@
usb_show_dynids
usb_store_new_id
# required by usb_audio.ko
usb_composite_probe
usb_get_function_instance
usb_string_ids_tab
usb_add_config
usb_gadget_connect
usb_put_function
usb_get_function
usb_composite_overwrite_options
usb_gadget_disconnect
usb_remove_function
usb_composite_unregister
usb_ep_autoconfig_reset
# required by v4l2-fwnode.ko
fwnode_device_is_available
fwnode_graph_get_next_endpoint
......@@ -2850,6 +2940,18 @@
# required by vl6180.ko
iio_read_const_attr
# required by wlan_mt7663_usb.ko
cfg80211_assoc_timeout
skb_pull_rcsum
sched_set_normal
cfg80211_tx_mlme_mgmt
cfg80211_rx_mlme_mgmt
cfg80211_rx_assoc_resp
usb_string
usb_anchor_empty
usb_reset_endpoint
dev_valid_name
# required by zram.ko
__alloc_percpu
bio_endio
......
......@@ -69,6 +69,7 @@
device_unregister
_dev_info
__dev_kfree_skb_any
__dev_kfree_skb_irq
devm_ioremap
devm_ioremap_resource
devm_kfree
......
......@@ -124,6 +124,8 @@
#define SO_DETACH_REUSEPORT_BPF 68
#define SO_NETNS_COOKIE 71
#if !defined(__KERNEL__)
#if __BITS_PER_LONG == 64
......
......@@ -606,6 +606,8 @@ CONFIG_PSTORE_CONSOLE=y
CONFIG_PSTORE_PMSG=y
CONFIG_PSTORE_RAM=y
CONFIG_EROFS_FS=y
CONFIG_EROFS_FS_PCPU_KTHREAD=y
CONFIG_EROFS_FS_PCPU_KTHREAD_HIPRI=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
......@@ -711,4 +713,5 @@ CONFIG_TRACE_MMIO_ACCESS=y
CONFIG_TRACEFS_DISABLE_AUTOMOUNT=y
CONFIG_HIST_TRIGGERS=y
CONFIG_PID_IN_CONTEXTIDR=y
CONFIG_FUNCTION_ERROR_INJECTION=y
# CONFIG_RUNTIME_TESTING_MENU is not set
......@@ -40,7 +40,9 @@ void mte_sync_tags(pte_t old_pte, pte_t pte);
void mte_copy_page_tags(void *kto, const void *kfrom);
void mte_thread_init_user(void);
void mte_thread_switch(struct task_struct *next);
void mte_cpu_setup(void);
void mte_suspend_enter(void);
void mte_suspend_exit(void);
long set_mte_ctrl(struct task_struct *task, unsigned long arg);
long get_mte_ctrl(struct task_struct *task);
int mte_ptrace_copy_tags(struct task_struct *child, long request,
......@@ -69,6 +71,9 @@ static inline void mte_thread_switch(struct task_struct *next)
static inline void mte_suspend_enter(void)
{
}
static inline void mte_suspend_exit(void)
{
}
static inline long set_mte_ctrl(struct task_struct *task, unsigned long arg)
{
return 0;
......
......@@ -1871,7 +1871,8 @@ static void bti_enable(const struct arm64_cpu_capabilities *__unused)
static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap)
{
sysreg_clear_set(sctlr_el1, 0, SCTLR_ELx_ATA | SCTLR_EL1_ATA0);
isb();
mte_cpu_setup();
/*
* Clear the tags in the zero page. This needs to be done via the
......
......@@ -283,6 +283,49 @@ void mte_thread_switch(struct task_struct *next)
mte_check_tfsr_el1();
}
void mte_cpu_setup(void)
{
u64 rgsr;
/*
* CnP must be enabled only after the MAIR_EL1 register has been set
* up. Inconsistent MAIR_EL1 between CPUs sharing the same TLB may
* lead to the wrong memory type being used for a brief window during
* CPU power-up.
*
* CnP is not a boot feature so MTE gets enabled before CnP, but let's
* make sure that is the case.
*/
BUG_ON(read_sysreg(ttbr0_el1) & TTBR_CNP_BIT);
BUG_ON(read_sysreg(ttbr1_el1) & TTBR_CNP_BIT);
/* Normal Tagged memory type at the corresponding MAIR index */
sysreg_clear_set(mair_el1,
MAIR_ATTRIDX(MAIR_ATTR_MASK, MT_NORMAL_TAGGED),
MAIR_ATTRIDX(MAIR_ATTR_NORMAL_TAGGED,
MT_NORMAL_TAGGED));
write_sysreg_s(KERNEL_GCR_EL1, SYS_GCR_EL1);
/*
* If GCR_EL1.RRND=1 is implemented the same way as RRND=0, then
* RGSR_EL1.SEED must be non-zero for IRG to produce
* pseudorandom numbers. As RGSR_EL1 is UNKNOWN out of reset, we
* must initialize it.
*/
rgsr = (read_sysreg(CNTVCT_EL0) & SYS_RGSR_EL1_SEED_MASK) <<
SYS_RGSR_EL1_SEED_SHIFT;
if (rgsr == 0)
rgsr = 1 << SYS_RGSR_EL1_SEED_SHIFT;
write_sysreg_s(rgsr, SYS_RGSR_EL1);
/* clear any pending tag check faults in TFSR*_EL1 */
write_sysreg_s(0, SYS_TFSR_EL1);
write_sysreg_s(0, SYS_TFSRE0_EL1);
local_flush_tlb_all();
}
void mte_suspend_enter(void)
{
if (!system_supports_mte())
......@@ -299,6 +342,14 @@ void mte_suspend_enter(void)
mte_check_tfsr_el1();
}
void mte_suspend_exit(void)
{
if (!system_supports_mte())
return;
mte_cpu_setup();
}
long set_mte_ctrl(struct task_struct *task, unsigned long arg)
{
u64 mte_ctrl = (~((arg & PR_MTE_TAG_MASK) >> PR_MTE_TAG_SHIFT) &
......
......@@ -42,6 +42,8 @@ void notrace __cpu_suspend_exit(void)
{
unsigned int cpu = smp_processor_id();
mte_suspend_exit();
/*
* We are resuming from reset with the idmap active in TTBR0_EL1.
* We must uninstall the idmap and restore the expected MMU
......
......@@ -47,17 +47,19 @@
#ifdef CONFIG_KASAN_HW_TAGS
#define TCR_MTE_FLAGS SYS_TCR_EL1_TCMA1 | TCR_TBI1 | TCR_TBID1
#else
#elif defined(CONFIG_ARM64_MTE)
/*
* The mte_zero_clear_page_tags() implementation uses DC GZVA, which relies on
* TBI being enabled at EL1.
*/
#define TCR_MTE_FLAGS TCR_TBI1 | TCR_TBID1
#else
#define TCR_MTE_FLAGS 0
#endif
/*
* Default MAIR_EL1. MT_NORMAL_TAGGED is initially mapped as Normal memory and
* changed during __cpu_setup to Normal Tagged if the system supports MTE.
* changed during mte_cpu_setup to Normal Tagged if the system supports MTE.
*/
#define MAIR_EL1_SET \
(MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRnE, MT_DEVICE_nGnRnE) | \
......@@ -427,47 +429,6 @@ SYM_FUNC_START(__cpu_setup)
* Memory region attributes
*/
mov_q x5, MAIR_EL1_SET
#ifdef CONFIG_ARM64_MTE
mte_tcr .req x20
mov mte_tcr, #0
/*
* Update MAIR_EL1, GCR_EL1 and TFSR*_EL1 if MTE is supported
* (ID_AA64PFR1_EL1[11:8] > 1).
*/
mrs x10, ID_AA64PFR1_EL1
ubfx x10, x10, #ID_AA64PFR1_MTE_SHIFT, #4
cmp x10, #ID_AA64PFR1_MTE
b.lt 1f
/* Normal Tagged memory type at the corresponding MAIR index */
mov x10, #MAIR_ATTR_NORMAL_TAGGED
bfi x5, x10, #(8 * MT_NORMAL_TAGGED), #8
mov x10, #KERNEL_GCR_EL1
msr_s SYS_GCR_EL1, x10
/*
* If GCR_EL1.RRND=1 is implemented the same way as RRND=0, then
* RGSR_EL1.SEED must be non-zero for IRG to produce
* pseudorandom numbers. As RGSR_EL1 is UNKNOWN out of reset, we
* must initialize it.
*/
mrs x10, CNTVCT_EL0
ands x10, x10, #SYS_RGSR_EL1_SEED_MASK
csinc x10, x10, xzr, ne
lsl x10, x10, #SYS_RGSR_EL1_SEED_SHIFT
msr_s SYS_RGSR_EL1, x10
/* clear any pending tag check faults in TFSR*_EL1 */
msr_s SYS_TFSR_EL1, xzr
msr_s SYS_TFSRE0_EL1, xzr
/* set the TCR_EL1 bits */
mov_q mte_tcr, TCR_MTE_FLAGS
1:
#endif
msr mair_el1, x5
/*
* Set/prepare TCR and TTBR. TCR_EL1.T1SZ gets further
......@@ -475,11 +436,8 @@ SYM_FUNC_START(__cpu_setup)
*/
mov_q x10, TCR_TxSZ(VA_BITS) | TCR_CACHE_FLAGS | TCR_SMP_FLAGS | \
TCR_TG_FLAGS | TCR_KASLR_FLAGS | TCR_ASID16 | \
TCR_TBI0 | TCR_A1 | TCR_KASAN_SW_FLAGS
#ifdef CONFIG_ARM64_MTE
orr x10, x10, mte_tcr
.unreq mte_tcr
#endif
TCR_TBI0 | TCR_A1 | TCR_KASAN_SW_FLAGS | TCR_MTE_FLAGS
tcr_clear_errata_bits x10, x9, x5
#ifdef CONFIG_ARM64_VA_BITS_52
......
......@@ -135,6 +135,8 @@
#define SO_DETACH_REUSEPORT_BPF 68
#define SO_NETNS_COOKIE 71
#if !defined(__KERNEL__)
#if __BITS_PER_LONG == 64
......
......@@ -116,6 +116,8 @@
#define SO_DETACH_REUSEPORT_BPF 0x4042
#define SO_NETNS_COOKIE 0x4045
#if !defined(__KERNEL__)
#if __BITS_PER_LONG == 64
......
......@@ -117,6 +117,8 @@
#define SO_DETACH_REUSEPORT_BPF 0x0047
#define SO_NETNS_COOKIE 0x0050
#if !defined(__KERNEL__)
......
......@@ -536,6 +536,8 @@ CONFIG_PSTORE_CONSOLE=y
CONFIG_PSTORE_PMSG=y
CONFIG_PSTORE_RAM=y
CONFIG_EROFS_FS=y
CONFIG_EROFS_FS_PCPU_KTHREAD=y
CONFIG_EROFS_FS_PCPU_KTHREAD_HIPRI=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
......@@ -638,3 +640,4 @@ CONFIG_BUG_ON_DATA_CORRUPTION=y
CONFIG_TRACEFS_DISABLE_AUTOMOUNT=y
CONFIG_HIST_TRIGGERS=y
CONFIG_UNWINDER_FRAME_POINTER=y
CONFIG_FUNCTION_ERROR_INJECTION=y
......@@ -4556,6 +4556,17 @@ void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason,
vmx_switch_vmcs(vcpu, &vmx->vmcs01);
/*
* If IBRS is advertised to the vCPU, KVM must flush the indirect
* branch predictors when transitioning from L2 to L1, as L1 expects
* hardware (KVM in this case) to provide separate predictor modes.
* Bare metal isolates VMX root (host) from VMX non-root (guest), but
* doesn't isolate different VMCSs, i.e. in this case, doesn't provide
* separate modes for L2 vs L1.
*/
if (guest_cpuid_has(vcpu, X86_FEATURE_SPEC_CTRL))
indirect_branch_prediction_barrier();
/* Update any VMCS fields that might have changed while L2 ran */
vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, vmx->msr_autoload.host.nr);
vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, vmx->msr_autoload.guest.nr);
......
......@@ -1431,8 +1431,10 @@ void vmx_vcpu_load_vmcs(struct kvm_vcpu *vcpu, int cpu,
/*
* No indirect branch prediction barrier needed when switching
* the active VMCS within a guest, e.g. on nested VM-Enter.
* The L1 VMM can protect itself with retpolines, IBPB or IBRS.
* the active VMCS within a vCPU, unless IBRS is advertised to
* the vCPU. To minimize the number of IBPBs executed, KVM
* performs IBPB on nested VM-Exit (a single nested transition
* may switch the active VMCS multiple times).
*/
if (!buddy || WARN_ON_ONCE(buddy->vmcs != prev))
indirect_branch_prediction_barrier();
......
......@@ -5,7 +5,7 @@
#So we unset the DTC
unset DTC
DEFCONFIG=ti_sdk_arm64_android_release_defconfig
PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/defconfig ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/arm64_prune.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/v8_baseport.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/v8_ipc.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/connectivity.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/audio_display.cfg ${ROOT_DIR}/${KERNEL_DIR}/kernel/configs/android-base.config ${ROOT_DIR}/${KERNEL_DIR}/kernel/configs/android-recommended.config ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/v8_android.cfg"
PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/defconfig ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/arm64_prune.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/v8_baseport.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/v8_ipc.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/connectivity.cfg ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/audio_display.cfg ${ROOT_DIR}/${KERNEL_DIR}/kernel/configs/android-base.config ${ROOT_DIR}/${KERNEL_DIR}/kernel/configs/android-recommended.config ${KERNEL_DIR}/kernel/configs/android-recommended-arm64.config ${ROOT_DIR}/${KERNEL_DIR}/ti_config_fragments/v8_android.cfg"
POST_DEFCONFIG_CMDS="rm ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG}"
KERNEL_DIR=common
......