From: Thomas Lamprecht Date: Mon, 5 Feb 2024 12:08:43 +0000 (+0100) Subject: update kernel and patches for Ubuntu-6.5.0-20.20 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5dde66b4fe070f0a8c12a9ee34deeddf1e9eb875;p=pve-kernel.git update kernel and patches for Ubuntu-6.5.0-20.20 Signed-off-by: Thomas Lamprecht --- diff --git a/patches/kernel/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch b/patches/kernel/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch index 1cdc5ee..93dba9f 100644 --- a/patches/kernel/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch +++ b/patches/kernel/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch @@ -21,7 +21,7 @@ Signed-off-by: Thomas Lamprecht 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/Makefile b/init/Makefile -index ec557ada3c12..72095034f338 100644 +index cbac576c57d6..479b1253fcbe 100644 --- a/init/Makefile +++ b/init/Makefile @@ -29,7 +29,7 @@ preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) := PREEMPT_DYNAMIC diff --git a/patches/kernel/0004-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch b/patches/kernel/0004-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch index b32ab25..1f8e722 100644 --- a/patches/kernel/0004-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch +++ b/patches/kernel/0004-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch @@ -55,10 +55,10 @@ Signed-off-by: Thomas Lamprecht 2 files changed, 111 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt -index 9f2bcb8b7f96..a60a4220be95 100644 +index 90ddf08e8409..eedfabda597f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -4281,6 +4281,15 @@ +@@ -4285,6 +4285,15 @@ Also, it enforces the PCI Local Bus spec rule that those bits should be 0 in system reset events (useful for kexec/kdump cases). @@ -75,7 +75,7 @@ index 9f2bcb8b7f96..a60a4220be95 100644 Safety option to keep boot IRQs enabled. This should never be necessary. diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index 139df46ed306..08450329f1a3 100644 +index b3a55f2cab46..baef591d10f6 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -287,6 +287,106 @@ static int __init pci_apply_final_quirks(void) diff --git a/patches/kernel/0006-net-core-downgrade-unregister_netdevice-refcount-lea.patch b/patches/kernel/0006-net-core-downgrade-unregister_netdevice-refcount-lea.patch index 2d16ecb..b66932d 100644 --- a/patches/kernel/0006-net-core-downgrade-unregister_netdevice-refcount-lea.patch +++ b/patches/kernel/0006-net-core-downgrade-unregister_netdevice-refcount-lea.patch @@ -14,10 +14,10 @@ Signed-off-by: Fabian Grünbichler 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c -index fe8c46c46505..db9ce84f2006 100644 +index 3c5106cd0602..3634982362f7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -10298,7 +10298,7 @@ static struct net_device *netdev_wait_allrefs_any(struct list_head *list) +@@ -10352,7 +10352,7 @@ static struct net_device *netdev_wait_allrefs_any(struct list_head *list) if (time_after(jiffies, warning_time + READ_ONCE(netdev_unregister_timeout_secs) * HZ)) { list_for_each_entry(dev, list, todo_list) { diff --git a/patches/kernel/0008-kvm-xsave-set-mask-out-PKRU-bit-in-xfeatures-if-vCPU.patch b/patches/kernel/0008-kvm-xsave-set-mask-out-PKRU-bit-in-xfeatures-if-vCPU.patch index ea34cc7..f1d9ca8 100644 --- a/patches/kernel/0008-kvm-xsave-set-mask-out-PKRU-bit-in-xfeatures-if-vCPU.patch +++ b/patches/kernel/0008-kvm-xsave-set-mask-out-PKRU-bit-in-xfeatures-if-vCPU.patch @@ -108,10 +108,10 @@ index b1658c0de847..12a02851ff57 100644 int cpuid_query_maxphyaddr(struct kvm_vcpu *vcpu); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 7bcf1a76a6ab..aa225f430299 100644 +index a5c8a01f7e7e..632d2d18041a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -5424,6 +5424,19 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu, +@@ -5426,6 +5426,19 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu, if (fpstate_is_confidential(&vcpu->arch.guest_fpu)) return 0; diff --git a/patches/kernel/0009-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch b/patches/kernel/0009-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch index 3d3b29c..d5e9b83 100644 --- a/patches/kernel/0009-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch +++ b/patches/kernel/0009-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch @@ -11,7 +11,7 @@ Signed-off-by: Thomas Lamprecht 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c -index 656b2150643e..06fefd2a4bfa 100644 +index 15e2649b25ef..752f77e285f2 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -298,6 +298,7 @@ static int dmar_map_gfx = 1; @@ -32,7 +32,7 @@ index 656b2150643e..06fefd2a4bfa 100644 } else { pr_notice("Unknown option - '%s'\n", str); } -@@ -2503,7 +2507,7 @@ static bool device_rmrr_is_relaxable(struct device *dev) +@@ -2504,7 +2508,7 @@ static bool device_rmrr_is_relaxable(struct device *dev) return false; pdev = to_pci_dev(dev); diff --git a/patches/kernel/0011-KVM-nSVM-Advertise-support-for-flush-by-ASID.patch b/patches/kernel/0011-KVM-nSVM-Advertise-support-for-flush-by-ASID.patch index d7d46c1..bdfc0f0 100644 --- a/patches/kernel/0011-KVM-nSVM-Advertise-support-for-flush-by-ASID.patch +++ b/patches/kernel/0011-KVM-nSVM-Advertise-support-for-flush-by-ASID.patch @@ -24,10 +24,10 @@ Signed-off-by: Thomas Lamprecht 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c -index c8466bc64b87..6154eda73d41 100644 +index 99832814341c..e8bb2bfd1ba1 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c -@@ -4983,6 +4983,7 @@ static __init void svm_set_cpu_caps(void) +@@ -4985,6 +4985,7 @@ static __init void svm_set_cpu_caps(void) if (nested) { kvm_cpu_cap_set(X86_FEATURE_SVM); kvm_cpu_cap_set(X86_FEATURE_VMCBCLEAN); diff --git a/patches/kernel/0013-Revert-UBUNTU-SAUCE-ceph-make-sure-all-the-files-suc.patch b/patches/kernel/0013-Revert-UBUNTU-SAUCE-ceph-make-sure-all-the-files-suc.patch deleted file mode 100644 index 17f31d8..0000000 --- a/patches/kernel/0013-Revert-UBUNTU-SAUCE-ceph-make-sure-all-the-files-suc.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Thomas Lamprecht -Date: Tue, 7 Nov 2023 09:26:16 +0100 -Subject: [PATCH] Revert "UBUNTU: SAUCE: ceph: make sure all the files - successfully put before unmounting" - -This reverts commit a53dba9297be9597eac7b17738723bd44bac97ea, which -was an early attempt to fix a bug that was actually present in the -ceph layer, as confirmed by the original patch author [0], and fixed -actually there now [1]. - -[0]: https://lore.kernel.org/all/8443166a-7182-7777-a489-14b5dab20bd5@redhat.com/ -[1]: https://patchwork.kernel.org/project/ceph-devel/patch/20221221093031.132792-1-xiubli@redhat.com/ -Hide - -Signed-off-by: Thomas Lamprecht ---- - fs/crypto/keyring.c | 6 +----- - fs/inode.c | 5 +---- - 2 files changed, 2 insertions(+), 9 deletions(-) - -diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c -index 147b9a11c62c..7cbb1fd872ac 100644 ---- a/fs/crypto/keyring.c -+++ b/fs/crypto/keyring.c -@@ -237,11 +237,7 @@ void fscrypt_destroy_keyring(struct super_block *sb) - * with ->mk_secret. There should be no structural refs - * beyond the one associated with the active ref. - */ -- if (refcount_read(&mk->mk_active_refs) != 1) { -- printk("fscrypt_destroy_keyring: mk_active_refs = %d\n", -- refcount_read(&mk->mk_active_refs)); -- WARN_ON_ONCE(refcount_read(&mk->mk_active_refs) != 1); -- } -+ WARN_ON_ONCE(refcount_read(&mk->mk_active_refs) != 1); - WARN_ON_ONCE(refcount_read(&mk->mk_struct_refs) != 1); - WARN_ON_ONCE(!is_master_key_secret_present(&mk->mk_secret)); - wipe_master_key_secret(&mk->mk_secret); -diff --git a/fs/inode.c b/fs/inode.c -index 3b8abad427b4..67611a360031 100644 ---- a/fs/inode.c -+++ b/fs/inode.c -@@ -716,11 +716,8 @@ void evict_inodes(struct super_block *sb) - again: - spin_lock(&sb->s_inode_list_lock); - list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { -- if (atomic_read(&inode->i_count)) { -- printk("evict_inodes inode %p, i_count = %d, was skipped!\n", -- inode, atomic_read(&inode->i_count)); -+ if (atomic_read(&inode->i_count)) - continue; -- } - - spin_lock(&inode->i_lock); - if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) { diff --git a/patches/kernel/0013-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Powe.patch b/patches/kernel/0013-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Powe.patch new file mode 100644 index 0000000..6f92403 --- /dev/null +++ b/patches/kernel/0013-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Powe.patch @@ -0,0 +1,146 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Fri, 27 Oct 2023 16:40:47 -0400 +Subject: [PATCH] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay + headers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +For pptable structs that use flexible array sizes, use flexible arrays. + +Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 +Reviewed-by: Mario Limonciello +Acked-by: Christian König +Signed-off-by: Alex Deucher +(cherry-picked from commit 49afe91370b86566857a3c2c39612cf098110885) +Signed-off-by: Fiona Ebner +--- + .../drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h | 4 ++-- + .../amd/pm/powerplay/hwmgr/vega10_pptable.h | 24 +++++++++---------- + 2 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h +index e0e40b054c08..5ec564dbf339 100644 +--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h ++++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h +@@ -367,7 +367,7 @@ typedef struct _ATOM_Tonga_VCE_State_Record { + typedef struct _ATOM_Tonga_VCE_State_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; +- ATOM_Tonga_VCE_State_Record entries[1]; ++ ATOM_Tonga_VCE_State_Record entries[]; + } ATOM_Tonga_VCE_State_Table; + + typedef struct _ATOM_Tonga_PowerTune_Table { +@@ -482,7 +482,7 @@ typedef struct _ATOM_Tonga_Hard_Limit_Record { + typedef struct _ATOM_Tonga_Hard_Limit_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; +- ATOM_Tonga_Hard_Limit_Record entries[1]; ++ ATOM_Tonga_Hard_Limit_Record entries[]; + } ATOM_Tonga_Hard_Limit_Table; + + typedef struct _ATOM_Tonga_GPIO_Table { +diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h +index 9c479bd9a786..a372abcd01be 100644 +--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h ++++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h +@@ -129,7 +129,7 @@ typedef struct _ATOM_Vega10_State { + typedef struct _ATOM_Vega10_State_Array { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries. */ +- ATOM_Vega10_State states[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_State states[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_State_Array; + + typedef struct _ATOM_Vega10_CLK_Dependency_Record { +@@ -169,37 +169,37 @@ typedef struct _ATOM_Vega10_GFXCLK_Dependency_Table { + typedef struct _ATOM_Vega10_MCLK_Dependency_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries. */ +- ATOM_Vega10_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_MCLK_Dependency_Table; + + typedef struct _ATOM_Vega10_SOCCLK_Dependency_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries. */ +- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_SOCCLK_Dependency_Table; + + typedef struct _ATOM_Vega10_DCEFCLK_Dependency_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries. */ +- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_DCEFCLK_Dependency_Table; + + typedef struct _ATOM_Vega10_PIXCLK_Dependency_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries. */ +- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_PIXCLK_Dependency_Table; + + typedef struct _ATOM_Vega10_DISPCLK_Dependency_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries.*/ +- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_DISPCLK_Dependency_Table; + + typedef struct _ATOM_Vega10_PHYCLK_Dependency_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries. */ +- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_PHYCLK_Dependency_Table; + + typedef struct _ATOM_Vega10_MM_Dependency_Record { +@@ -213,7 +213,7 @@ typedef struct _ATOM_Vega10_MM_Dependency_Record { + typedef struct _ATOM_Vega10_MM_Dependency_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries */ +- ATOM_Vega10_MM_Dependency_Record entries[1]; /* Dynamically allocate entries */ ++ ATOM_Vega10_MM_Dependency_Record entries[]; /* Dynamically allocate entries */ + } ATOM_Vega10_MM_Dependency_Table; + + typedef struct _ATOM_Vega10_PCIE_Record { +@@ -225,7 +225,7 @@ typedef struct _ATOM_Vega10_PCIE_Record { + typedef struct _ATOM_Vega10_PCIE_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries */ +- ATOM_Vega10_PCIE_Record entries[1]; /* Dynamically allocate entries. */ ++ ATOM_Vega10_PCIE_Record entries[]; /* Dynamically allocate entries. */ + } ATOM_Vega10_PCIE_Table; + + typedef struct _ATOM_Vega10_Voltage_Lookup_Record { +@@ -235,7 +235,7 @@ typedef struct _ATOM_Vega10_Voltage_Lookup_Record { + typedef struct _ATOM_Vega10_Voltage_Lookup_Table { + UCHAR ucRevId; + UCHAR ucNumEntries; /* Number of entries */ +- ATOM_Vega10_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries */ ++ ATOM_Vega10_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries */ + } ATOM_Vega10_Voltage_Lookup_Table; + + typedef struct _ATOM_Vega10_Fan_Table { +@@ -329,7 +329,7 @@ typedef struct _ATOM_Vega10_VCE_State_Table + { + UCHAR ucRevId; + UCHAR ucNumEntries; +- ATOM_Vega10_VCE_State_Record entries[1]; ++ ATOM_Vega10_VCE_State_Record entries[]; + } ATOM_Vega10_VCE_State_Table; + + typedef struct _ATOM_Vega10_PowerTune_Table { +@@ -432,7 +432,7 @@ typedef struct _ATOM_Vega10_Hard_Limit_Table + { + UCHAR ucRevId; + UCHAR ucNumEntries; +- ATOM_Vega10_Hard_Limit_Record entries[1]; ++ ATOM_Vega10_Hard_Limit_Record entries[]; + } ATOM_Vega10_Hard_Limit_Table; + + typedef struct _Vega10_PPTable_Generic_SubTable_Header diff --git a/patches/kernel/0014-Revert-scsi-aacraid-Reply-queue-mapping-to-CPUs-base.patch b/patches/kernel/0014-Revert-scsi-aacraid-Reply-queue-mapping-to-CPUs-base.patch new file mode 100644 index 0000000..16cf427 --- /dev/null +++ b/patches/kernel/0014-Revert-scsi-aacraid-Reply-queue-mapping-to-CPUs-base.patch @@ -0,0 +1,148 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Fri, 8 Dec 2023 12:09:38 -0500 +Subject: [PATCH] Revert "scsi: aacraid: Reply queue mapping to CPUs based on + IRQ affinity" + +This reverts commit 9dc704dcc09eae7d21b5da0615eb2ed79278f63e. + +Several reports have been made indicating that this commit caused +hangs. Numerous attempts at root causing and fixing the issue have +been unsuccessful so let's revert for now. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=217599 +Cc: +Signed-off-by: Martin K. Petersen +--- + drivers/scsi/aacraid/aacraid.h | 1 - + drivers/scsi/aacraid/commsup.c | 6 +----- + drivers/scsi/aacraid/linit.c | 14 -------------- + drivers/scsi/aacraid/src.c | 25 ++----------------------- + 4 files changed, 3 insertions(+), 43 deletions(-) + +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h +index 73b6ac0c01f5..7d5a155073c6 100644 +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -1678,7 +1678,6 @@ struct aac_dev + u32 handle_pci_error; + bool init_reset; + u8 soft_reset_support; +- u8 use_map_queue; + }; + + #define aac_adapter_interrupt(dev) \ +diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c +index 013a9a334972..25cee03d7f97 100644 +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -223,12 +223,8 @@ int aac_fib_setup(struct aac_dev * dev) + struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd) + { + struct fib *fibptr; +- u32 blk_tag; +- int i; + +- blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); +- i = blk_mq_unique_tag_to_tag(blk_tag); +- fibptr = &dev->fibs[i]; ++ fibptr = &dev->fibs[scsi_cmd_to_rq(scmd)->tag]; + /* + * Null out fields that depend on being zero at the start of + * each I/O +diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c +index c4a36c0be527..68f4dbcfff49 100644 +--- a/drivers/scsi/aacraid/linit.c ++++ b/drivers/scsi/aacraid/linit.c +@@ -19,7 +19,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -505,15 +504,6 @@ static int aac_slave_configure(struct scsi_device *sdev) + return 0; + } + +-static void aac_map_queues(struct Scsi_Host *shost) +-{ +- struct aac_dev *aac = (struct aac_dev *)shost->hostdata; +- +- blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT], +- aac->pdev, 0); +- aac->use_map_queue = true; +-} +- + /** + * aac_change_queue_depth - alter queue depths + * @sdev: SCSI device we are considering +@@ -1498,7 +1488,6 @@ static const struct scsi_host_template aac_driver_template = { + .bios_param = aac_biosparm, + .shost_groups = aac_host_groups, + .slave_configure = aac_slave_configure, +- .map_queues = aac_map_queues, + .change_queue_depth = aac_change_queue_depth, + .sdev_groups = aac_dev_groups, + .eh_abort_handler = aac_eh_abort, +@@ -1786,8 +1775,6 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) + shost->max_lun = AAC_MAX_LUN; + + pci_set_drvdata(pdev, shost); +- shost->nr_hw_queues = aac->max_msix; +- shost->host_tagset = 1; + + error = scsi_add_host(shost, &pdev->dev); + if (error) +@@ -1919,7 +1906,6 @@ static void aac_remove_one(struct pci_dev *pdev) + struct aac_dev *aac = (struct aac_dev *)shost->hostdata; + + aac_cancel_rescan_worker(aac); +- aac->use_map_queue = false; + scsi_remove_host(shost); + + __aac_shutdown(aac); +diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c +index 61949f374188..11ef58204e96 100644 +--- a/drivers/scsi/aacraid/src.c ++++ b/drivers/scsi/aacraid/src.c +@@ -493,10 +493,6 @@ static int aac_src_deliver_message(struct fib *fib) + #endif + + u16 vector_no; +- struct scsi_cmnd *scmd; +- u32 blk_tag; +- struct Scsi_Host *shost = dev->scsi_host_ptr; +- struct blk_mq_queue_map *qmap; + + atomic_inc(&q->numpending); + +@@ -509,25 +505,8 @@ static int aac_src_deliver_message(struct fib *fib) + if ((dev->comm_interface == AAC_COMM_MESSAGE_TYPE3) + && dev->sa_firmware) + vector_no = aac_get_vector(dev); +- else { +- if (!fib->vector_no || !fib->callback_data) { +- if (shost && dev->use_map_queue) { +- qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT]; +- vector_no = qmap->mq_map[raw_smp_processor_id()]; +- } +- /* +- * We hardcode the vector_no for +- * reserved commands as a valid shost is +- * absent during the init +- */ +- else +- vector_no = 0; +- } else { +- scmd = (struct scsi_cmnd *)fib->callback_data; +- blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); +- vector_no = blk_mq_unique_tag_to_hwq(blk_tag); +- } +- } ++ else ++ vector_no = fib->vector_no; + + if (native_hba) { + if (fib->flags & FIB_CONTEXT_FLAG_NATIVE_HBA_TMF) { diff --git a/patches/kernel/0014-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-SMU7.patch b/patches/kernel/0014-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-SMU7.patch deleted file mode 100644 index e419466..0000000 --- a/patches/kernel/0014-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-SMU7.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Wed, 4 Oct 2023 15:22:52 -0500 -Subject: [PATCH] drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 - -For pptable structs that use flexible array sizes, use flexible arrays. - -Suggested-by: Felix Held -Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2874 -Signed-off-by: Mario Limonciello -Acked-by: Alex Deucher -Signed-off-by: Alex Deucher -(cherry-picked from commit 760efbca74a405dc439a013a5efaa9fadc95a8c3) -Signed-off-by: Fiona Ebner ---- - drivers/gpu/drm/amd/include/pptable.h | 4 ++-- - drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/amd/include/pptable.h b/drivers/gpu/drm/amd/include/pptable.h -index 0b6a057e0a4c..5aac8d545bdc 100644 ---- a/drivers/gpu/drm/amd/include/pptable.h -+++ b/drivers/gpu/drm/amd/include/pptable.h -@@ -78,7 +78,7 @@ typedef struct _ATOM_PPLIB_THERMALCONTROLLER - typedef struct _ATOM_PPLIB_STATE - { - UCHAR ucNonClockStateIndex; -- UCHAR ucClockStateIndices[1]; // variable-sized -+ UCHAR ucClockStateIndices[]; // variable-sized - } ATOM_PPLIB_STATE; - - -@@ -473,7 +473,7 @@ typedef struct _ATOM_PPLIB_STATE_V2 - /** - * Driver will read the first ucNumDPMLevels in this array - */ -- UCHAR clockInfoIndex[1]; -+ UCHAR clockInfoIndex[]; - } ATOM_PPLIB_STATE_V2; - - typedef struct _StateArray{ -diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -index b0ac4d121adc..41444e27bfc0 100644 ---- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -@@ -179,7 +179,7 @@ typedef struct _ATOM_Tonga_MCLK_Dependency_Record { - typedef struct _ATOM_Tonga_MCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Tonga_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Tonga_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Tonga_MCLK_Dependency_Table; - - typedef struct _ATOM_Tonga_SCLK_Dependency_Record { -@@ -194,7 +194,7 @@ typedef struct _ATOM_Tonga_SCLK_Dependency_Record { - typedef struct _ATOM_Tonga_SCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Tonga_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Tonga_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Tonga_SCLK_Dependency_Table; - - typedef struct _ATOM_Polaris_SCLK_Dependency_Record { diff --git a/patches/kernel/0015-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Pola.patch b/patches/kernel/0015-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Pola.patch deleted file mode 100644 index dd82cd5..0000000 --- a/patches/kernel/0015-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Pola.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Wed, 4 Oct 2023 15:46:44 -0500 -Subject: [PATCH] drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and - Tonga - -For pptable structs that use flexible array sizes, use flexible arrays. - -Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2036742 -Signed-off-by: Mario Limonciello -Acked-by: Alex Deucher -Signed-off-by: Alex Deucher -(cherry-picked from commit 0f0e59075b5c22f1e871fbd508d6e4f495048356) -Signed-off-by: Fiona Ebner ---- - .../gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -index 41444e27bfc0..e0e40b054c08 100644 ---- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -@@ -164,7 +164,7 @@ typedef struct _ATOM_Tonga_State { - typedef struct _ATOM_Tonga_State_Array { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Tonga_State entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Tonga_State entries[]; /* Dynamically allocate entries. */ - } ATOM_Tonga_State_Array; - - typedef struct _ATOM_Tonga_MCLK_Dependency_Record { -@@ -210,7 +210,7 @@ typedef struct _ATOM_Polaris_SCLK_Dependency_Record { - typedef struct _ATOM_Polaris_SCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Polaris_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Polaris_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Polaris_SCLK_Dependency_Table; - - typedef struct _ATOM_Tonga_PCIE_Record { -@@ -222,7 +222,7 @@ typedef struct _ATOM_Tonga_PCIE_Record { - typedef struct _ATOM_Tonga_PCIE_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Tonga_PCIE_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Tonga_PCIE_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Tonga_PCIE_Table; - - typedef struct _ATOM_Polaris10_PCIE_Record { -@@ -235,7 +235,7 @@ typedef struct _ATOM_Polaris10_PCIE_Record { - typedef struct _ATOM_Polaris10_PCIE_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Polaris10_PCIE_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Polaris10_PCIE_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Polaris10_PCIE_Table; - - -@@ -252,7 +252,7 @@ typedef struct _ATOM_Tonga_MM_Dependency_Record { - typedef struct _ATOM_Tonga_MM_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Tonga_MM_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Tonga_MM_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Tonga_MM_Dependency_Table; - - typedef struct _ATOM_Tonga_Voltage_Lookup_Record { -@@ -265,7 +265,7 @@ typedef struct _ATOM_Tonga_Voltage_Lookup_Record { - typedef struct _ATOM_Tonga_Voltage_Lookup_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Tonga_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Tonga_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Tonga_Voltage_Lookup_Table; - - typedef struct _ATOM_Tonga_Fan_Table { diff --git a/patches/kernel/0015-ext4-fallback-to-complex-scan-if-aligned-scan-doesn-.patch b/patches/kernel/0015-ext4-fallback-to-complex-scan-if-aligned-scan-doesn-.patch new file mode 100644 index 0000000..49edbb2 --- /dev/null +++ b/patches/kernel/0015-ext4-fallback-to-complex-scan-if-aligned-scan-doesn-.patch @@ -0,0 +1,56 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ojaswin Mujoo +Date: Fri, 15 Dec 2023 16:49:50 +0530 +Subject: [PATCH] ext4: fallback to complex scan if aligned scan doesn't work + +Currently in case the goal length is a multiple of stripe size we use +ext4_mb_scan_aligned() to find the stripe size aligned physical blocks. +In case we are not able to find any, we again go back to calling +ext4_mb_choose_next_group() to search for a different suitable block +group. However, since the linear search always begins from the start, +most of the times we end up with the same BG and the cycle continues. + +With large fliesystems, the CPU can be stuck in this loop for hours +which can slow down the whole system. Hence, until we figure out a +better way to continue the search (rather than starting from beginning) +in ext4_mb_choose_next_group(), lets just fallback to +ext4_mb_complex_scan_group() in case aligned scan fails, as it is much +more likely to find the needed blocks. + +Signed-off-by: Ojaswin Mujoo +--- + fs/ext4/mballoc.c | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c +index 3711be697a0a..0c81836f092e 100644 +--- a/fs/ext4/mballoc.c ++++ b/fs/ext4/mballoc.c +@@ -2894,14 +2894,19 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac) + ac->ac_groups_scanned++; + if (cr == CR_POWER2_ALIGNED) + ext4_mb_simple_scan_group(ac, &e4b); +- else if ((cr == CR_GOAL_LEN_FAST || +- cr == CR_BEST_AVAIL_LEN) && +- sbi->s_stripe && +- !(ac->ac_g_ex.fe_len % +- EXT4_B2C(sbi, sbi->s_stripe))) +- ext4_mb_scan_aligned(ac, &e4b); +- else +- ext4_mb_complex_scan_group(ac, &e4b); ++ else { ++ bool is_stripe_aligned = sbi->s_stripe && ++ !(ac->ac_g_ex.fe_len % ++ EXT4_B2C(sbi, sbi->s_stripe)); ++ ++ if ((cr == CR_GOAL_LEN_FAST || ++ cr == CR_BEST_AVAIL_LEN) && ++ is_stripe_aligned) ++ ext4_mb_scan_aligned(ac, &e4b); ++ ++ if (ac->ac_status == AC_STATUS_CONTINUE) ++ ext4_mb_complex_scan_group(ac, &e4b); ++ } + + ext4_unlock_group(sb, group); + ext4_mb_unload_buddy(&e4b); diff --git a/patches/kernel/0016-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Powe.patch b/patches/kernel/0016-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Powe.patch deleted file mode 100644 index 6f92403..0000000 --- a/patches/kernel/0016-drm-amd-Fix-UBSAN-array-index-out-of-bounds-for-Powe.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Fri, 27 Oct 2023 16:40:47 -0400 -Subject: [PATCH] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay - headers -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -For pptable structs that use flexible array sizes, use flexible arrays. - -Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 -Reviewed-by: Mario Limonciello -Acked-by: Christian König -Signed-off-by: Alex Deucher -(cherry-picked from commit 49afe91370b86566857a3c2c39612cf098110885) -Signed-off-by: Fiona Ebner ---- - .../drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h | 4 ++-- - .../amd/pm/powerplay/hwmgr/vega10_pptable.h | 24 +++++++++---------- - 2 files changed, 14 insertions(+), 14 deletions(-) - -diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -index e0e40b054c08..5ec564dbf339 100644 ---- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h -@@ -367,7 +367,7 @@ typedef struct _ATOM_Tonga_VCE_State_Record { - typedef struct _ATOM_Tonga_VCE_State_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; -- ATOM_Tonga_VCE_State_Record entries[1]; -+ ATOM_Tonga_VCE_State_Record entries[]; - } ATOM_Tonga_VCE_State_Table; - - typedef struct _ATOM_Tonga_PowerTune_Table { -@@ -482,7 +482,7 @@ typedef struct _ATOM_Tonga_Hard_Limit_Record { - typedef struct _ATOM_Tonga_Hard_Limit_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; -- ATOM_Tonga_Hard_Limit_Record entries[1]; -+ ATOM_Tonga_Hard_Limit_Record entries[]; - } ATOM_Tonga_Hard_Limit_Table; - - typedef struct _ATOM_Tonga_GPIO_Table { -diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h -index 9c479bd9a786..a372abcd01be 100644 ---- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h -+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h -@@ -129,7 +129,7 @@ typedef struct _ATOM_Vega10_State { - typedef struct _ATOM_Vega10_State_Array { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Vega10_State states[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_State states[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_State_Array; - - typedef struct _ATOM_Vega10_CLK_Dependency_Record { -@@ -169,37 +169,37 @@ typedef struct _ATOM_Vega10_GFXCLK_Dependency_Table { - typedef struct _ATOM_Vega10_MCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Vega10_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_MCLK_Dependency_Table; - - typedef struct _ATOM_Vega10_SOCCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_SOCCLK_Dependency_Table; - - typedef struct _ATOM_Vega10_DCEFCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_DCEFCLK_Dependency_Table; - - typedef struct _ATOM_Vega10_PIXCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_PIXCLK_Dependency_Table; - - typedef struct _ATOM_Vega10_DISPCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries.*/ -- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_DISPCLK_Dependency_Table; - - typedef struct _ATOM_Vega10_PHYCLK_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries. */ -- ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_PHYCLK_Dependency_Table; - - typedef struct _ATOM_Vega10_MM_Dependency_Record { -@@ -213,7 +213,7 @@ typedef struct _ATOM_Vega10_MM_Dependency_Record { - typedef struct _ATOM_Vega10_MM_Dependency_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries */ -- ATOM_Vega10_MM_Dependency_Record entries[1]; /* Dynamically allocate entries */ -+ ATOM_Vega10_MM_Dependency_Record entries[]; /* Dynamically allocate entries */ - } ATOM_Vega10_MM_Dependency_Table; - - typedef struct _ATOM_Vega10_PCIE_Record { -@@ -225,7 +225,7 @@ typedef struct _ATOM_Vega10_PCIE_Record { - typedef struct _ATOM_Vega10_PCIE_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries */ -- ATOM_Vega10_PCIE_Record entries[1]; /* Dynamically allocate entries. */ -+ ATOM_Vega10_PCIE_Record entries[]; /* Dynamically allocate entries. */ - } ATOM_Vega10_PCIE_Table; - - typedef struct _ATOM_Vega10_Voltage_Lookup_Record { -@@ -235,7 +235,7 @@ typedef struct _ATOM_Vega10_Voltage_Lookup_Record { - typedef struct _ATOM_Vega10_Voltage_Lookup_Table { - UCHAR ucRevId; - UCHAR ucNumEntries; /* Number of entries */ -- ATOM_Vega10_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries */ -+ ATOM_Vega10_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries */ - } ATOM_Vega10_Voltage_Lookup_Table; - - typedef struct _ATOM_Vega10_Fan_Table { -@@ -329,7 +329,7 @@ typedef struct _ATOM_Vega10_VCE_State_Table - { - UCHAR ucRevId; - UCHAR ucNumEntries; -- ATOM_Vega10_VCE_State_Record entries[1]; -+ ATOM_Vega10_VCE_State_Record entries[]; - } ATOM_Vega10_VCE_State_Table; - - typedef struct _ATOM_Vega10_PowerTune_Table { -@@ -432,7 +432,7 @@ typedef struct _ATOM_Vega10_Hard_Limit_Table - { - UCHAR ucRevId; - UCHAR ucNumEntries; -- ATOM_Vega10_Hard_Limit_Record entries[1]; -+ ATOM_Vega10_Hard_Limit_Record entries[]; - } ATOM_Vega10_Hard_Limit_Table; - - typedef struct _Vega10_PPTable_Generic_SubTable_Header diff --git a/patches/kernel/0017-KVM-x86-Fix-lapic-timer-interrupt-lost-after-loading.patch b/patches/kernel/0017-KVM-x86-Fix-lapic-timer-interrupt-lost-after-loading.patch deleted file mode 100644 index ea8bff6..0000000 --- a/patches/kernel/0017-KVM-x86-Fix-lapic-timer-interrupt-lost-after-loading.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman -Date: Fri, 24 Nov 2023 17:48:01 +0000 -Subject: [PATCH] KVM: x86: Fix lapic timer interrupt lost after loading a - snapshot. - -commit 9cfec6d097c607e36199cf0cfbb8cf5acbd8e9b2 upstream. - -When running android emulator (which is based on QEMU 2.12) on -certain Intel hosts with kernel version 6.3-rc1 or above, guest -will freeze after loading a snapshot. This is almost 100% -reproducible. By default, the android emulator will use snapshot -to speed up the next launching of the same android guest. So -this breaks the android emulator badly. - -I tested QEMU 8.0.4 from Debian 12 with an Ubuntu 22.04 guest by -running command "loadvm" after "savevm". The same issue is -observed. At the same time, none of our AMD platforms is impacted. -More experiments show that loading the KVM module with -"enable_apicv=false" can workaround it. - -The issue started to show up after commit 8e6ed96cdd50 ("KVM: x86: -fire timer when it is migrated and expired, and in oneshot mode"). -However, as is pointed out by Sean Christopherson, it is introduced -by commit 967235d32032 ("KVM: vmx: clear pending interrupts on -KVM_SET_LAPIC"). commit 8e6ed96cdd50 ("KVM: x86: fire timer when -it is migrated and expired, and in oneshot mode") just makes it -easier to hit the issue. - -Having both commits, the oneshot lapic timer gets fired immediately -inside the KVM_SET_LAPIC call when loading the snapshot. On Intel -platforms with APIC virtualization and posted interrupt processing, -this eventually leads to setting the corresponding PIR bit. However, -the whole PIR bits get cleared later in the same KVM_SET_LAPIC call -by apicv_post_state_restore. This leads to timer interrupt lost. - -The fix is to move vmx_apicv_post_state_restore to the beginning of -the KVM_SET_LAPIC call and rename to vmx_apicv_pre_state_restore. -What vmx_apicv_post_state_restore does is actually clearing any -former apicv state and this behavior is more suitable to carry out -in the beginning. - -Fixes: 967235d32032 ("KVM: vmx: clear pending interrupts on KVM_SET_LAPIC") -Cc: stable@vger.kernel.org -Suggested-by: Sean Christopherson -Signed-off-by: Haitao Shan -Link: https://lore.kernel.org/r/20230913000215.478387-1-hshan@google.com -Signed-off-by: Sean Christopherson -Signed-off-by: Greg Kroah-Hartman -(picked from https://lore.kernel.org/stable/20231124172031.920738810@linuxfoundation.org/) -Signed-off-by: Fiona Ebner ---- - arch/x86/include/asm/kvm-x86-ops.h | 1 + - arch/x86/include/asm/kvm_host.h | 1 + - arch/x86/kvm/lapic.c | 4 ++++ - arch/x86/kvm/vmx/vmx.c | 4 ++-- - 4 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/arch/x86/include/asm/kvm-x86-ops.h b/arch/x86/include/asm/kvm-x86-ops.h -index e3054e3e46d52..9b419f0de713c 100644 ---- a/arch/x86/include/asm/kvm-x86-ops.h -+++ b/arch/x86/include/asm/kvm-x86-ops.h -@@ -108,6 +108,7 @@ KVM_X86_OP_OPTIONAL(vcpu_blocking) - KVM_X86_OP_OPTIONAL(vcpu_unblocking) - KVM_X86_OP_OPTIONAL(pi_update_irte) - KVM_X86_OP_OPTIONAL(pi_start_assignment) -+KVM_X86_OP_OPTIONAL(apicv_pre_state_restore) - KVM_X86_OP_OPTIONAL(apicv_post_state_restore) - KVM_X86_OP_OPTIONAL_RET0(dy_apicv_has_pending_interrupt) - KVM_X86_OP_OPTIONAL(set_hv_timer) -diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h -index f72b30d2238a6..9bdbb1cc03d38 100644 ---- a/arch/x86/include/asm/kvm_host.h -+++ b/arch/x86/include/asm/kvm_host.h -@@ -1690,6 +1690,7 @@ struct kvm_x86_ops { - int (*pi_update_irte)(struct kvm *kvm, unsigned int host_irq, - uint32_t guest_irq, bool set); - void (*pi_start_assignment)(struct kvm *kvm); -+ void (*apicv_pre_state_restore)(struct kvm_vcpu *vcpu); - void (*apicv_post_state_restore)(struct kvm_vcpu *vcpu); - bool (*dy_apicv_has_pending_interrupt)(struct kvm_vcpu *vcpu); - -diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c -index e74e223f46aa3..a3d488608b85d 100644 ---- a/arch/x86/kvm/lapic.c -+++ b/arch/x86/kvm/lapic.c -@@ -2649,6 +2649,8 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) - u64 msr_val; - int i; - -+ static_call_cond(kvm_x86_apicv_pre_state_restore)(vcpu); -+ - if (!init_event) { - msr_val = APIC_DEFAULT_PHYS_BASE | MSR_IA32_APICBASE_ENABLE; - if (kvm_vcpu_is_reset_bsp(vcpu)) -@@ -2960,6 +2962,8 @@ int kvm_apic_set_state(struct kvm_vcpu *vcpu, struct kvm_lapic_state *s) - struct kvm_lapic *apic = vcpu->arch.apic; - int r; - -+ static_call_cond(kvm_x86_apicv_pre_state_restore)(vcpu); -+ - kvm_lapic_set_base(vcpu, vcpu->arch.apic_base); - /* set SPIV separately to get count of SW disabled APICs right */ - apic_set_spiv(apic, *((u32 *)(s->regs + APIC_SPIV))); -diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c -index bc6f0fea48b43..52af279f793db 100644 ---- a/arch/x86/kvm/vmx/vmx.c -+++ b/arch/x86/kvm/vmx/vmx.c -@@ -6909,7 +6909,7 @@ static void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) - vmcs_write64(EOI_EXIT_BITMAP3, eoi_exit_bitmap[3]); - } - --static void vmx_apicv_post_state_restore(struct kvm_vcpu *vcpu) -+static void vmx_apicv_pre_state_restore(struct kvm_vcpu *vcpu) - { - struct vcpu_vmx *vmx = to_vmx(vcpu); - -@@ -8275,7 +8275,7 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = { - .set_apic_access_page_addr = vmx_set_apic_access_page_addr, - .refresh_apicv_exec_ctrl = vmx_refresh_apicv_exec_ctrl, - .load_eoi_exitmap = vmx_load_eoi_exitmap, -- .apicv_post_state_restore = vmx_apicv_post_state_restore, -+ .apicv_pre_state_restore = vmx_apicv_pre_state_restore, - .required_apicv_inhibits = VMX_REQUIRED_APICV_INHIBITS, - .hwapic_irr_update = vmx_hwapic_irr_update, - .hwapic_isr_update = vmx_hwapic_isr_update, diff --git a/patches/kernel/0018-fix-5077-aacraid-resets.patch b/patches/kernel/0018-fix-5077-aacraid-resets.patch deleted file mode 100644 index 1b8380d..0000000 --- a/patches/kernel/0018-fix-5077-aacraid-resets.patch +++ /dev/null @@ -1,151 +0,0 @@ -From c5becf57dd5659c687d41d623a69f42d63f59eb2 Mon Sep 17 00:00:00 2001 -From: "Martin K. Petersen" -Date: Fri, 8 Dec 2023 12:09:38 -0500 -Subject: Revert "scsi: aacraid: Reply queue mapping to CPUs based on IRQ - affinity" - -This reverts commit 9dc704dcc09eae7d21b5da0615eb2ed79278f63e. - -Several reports have been made indicating that this commit caused -hangs. Numerous attempts at root causing and fixing the issue have -been unsuccessful so let's revert for now. - -Link: https://bugzilla.kernel.org/show_bug.cgi?id=217599 -Cc: -Signed-off-by: Martin K. Petersen ---- - drivers/scsi/aacraid/aacraid.h | 1 - - drivers/scsi/aacraid/commsup.c | 6 +----- - drivers/scsi/aacraid/linit.c | 14 -------------- - drivers/scsi/aacraid/src.c | 25 ++----------------------- - 4 files changed, 3 insertions(+), 43 deletions(-) - -diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h -index 73b6ac0c01f54..7d5a155073c62 100644 ---- a/drivers/scsi/aacraid/aacraid.h -+++ b/drivers/scsi/aacraid/aacraid.h -@@ -1678,7 +1678,6 @@ struct aac_dev - u32 handle_pci_error; - bool init_reset; - u8 soft_reset_support; -- u8 use_map_queue; - }; - - #define aac_adapter_interrupt(dev) \ -diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c -index 013a9a334972e..25cee03d7f973 100644 ---- a/drivers/scsi/aacraid/commsup.c -+++ b/drivers/scsi/aacraid/commsup.c -@@ -223,12 +223,8 @@ int aac_fib_setup(struct aac_dev * dev) - struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd) - { - struct fib *fibptr; -- u32 blk_tag; -- int i; - -- blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); -- i = blk_mq_unique_tag_to_tag(blk_tag); -- fibptr = &dev->fibs[i]; -+ fibptr = &dev->fibs[scsi_cmd_to_rq(scmd)->tag]; - /* - * Null out fields that depend on being zero at the start of - * each I/O -diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c -index c4a36c0be527c..68f4dbcfff492 100644 ---- a/drivers/scsi/aacraid/linit.c -+++ b/drivers/scsi/aacraid/linit.c -@@ -19,7 +19,6 @@ - - #include - #include --#include - #include - #include - #include -@@ -505,15 +504,6 @@ common_config: - return 0; - } - --static void aac_map_queues(struct Scsi_Host *shost) --{ -- struct aac_dev *aac = (struct aac_dev *)shost->hostdata; -- -- blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT], -- aac->pdev, 0); -- aac->use_map_queue = true; --} -- - /** - * aac_change_queue_depth - alter queue depths - * @sdev: SCSI device we are considering -@@ -1498,7 +1488,6 @@ static const struct scsi_host_template aac_driver_template = { - .bios_param = aac_biosparm, - .shost_groups = aac_host_groups, - .slave_configure = aac_slave_configure, -- .map_queues = aac_map_queues, - .change_queue_depth = aac_change_queue_depth, - .sdev_groups = aac_dev_groups, - .eh_abort_handler = aac_eh_abort, -@@ -1786,8 +1775,6 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) - shost->max_lun = AAC_MAX_LUN; - - pci_set_drvdata(pdev, shost); -- shost->nr_hw_queues = aac->max_msix; -- shost->host_tagset = 1; - - error = scsi_add_host(shost, &pdev->dev); - if (error) -@@ -1919,7 +1906,6 @@ static void aac_remove_one(struct pci_dev *pdev) - struct aac_dev *aac = (struct aac_dev *)shost->hostdata; - - aac_cancel_rescan_worker(aac); -- aac->use_map_queue = false; - scsi_remove_host(shost); - - __aac_shutdown(aac); -diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c -index 61949f3741886..11ef58204e96f 100644 ---- a/drivers/scsi/aacraid/src.c -+++ b/drivers/scsi/aacraid/src.c -@@ -493,10 +493,6 @@ static int aac_src_deliver_message(struct fib *fib) - #endif - - u16 vector_no; -- struct scsi_cmnd *scmd; -- u32 blk_tag; -- struct Scsi_Host *shost = dev->scsi_host_ptr; -- struct blk_mq_queue_map *qmap; - - atomic_inc(&q->numpending); - -@@ -509,25 +505,8 @@ static int aac_src_deliver_message(struct fib *fib) - if ((dev->comm_interface == AAC_COMM_MESSAGE_TYPE3) - && dev->sa_firmware) - vector_no = aac_get_vector(dev); -- else { -- if (!fib->vector_no || !fib->callback_data) { -- if (shost && dev->use_map_queue) { -- qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT]; -- vector_no = qmap->mq_map[raw_smp_processor_id()]; -- } -- /* -- * We hardcode the vector_no for -- * reserved commands as a valid shost is -- * absent during the init -- */ -- else -- vector_no = 0; -- } else { -- scmd = (struct scsi_cmnd *)fib->callback_data; -- blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); -- vector_no = blk_mq_unique_tag_to_hwq(blk_tag); -- } -- } -+ else -+ vector_no = fib->vector_no; - - if (native_hba) { - if (fib->flags & FIB_CONTEXT_FLAG_NATIVE_HBA_TMF) { --- -cgit 1.2.3-korg - diff --git a/patches/kernel/0019-fix-5158-ext4-fallback-complex-scan.patch b/patches/kernel/0019-fix-5158-ext4-fallback-complex-scan.patch deleted file mode 100644 index 349e9e7..0000000 --- a/patches/kernel/0019-fix-5158-ext4-fallback-complex-scan.patch +++ /dev/null @@ -1,66 +0,0 @@ -From: Ojaswin Mujoo -To: linux-ext4@vger.kernel.org, "Theodore Ts'o" -Cc: Ritesh Harjani , linux-kernel@vger.kernel.org, - Jan Kara , glandvador@yahoo.com, bugzilla@eyal.emu.id.au -Subject: [PATCH 1/1] ext4: fallback to complex scan if aligned scan doesn't work -Date: Fri, 15 Dec 2023 16:49:50 +0530 -Message-Id: -X-Mailer: git-send-email 2.39.3 -In-Reply-To: -References: - -Currently in case the goal length is a multiple of stripe size we use -ext4_mb_scan_aligned() to find the stripe size aligned physical blocks. -In case we are not able to find any, we again go back to calling -ext4_mb_choose_next_group() to search for a different suitable block -group. However, since the linear search always begins from the start, -most of the times we end up with the same BG and the cycle continues. - -With large fliesystems, the CPU can be stuck in this loop for hours -which can slow down the whole system. Hence, until we figure out a -better way to continue the search (rather than starting from beginning) -in ext4_mb_choose_next_group(), lets just fallback to -ext4_mb_complex_scan_group() in case aligned scan fails, as it is much -more likely to find the needed blocks. - -Signed-off-by: Ojaswin Mujoo ---- - fs/ext4/mballoc.c | 21 +++++++++++++-------- - 1 file changed, 13 insertions(+), 8 deletions(-) - -diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c -index d72b5e3c92ec..63f12ec02485 100644 ---- a/fs/ext4/mballoc.c -+++ b/fs/ext4/mballoc.c -@@ -2895,14 +2895,19 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac) - ac->ac_groups_scanned++; - if (cr == CR_POWER2_ALIGNED) - ext4_mb_simple_scan_group(ac, &e4b); -- else if ((cr == CR_GOAL_LEN_FAST || -- cr == CR_BEST_AVAIL_LEN) && -- sbi->s_stripe && -- !(ac->ac_g_ex.fe_len % -- EXT4_B2C(sbi, sbi->s_stripe))) -- ext4_mb_scan_aligned(ac, &e4b); -- else -- ext4_mb_complex_scan_group(ac, &e4b); -+ else { -+ bool is_stripe_aligned = sbi->s_stripe && -+ !(ac->ac_g_ex.fe_len % -+ EXT4_B2C(sbi, sbi->s_stripe)); -+ -+ if ((cr == CR_GOAL_LEN_FAST || -+ cr == CR_BEST_AVAIL_LEN) && -+ is_stripe_aligned) -+ ext4_mb_scan_aligned(ac, &e4b); -+ -+ if (ac->ac_status == AC_STATUS_CONTINUE) -+ ext4_mb_complex_scan_group(ac, &e4b); -+ } - - ext4_unlock_group(sb, group); - ext4_mb_unload_buddy(&e4b); --- -2.39.3 - - diff --git a/submodules/ubuntu-kernel b/submodules/ubuntu-kernel index 9f8b45f..50a8a45 160000 --- a/submodules/ubuntu-kernel +++ b/submodules/ubuntu-kernel @@ -1 +1 @@ -Subproject commit 9f8b45f5f8dbd6093b7ff71750bc6eb762fc8b20 +Subproject commit 50a8a45214a205eaa6d19370b1409ee1a7f82774