Commit Graph

1329153 Commits

Author SHA1 Message Date
Suravee Suthikulpanit
d81cadbe16 KVM: SVM: Disable AVIC on SNP-enabled system without HvInUseWrAllowed feature
On SNP-enabled system, VMRUN marks AVIC Backing Page as in-use while
the guest is running for both secure and non-secure guest. Any hypervisor
write to the in-use vCPU's AVIC backing page (e.g. to inject an interrupt)
will generate unexpected #PF in the host.

Currently, attempt to run AVIC guest would result in the following error:

    BUG: unable to handle page fault for address: ff3a442e549cc270
    #PF: supervisor write access in kernel mode
    #PF: error_code(0x80000003) - RMP violation
    PGD b6ee01067 P4D b6ee02067 PUD 10096d063 PMD 11c540063 PTE 80000001149cc163
    SEV-SNP: PFN 0x1149cc unassigned, dumping non-zero entries in 2M PFN region: [0x114800 - 0x114a00]
    ...

Newer AMD system is enhanced to allow hypervisor to modify the backing page
for non-secure guest on SNP-enabled system. This enhancement is available
when the CPUID Fn8000_001F_EAX bit 30 is set (HvInUseWrAllowed).

This table describes AVIC support matrix w.r.t. SNP enablement:

               | Non-SNP system |     SNP system
-----------------------------------------------------
 Non-SNP guest |  AVIC Activate | AVIC Activate iff
               |                | HvInuseWrAllowed=1
-----------------------------------------------------
     SNP guest |      N/A       |    Secure AVIC

Therefore, check and disable AVIC in kvm_amd driver when the feature is not
available on SNP-enabled system.

See the AMD64 Architecture Programmer’s Manual (APM) Volume 2 for detail.
(https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/
programmer-references/40332.pdf)

Fixes: 216d106c7f ("x86/sev: Add SEV-SNP host initialization support")
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20241104075845.7583-1-suravee.suthikulpanit@amd.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
2024-12-19 17:47:51 -08:00
Stephen Rothwell
d8617a3ba0 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git 2024-12-20 12:26:57 +11:00
Stephen Rothwell
bfb2b1bbdb Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git 2024-12-20 12:26:56 +11:00
Stephen Rothwell
dca381d2cc Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 2024-12-20 12:23:25 +11:00
Stephen Rothwell
c9b816ca98 Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git 2024-12-20 12:23:24 +11:00
Stephen Rothwell
8316cb8f20 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git 2024-12-20 12:23:22 +11:00
Stephen Rothwell
a360114dfc Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git 2024-12-20 12:18:57 +11:00
Stephen Rothwell
75ff0b4c3d Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux 2024-12-20 12:14:10 +11:00
Stephen Rothwell
735f67ad36 Merge branch 'drm-xe-next' of https://gitlab.freedesktop.org/drm/xe/kernel 2024-12-20 12:14:09 +11:00
Stephen Rothwell
39772e3ec9 Merge branch 'msm-next-lumag' of https://gitlab.freedesktop.org/lumag/msm.git 2024-12-20 12:14:06 +11:00
Stephen Rothwell
e069bb813f Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/i915/kernel
# Conflicts:
#	drivers/gpu/drm/i915/display/intel_dp_mst.c
#	drivers/gpu/drm/i915/display/intel_dsb.c
2024-12-20 12:14:03 +11:00
Stephen Rothwell
00a6ef30ae Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux 2024-12-20 12:14:00 +11:00
Stephen Rothwell
cecc27b364 Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/misc/kernel.git 2024-12-20 12:13:59 +11:00
Stephen Rothwell
d3a1699e63 Merge branch 'for-linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git 2024-12-20 12:13:57 +11:00
Stephen Rothwell
6d7a3c76c5 Merge branch 'drm-next' of https://gitlab.freedesktop.org/drm/kernel.git 2024-12-20 12:13:56 +11:00
Stephen Rothwell
a682817489 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git 2024-12-20 12:10:57 +11:00
Stephen Rothwell
25d313f34d Merge branch 'spi-nor/next' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git 2024-12-20 12:10:56 +11:00
Stephen Rothwell
a7acb58ac1 Merge branch 'nand/next' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git 2024-12-20 12:10:55 +11:00
Stephen Rothwell
06a622defc Merge branch 'mtd/next' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git 2024-12-20 12:10:53 +11:00
Stephen Rothwell
e58c8fbfaa Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan-next.git 2024-12-20 11:48:50 +11:00
Stephen Rothwell
350a5ae97e Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git 2024-12-20 11:48:47 +11:00
Stephen Rothwell
b806b8e127 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git 2024-12-20 11:48:46 +11:00
Stephen Rothwell
d711d1b348 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 2024-12-20 11:48:45 +11:00
Stephen Rothwell
31f61fbd8c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git 2024-12-20 11:48:42 +11:00
Stephen Rothwell
49e3ee1413 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git 2024-12-20 11:48:40 +11:00
Stephen Rothwell
0b744f9e35 Merge branch 'main' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git 2024-12-20 11:48:38 +11:00
Stephen Rothwell
eb65cde519 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git 2024-12-20 11:48:37 +11:00
Stephen Rothwell
be01032c8c Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git 2024-12-20 11:29:47 +11:00
Stephen Rothwell
4f5e1cc179 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git 2024-12-20 11:29:44 +11:00
Stephen Rothwell
299285bf13 Merge branch 'devfreq-next' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git
# Conflicts:
#	drivers/devfreq/event/exynos-nocp.c
#	drivers/devfreq/event/exynos-ppmu.c
#	drivers/devfreq/mtk-cci-devfreq.c
#	drivers/devfreq/rk3399_dmc.c
#	drivers/devfreq/sun8i-a33-mbus.c
2024-12-20 11:29:43 +11:00
Stephen Rothwell
1bf9511444 Merge branch 'cpupower' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git 2024-12-20 11:29:42 +11:00
Stephen Rothwell
baf1197b35 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git 2024-12-20 11:29:40 +11:00
Stephen Rothwell
1dae1421fa Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git 2024-12-20 11:29:38 +11:00
Stephen Rothwell
7bb5219654 Merge branch 'next' of git://linuxtv.org/media-ci/media-pending.git 2024-12-20 11:07:40 +11:00
Stephen Rothwell
a4b7d49533 Merge branch 'docs-next' of git://git.lwn.net/linux.git 2024-12-20 11:07:39 +11:00
Stephen Rothwell
e24a64840a Merge branch 'hwmon-next' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git 2024-12-20 11:07:37 +11:00
Stephen Rothwell
2f19d7a812 Merge branch 'i2c/i2c-host' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git 2024-12-20 11:07:36 +11:00
Stephen Rothwell
2d144c87f2 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git 2024-12-20 11:07:35 +11:00
Stephen Rothwell
ecc935f512 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git 2024-12-20 11:07:33 +11:00
Stephen Rothwell
23b66e8e8b Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git 2024-12-20 11:07:32 +11:00
Dimitri Fedrau
de68987480 power: supply: gpio-charger: add support for default charge current limit
With DT properties charge-current-limit-gpios and
charge-current-limit-mapping one can define charge current limits in uA
using up to 32 GPIOs. At the moment the driver defaults to smallest charge
current limitation for safety reasons. When disabling charging is
supported, which should be common, the driver defaults to non charging on
probe. By having a default, charging can be enabled on probe for such
devices.

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
Link: https://lore.kernel.org/r/20241218-default-charge-current-limit-v3-2-b26118cf06b5@liebherr.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2024-12-20 00:52:31 +01:00
Dimitri Fedrau
0a219d6fd7 dt-bindings: power: supply: gpio-charger: add support for default charge current limit
With DT properties charge-current-limit-gpios and
charge-current-limit-mapping one can define charge current limits in uA
using up to 32 GPIOs. Add property charge-current-limit-default-microamp
which selects a default charge current limit that must be listed in
charge-current-limit-mapping.
This is helpful when the smallest possible charge current limit is 0uA. The
driver defaults to the smallest possible value at the moment, which
disables charging on probe. With the default its possible to setup a safe
charge current limit.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
Link: https://lore.kernel.org/r/20241218-default-charge-current-limit-v3-1-b26118cf06b5@liebherr.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2024-12-20 00:52:31 +01:00
Stephen Rothwell
07ccd1271c Merge branch 'fs-next' of linux-next 2024-12-20 10:45:33 +11:00
Stephen Rothwell
3aa602263e Merge branch 'xtensa-for-next' of git://github.com/jcmvbkbc/linux-xtensa.git 2024-12-20 10:41:51 +11:00
Stephen Rothwell
a7fac4ab97 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git 2024-12-20 10:41:48 +11:00
Stephen Rothwell
ebbe020070 Merge branch 'riscv-soc-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git 2024-12-20 10:41:47 +11:00
Stephen Rothwell
0c0d0d18c7 Merge branch 'riscv-dt-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git 2024-12-20 10:41:46 +11:00
Stephen Rothwell
2c3bb86ef6 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 2024-12-20 10:41:45 +11:00
Stephen Rothwell
67cc80cb9c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git 2024-12-20 10:41:44 +11:00
Stephen Rothwell
57c128f584 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git 2024-12-20 10:41:41 +11:00