From b4b9acfbd344948559fb3241b39dfd68345a629d Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Tue, 2 May 2023 14:08:35 +0200 Subject: [PATCH] Apply GCP related changes --- SOURCES/0001-Apply-GCP-related-changes.patch | 98 ++++++++++++++++++++ SOURCES/kernel-aarch64-debug.config | 13 +-- SOURCES/kernel-aarch64.config | 13 +-- SPECS/kernel.spec | 8 +- 4 files changed, 119 insertions(+), 13 deletions(-) create mode 100644 SOURCES/0001-Apply-GCP-related-changes.patch diff --git a/SOURCES/0001-Apply-GCP-related-changes.patch b/SOURCES/0001-Apply-GCP-related-changes.patch new file mode 100644 index 000000000..38530a0b8 --- /dev/null +++ b/SOURCES/0001-Apply-GCP-related-changes.patch @@ -0,0 +1,98 @@ +From c0523819a6cdb726b3f56e0e51fcedb033401822 Mon Sep 17 00:00:00 2001 +From: Andrew Lukoshko +Date: Tue, 2 May 2023 13:39:22 +0200 +Subject: [PATCH] Apply GCP related changes + +--- + drivers/net/ethernet/google/Kconfig | 2 +- + drivers/net/ethernet/google/gve/gve_main.c | 6 ++---- + drivers/net/ethernet/google/gve/gve_rx.c | 4 +--- + drivers/net/ethernet/google/gve/gve_tx.c | 6 ------ + 4 files changed, 4 insertions(+), 14 deletions(-) + +diff --git a/drivers/net/ethernet/google/Kconfig b/drivers/net/ethernet/google/Kconfig +index 8641a00f8..b8f04d052 100644 +--- a/drivers/net/ethernet/google/Kconfig ++++ b/drivers/net/ethernet/google/Kconfig +@@ -17,7 +17,7 @@ if NET_VENDOR_GOOGLE + + config GVE + tristate "Google Virtual NIC (gVNIC) support" +- depends on (PCI_MSI && (X86 || CPU_LITTLE_ENDIAN)) ++ depends on PCI_MSI + help + This driver supports Google Virtual NIC (gVNIC)" + +diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c +index 54e51c822..6cafee55e 100644 +--- a/drivers/net/ethernet/google/gve/gve_main.c ++++ b/drivers/net/ethernet/google/gve/gve_main.c +@@ -857,8 +857,7 @@ static int gve_alloc_qpls(struct gve_priv *priv) + int i, j; + int err; + +- /* Raw addressing means no QPLs */ +- if (priv->queue_format == GVE_GQI_RDA_FORMAT) ++ if (num_qpls == 0) + return 0; + + priv->qpls = kvcalloc(num_qpls, sizeof(*priv->qpls), GFP_KERNEL); +@@ -901,8 +900,7 @@ static void gve_free_qpls(struct gve_priv *priv) + int num_qpls = gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv); + int i; + +- /* Raw addressing means no QPLs */ +- if (priv->queue_format == GVE_GQI_RDA_FORMAT) ++ if (num_qpls == 0) + return; + + kvfree(priv->qpl_cfg.qpl_id_map); +diff --git a/drivers/net/ethernet/google/gve/gve_rx.c b/drivers/net/ethernet/google/gve/gve_rx.c +index cf3fe5ad5..021bbf308 100644 +--- a/drivers/net/ethernet/google/gve/gve_rx.c ++++ b/drivers/net/ethernet/google/gve/gve_rx.c +@@ -439,7 +439,7 @@ static bool gve_rx_ctx_init(struct gve_rx_ctx *ctx, struct gve_rx_ring *rx) + if (frag_size > rx->packet_buffer_size) { + packet_size_error = true; + netdev_warn(priv->dev, +- "RX fragment error: packet_buffer_size=%d, frag_size=%d, droping packet.", ++ "RX fragment error: packet_buffer_size=%d, frag_size=%d, dropping packet.", + rx->packet_buffer_size, be16_to_cpu(desc->len)); + } + page_info = &rx->data.page_info[idx]; +@@ -766,8 +766,6 @@ static int gve_clean_rx_done(struct gve_rx_ring *rx, int budget, + } + } + +- /* restock desc ring slots */ +- dma_wmb(); /* Ensure descs are visible before ringing doorbell */ + gve_rx_write_doorbell(priv, rx); + return total_packet_cnt; + } +diff --git a/drivers/net/ethernet/google/gve/gve_tx.c b/drivers/net/ethernet/google/gve/gve_tx.c +index a75430117..4888bf05f 100644 +--- a/drivers/net/ethernet/google/gve/gve_tx.c ++++ b/drivers/net/ethernet/google/gve/gve_tx.c +@@ -621,10 +621,6 @@ netdev_tx_t gve_tx(struct sk_buff *skb, struct net_device *dev) + * may have added descriptors without ringing the doorbell. + */ + +- /* Ensure tx descs from a prior gve_tx are visible before +- * ringing doorbell. +- */ +- dma_wmb(); + gve_tx_put_doorbell(priv, tx->q_resources, tx->req); + return NETDEV_TX_BUSY; + } +@@ -645,8 +641,6 @@ netdev_tx_t gve_tx(struct sk_buff *skb, struct net_device *dev) + if (!netif_xmit_stopped(tx->netdev_txq) && netdev_xmit_more()) + return NETDEV_TX_OK; + +- /* Ensure tx descs are visible before ringing doorbell */ +- dma_wmb(); + /* Give packets to NIC. Even if this packet failed to send the doorbell + * might need to be rung because of xmit_more. + */ +-- +2.39.2 + diff --git a/SOURCES/kernel-aarch64-debug.config b/SOURCES/kernel-aarch64-debug.config index 05cb1aa4b..19c1356a3 100644 --- a/SOURCES/kernel-aarch64-debug.config +++ b/SOURCES/kernel-aarch64-debug.config @@ -133,9 +133,9 @@ # CONFIG_ARCH_ZYNQMP is not set # CONFIG_ARCNET is not set # CONFIG_ARM64_16K_PAGES is not set -# CONFIG_ARM64_4K_PAGES is not set +CONFIG_ARM64_4K_PAGES=y # CONFIG_ARM64_DEBUG_PRIORITY_MASKING is not set -# CONFIG_ARM64_PA_BITS_48 is not set +CONFIG_ARM64_PA_BITS_48=y # CONFIG_ARM64_PSEUDO_NMI is not set # CONFIG_ARM64_PTDUMP_DEBUGFS is not set # CONFIG_ARM64_PTR_AUTH is not set @@ -2495,7 +2495,7 @@ CONFIG_ARCH_THUNDER=y CONFIG_ARCH_VEXPRESS=y CONFIG_ARCH_XGENE=y CONFIG_ARM64=y -CONFIG_ARM64_64K_PAGES=y +# CONFIG_ARM64_64K_PAGES is not set CONFIG_ARM64_ACPI_PARKING_PROTOCOL=y CONFIG_ARM64_CNP=y CONFIG_ARM64_CRYPTO=y @@ -2513,13 +2513,14 @@ CONFIG_ARM64_ERRATUM_858921=y CONFIG_ARM64_HW_AFDBM=y CONFIG_ARM64_LSE_ATOMICS=y CONFIG_ARM64_PAN=y -CONFIG_ARM64_PA_BITS_52=y +# CONFIG_ARM64_PA_BITS_52 is not set CONFIG_ARM64_PMEM=y CONFIG_ARM64_RAS_EXTN=y CONFIG_ARM64_SVE=y CONFIG_ARM64_UAO=y -CONFIG_ARM64_USER_VA_BITS_52=y -CONFIG_ARM64_VA_BITS_48=y +# CONFIG_ARM64_USER_VA_BITS_52 is not set +# CONFIG_ARM64_VA_BITS_48 is not set +CONFIG_ARM64_VA_BITS_32=y CONFIG_ARM64_VHE=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y CONFIG_ARM_CCN=y diff --git a/SOURCES/kernel-aarch64.config b/SOURCES/kernel-aarch64.config index adffaa7a6..da7b2a929 100644 --- a/SOURCES/kernel-aarch64.config +++ b/SOURCES/kernel-aarch64.config @@ -139,8 +139,8 @@ # CONFIG_ARCH_ZYNQMP is not set # CONFIG_ARCNET is not set # CONFIG_ARM64_16K_PAGES is not set -# CONFIG_ARM64_4K_PAGES is not set -# CONFIG_ARM64_PA_BITS_48 is not set +CONFIG_ARM64_4K_PAGES=y +CONFIG_ARM64_PA_BITS_48=y # CONFIG_ARM64_PSEUDO_NMI is not set # CONFIG_ARM64_PTDUMP_DEBUGFS is not set # CONFIG_ARM64_PTR_AUTH is not set @@ -2566,7 +2566,7 @@ CONFIG_ARCH_THUNDER=y CONFIG_ARCH_VEXPRESS=y CONFIG_ARCH_XGENE=y CONFIG_ARM64=y -CONFIG_ARM64_64K_PAGES=y +# CONFIG_ARM64_64K_PAGES is not set CONFIG_ARM64_ACPI_PARKING_PROTOCOL=y CONFIG_ARM64_CNP=y CONFIG_ARM64_CRYPTO=y @@ -2584,13 +2584,14 @@ CONFIG_ARM64_ERRATUM_858921=y CONFIG_ARM64_HW_AFDBM=y CONFIG_ARM64_LSE_ATOMICS=y CONFIG_ARM64_PAN=y -CONFIG_ARM64_PA_BITS_52=y +# CONFIG_ARM64_PA_BITS_52 is not set CONFIG_ARM64_PMEM=y CONFIG_ARM64_RAS_EXTN=y CONFIG_ARM64_SVE=y CONFIG_ARM64_UAO=y -CONFIG_ARM64_USER_VA_BITS_52=y -CONFIG_ARM64_VA_BITS_48=y +# CONFIG_ARM64_USER_VA_BITS_52 is not set +# CONFIG_ARM64_VA_BITS_48 is not set +CONFIG_ARM64_VA_BITS_32=y CONFIG_ARM64_VHE=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y CONFIG_ARM_CCN=y diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec index e9273ead2..0f3431c11 100644 --- a/SPECS/kernel.spec +++ b/SPECS/kernel.spec @@ -329,7 +329,7 @@ Group: System Environment/Kernel License: GPLv2 and Redistributable, no modification permitted URL: http://www.kernel.org/ Version: %{rpmversion} -Release: %{pkg_release} +Release: %{pkg_release}.gcp Summary: The Linux kernel, based on version %{version}, heavily modified with backports %if %{with_realtime} ExclusiveArch: x86_64 @@ -525,6 +525,8 @@ Patch1000: debrand-single-cpu.patch # Patch1001: debrand-rh_taint.patch Patch1002: debrand-rh-i686-cpu.patch +Patch1003: 0001-Apply-GCP-related-changes.patch + # END OF PATCH DEFINITIONS BuildRoot: %{_tmppath}/%{name}-%{KVERREL}-root @@ -1082,6 +1084,7 @@ cd linux-%{KVERREL} ApplyOptionalPatch debrand-single-cpu.patch # ApplyOptionalPatch debrand-rh_taint.patch ApplyOptionalPatch debrand-rh-i686-cpu.patch +ApplyOptionalPatch 0001-Apply-GCP-related-changes.patch ApplyOptionalPatch linux-kernel-test.patch # END OF PATCH APPLICATIONS @@ -2672,6 +2675,9 @@ fi # # %changelog +* Tue May 02 2023 Andrew Lukoshko [4.18.0-425.19.2.el8_7.gf5e8.gcp] +- Apply GCP related changes + * Thu Mar 16 2023 Jarod Wilson [4.18.0-425.19.2.el8_7.gf5e8] - ovl: fail on invalid uid/gid mapping at copy up (Miklos Szeredi) [2165341 2165342] {CVE-2023-0386}