From patchwork Thu Nov 4 12:54:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1550894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=hkypQh4R; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HlNsb17xlz9sP7 for ; Thu, 4 Nov 2021 23:55:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1micH0-0004OX-9i; Thu, 04 Nov 2021 12:55:18 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1micGz-0004OC-Dt for kernel-team@lists.ubuntu.com; Thu, 04 Nov 2021 12:55:17 +0000 Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 435B63F1F6 for ; Thu, 4 Nov 2021 12:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1636030517; bh=cIK2vx/dxrocErvwzJBq/ydgqQ0dRi3TgHKgR4/E18k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hkypQh4RBB/KzPG+o/o1uNbGXHZSsq4JASmDLXIdRbTixQXDdHZJs78Ws4+wtJQFu qHoFFiFUaCN4UULsLRTL2hrYf5fGZzu3jMroewrCYuQfxzKi0Wsw45lwTFS84/ce2m p6scnSbvWRyULsQUZowqKndqgeJh5LNRUSOYoUDUg4m9IIu1yt91WTFVe3W7UI2uHC sL9QE80+n+cY/gqVRu0n7HhHLt5vVzPoZDIzIYoorU2akPmD1RlLYpIKJiOBMGLzno kz6CsUH6+7npnsOfnjcaa7/ze6j9jpgR/vsAoOJnlT8IOY0Yf2cN5oOsCFiznNsGs9 xP5vSlJHrEJ2w== Received: by mail-pg1-f200.google.com with SMTP id r25-20020a63a019000000b002a20656994dso3675541pge.3 for ; Thu, 04 Nov 2021 05:55:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cIK2vx/dxrocErvwzJBq/ydgqQ0dRi3TgHKgR4/E18k=; b=C/WZhZP4/8FwyA6I1boLRZntltedZl3aoDLXeirpsUW4XtZQWtdiXexiw/FyMX7fxq LwGixEmwPbSxmzqE7zkZBk/i3TTH04wTN6B56gGpxNK8MW55YuP9b09+K4sQQsNlb7gU CBSp6ICpMTYDXC2crAQyECTuC50QXSaKgDUKsmJs61GOSwC2E+7G7XVfJFqbyGSGQOkv k8FjefyhSWB28c9LRw0VDdUIXC/R0VsL7awKq1qyQ3RSblU4hbAv8NcSqZxDrZqxiaGC f23NpzltDIMygYe6edRXFHYlZdBK7UXGf19HRYi5buqfmndz05f1jtvkv3t4BG40RhfO y/rA== X-Gm-Message-State: AOAM530D99wcletpmVDV6A4a5F8DFUGsJEtoZRuz2RKQ7/8pMRK1dMYi fELh3VLfiSASOajc5dY6NVo+/7CLtDvXK+pvxUbNkvMWep1Fknfnrn6A42qams75peCsS6HiP/q bToJnGVJE8qSy31edPONErDolbz9EuyXacCDthu8iww== X-Received: by 2002:a63:2702:: with SMTP id n2mr4153287pgn.319.1636030515194; Thu, 04 Nov 2021 05:55:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNN0n2OXrf8FTMQyq4QiQia37/U4e/Fg4U8MRtuBgbIukdX6o89dXawTJfTOLV/XZfPr4wfA== X-Received: by 2002:a63:2702:: with SMTP id n2mr4153265pgn.319.1636030514943; Thu, 04 Nov 2021 05:55:14 -0700 (PDT) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id y4sm5283859pfi.178.2021.11.04.05.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 05:55:14 -0700 (PDT) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 05/41] Drivers: hv: vmbus: Handle auto EOI quirk inline Date: Thu, 4 Nov 2021 06:54:13 -0600 Message-Id: <20211104125449.16540-6-tim.gardner@canonical.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211104125449.16540-1-tim.gardner@canonical.com> References: <20211104125449.16540-1-tim.gardner@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Michael Kelley BugLink: https://bugs.launchpad.net/bugs/1949770 On x86/x64, Hyper-V provides a flag to indicate auto EOI functionality, but it doesn't on ARM64. Handle this quirk inline instead of calling into code under arch/x86 (and coming, under arch/arm64). No functional change. Signed-off-by: Michael Kelley Reviewed-by: Boqun Feng Link: https://lore.kernel.org/r/1614721102-2241-6-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu (cherry picked from commit 946f4b8680b8ad177f6489e023a1d95e82d502e2) Signed-off-by: Marcelo Henrique Cerri --- arch/x86/include/asm/mshyperv.h | 3 --- drivers/hv/hv.c | 12 +++++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 21fa98b840f5..42f5f939c9dc 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -27,9 +27,6 @@ static inline u64 hv_get_register(unsigned int reg) return value; } -#define hv_recommend_using_aeoi() \ - (!(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED)) - #define hv_set_clocksource_vdso(val) \ ((val).vdso_clock_mode = VDSO_CLOCKMODE_HVCLOCK) #define hv_enable_vdso_clocksource() \ diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 0c1fa69381f7..afe7a62b447f 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -219,7 +219,17 @@ void hv_synic_enable_regs(unsigned int cpu) shared_sint.vector = hv_get_vector(); shared_sint.masked = false; - shared_sint.auto_eoi = hv_recommend_using_aeoi(); + + /* + * On architectures where Hyper-V doesn't support AEOI (e.g., ARM64), + * it doesn't provide a recommendation flag and AEOI must be disabled. + */ +#ifdef HV_DEPRECATING_AEOI_RECOMMENDED + shared_sint.auto_eoi = + !(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED); +#else + shared_sint.auto_eoi = 0; +#endif hv_set_register(HV_REGISTER_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64);