From patchwork Thu Nov 1 18:27:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eial Czerwacki X-Patchwork-Id: 10664427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9EAF1734 for ; Thu, 1 Nov 2018 18:27:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B37902C329 for ; Thu, 1 Nov 2018 18:27:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7BF72C332; Thu, 1 Nov 2018 18:27:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 109CE2C330 for ; Thu, 1 Nov 2018 18:27:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 867A46B0003; Thu, 1 Nov 2018 14:27:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7F1036B0005; Thu, 1 Nov 2018 14:27:50 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 693406B0006; Thu, 1 Nov 2018 14:27:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by kanga.kvack.org (Postfix) with ESMTP id 38E686B0003 for ; Thu, 1 Nov 2018 14:27:50 -0400 (EDT) Received: by mail-ot1-f72.google.com with SMTP id m21so12548908otl.14 for ; Thu, 01 Nov 2018 11:27:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:organization:to:cc:subject :message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=lisvrFQgN8eF9q0Xuw/mXAZOvFViH0ln4p2bb4LRl9A=; b=GW+rLmYgZajtTzYWQMdSdnOD0Wpgk2xeFFubyU8mE3Ecw24275vZqlENoBSqAdLdnh ASbx3S053H919awqE/y113MdvuX4gl7AuudCJiiTbfSGwSTOXcNyOiR6iZfUaCxnNoJ1 UhJijefv/0vhqxx2HprpmTxPqiH+IREhc3jvbHySYsCFKb/s3/Xd4CkqRSB5sGWhs6YI 0jfJXJvHPMt7FZtC9j8s4FAYk8pWZGK1G0Rz32ASs5jDZx0v5M2TgMQTYpvRAQcMxTSJ 6ehmccW1FUMeqZL7LRTnrFvh6MQkoc5fCtHWambNEUlfaKLUUK3GBeypA3sr6VCgVIPC 6Pwg== X-Gm-Message-State: AGRZ1gJbXbY5VUugviRVObAqFlasLaNhdsWf3U9Yiipi4h+8LC0MHvsV 9FJuEo6aod8amJoAtncin3a5xltwksgOAGPxd+iz1t0b5etY49CZkuHOO+OeVcSqw0wOCkm9Nss d2OnsjAWZuwW9S19dzL1tEBUjcGEvxYyjKZQg9MZQKYeuu05f0ZEOt2a/ZEyKDv+N9w== X-Received: by 2002:a9d:2e53:: with SMTP id c19mr4784342otd.67.1541096869878; Thu, 01 Nov 2018 11:27:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5fJAbW5I8alGvxZm7asUNRIRtFoQ5ex0TLQG+7Zogrtdug8fPb6/qHEbLHXwJ4LMK41DVJo X-Received: by 2002:a9d:2e53:: with SMTP id c19mr4784306otd.67.1541096868751; Thu, 01 Nov 2018 11:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541096868; cv=none; d=google.com; s=arc-20160816; b=DBck7yDbRkQdpkmWh9VbKYEUgjtlpDODYKNtDppkrOVThLqvb4P+PX1bpCDxNGI7Ty 0fHWuC1GwZCaEZGaSpZXpboeG11ySR4Ngg/+ikEM/EWKczYF7B3WKBmx9mT7fqaFIUXo ixijJlEKmwDJf/fejifc/+ICm2CpiB3Fj3S0O1dqQ2goqoJuDwEVovy1ZWD7YJ6P/R5t rL9qv0UlOGQzG/HClorGbq2gCLZ9CWEsK8LUQdxGMwSqCZtgGArMBk2IXEVPN3gG8mBP TMzQInaxk221Yhr/Q51JdYwAwSEk6fHmqInENK2ET1o5gFErbC8CFmLCCXeM7sUh3aH+ zDOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version:user-agent :date:message-id:subject:cc:to:organization:from:dkim-signature; bh=lisvrFQgN8eF9q0Xuw/mXAZOvFViH0ln4p2bb4LRl9A=; b=sy05/F+Kc0tVCRvaJNIpyeaV9HYVJNwvk6g+WaUJN7LGnfdxvevaAHaV/lPs4sqroK ygUoHoUvD3NieYHaSbTBUa89WYQd2HIuyFfFGg4TSs3bxBMTojZsv8mEnwbjWdUMW3Iu Iokyo3XpHx/h59+gFlH58Zrg+HRwalOcOVOhFSa7Ikc4p9riXR6T4Q3qcLWhaj4/pOOm Ye15qp8MDhTYN3mKJn3pYUD3LiA6qUOMqD+NBKHzk9k+Bx1lXK3VQo0AVK0xBNF7kgwf C30Bg8cWfGz0Ck5XqxN8e83J9juMT45nFAWe3XlEwt4CEg8nXaKRffHtFMVWpXBcyW7i S6sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@scalemp.com header.s=default header.b=WvEyBwT7; spf=pass (google.com: domain of eial@scalemp.com designates 169.44.78.149 as permitted sender) smtp.mailfrom=eial@scalemp.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=scalemp.com Received: from scalemp.com (www.scalemp.com. [169.44.78.149]) by mx.google.com with ESMTPS id s13-v6si6956235oih.203.2018.11.01.11.27.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 11:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of eial@scalemp.com designates 169.44.78.149 as permitted sender) client-ip=169.44.78.149; Authentication-Results: mx.google.com; dkim=pass header.i=@scalemp.com header.s=default header.b=WvEyBwT7; spf=pass (google.com: domain of eial@scalemp.com designates 169.44.78.149 as permitted sender) smtp.mailfrom=eial@scalemp.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=scalemp.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=scalemp.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=lisvrFQgN8eF9q0Xuw/mXAZOvFViH0ln4p2bb4LRl9A=; b=WvEyBwT7zZDdRNXnrGe+vywCm9 q7D4MyIkyWMVLkM34zU2056+ZCvOfVHSzVGzYkjPgljdDiVUxgtWO2fn8PWcOAsX/UH3lx7hLL8hC C3dkbND4+olHfbgPN1+avDY+aEHpDZyR+VAankHQfoGvgstBkKqkZOY1kiT3+cL61ctk=; Received: from bzq-80-45-146.static.bezeqint.net ([82.80.45.146]:12371 helo=[10.100.0.120]) by hosting.virtualsmp.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gIHh0-001nWE-7K; Thu, 01 Nov 2018 14:27:42 -0400 From: Eial Czerwacki Organization: ScaleMP To: LKML Cc: Juergen Gross , Thomas Gleixner , Randy Dunlap , "Shai Fultheim (Shai@ScaleMP.com)" , Andrew Morton , "broonie@kernel.org" , "mhocko@suse.cz" , Stephen Rothwell , "linux-next@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "mm-commits@vger.kernel.org" , X86 ML , Oren Twaig Subject: [PATCH v2] x86/build: Build VSMP support only if CONFIG_PCI is selected Message-ID: <2130cd90-2c8f-2fc4-0ac8-81a5aea153b2@scalemp.com> Date: Thu, 1 Nov 2018 20:27:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hosting.virtualsmp.com X-AntiAbuse: Original Domain - kvack.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - scalemp.com X-Get-Message-Sender-Via: hosting.virtualsmp.com: authenticated_id: eial@scalemp.com X-Authenticated-Sender: hosting.virtualsmp.com: eial@scalemp.com X-Source: X-Source-Args: X-Source-Dir: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP vsmp dependency on pv_irq_ops removed some years ago, so now let's clean it up from vsmp_64.c. In short, "cap & ctl & (1 << 4)" was always returning 0, as such we can remove all the PARAVIRT/PARAVIRT_XXL code handling that. However, the rest of the code depends on CONFIG_PCI, so fix it accordingly. in addition, rename set_vsmp_pv_ops to set_vsmp_ctl. Signed-off-by: Eial Czerwacki Acked-by: Shai Fultheim Reviewed-by: Juergen Gross --- arch/x86/Kconfig | 1 - arch/x86/kernel/vsmp_64.c | 84 ++++------------------------------------------- 2 files changed, 7 insertions(+), 78 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c51c989..4b187ca 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -524,7 +524,6 @@ config X86_VSMP bool "ScaleMP vSMP" select HYPERVISOR_GUEST select PARAVIRT - select PARAVIRT_XXL depends on X86_64 && PCI depends on X86_EXTENDED_PLATFORM depends on SMP diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 1eae5af..4862576 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c @@ -26,65 +26,8 @@ #define TOPOLOGY_REGISTER_OFFSET 0x10 -#if defined CONFIG_PCI && defined CONFIG_PARAVIRT_XXL -/* - * Interrupt control on vSMPowered systems: - * ~AC is a shadow of IF. If IF is 'on' AC should be 'off' - * and vice versa. - */ - -asmlinkage __visible unsigned long vsmp_save_fl(void) -{ - unsigned long flags = native_save_fl(); - - if (!(flags & X86_EFLAGS_IF) || (flags & X86_EFLAGS_AC)) - flags &= ~X86_EFLAGS_IF; - return flags; -} -PV_CALLEE_SAVE_REGS_THUNK(vsmp_save_fl); - -__visible void vsmp_restore_fl(unsigned long flags) -{ - if (flags & X86_EFLAGS_IF) - flags &= ~X86_EFLAGS_AC; - else - flags |= X86_EFLAGS_AC; - native_restore_fl(flags); -} -PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl); - -asmlinkage __visible void vsmp_irq_disable(void) -{ - unsigned long flags = native_save_fl(); - - native_restore_fl((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC); -} -PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable); - -asmlinkage __visible void vsmp_irq_enable(void) -{ - unsigned long flags = native_save_fl(); - - native_restore_fl((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC)); -} -PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_enable); - -static unsigned __init vsmp_patch(u8 type, void *ibuf, - unsigned long addr, unsigned len) -{ - switch (type) { - case PARAVIRT_PATCH(irq.irq_enable): - case PARAVIRT_PATCH(irq.irq_disable): - case PARAVIRT_PATCH(irq.save_fl): - case PARAVIRT_PATCH(irq.restore_fl): - return paravirt_patch_default(type, ibuf, addr, len); - default: - return native_patch(type, ibuf, addr, len); - } - -} - -static void __init set_vsmp_pv_ops(void) +#if defined CONFIG_PCI +static void __init set_vsmp_ctl(void) { void __iomem *address; unsigned int cap, ctl, cfg; @@ -109,28 +52,12 @@ static void __init set_vsmp_pv_ops(void) } #endif - if (cap & ctl & (1 << 4)) { - /* Setup irq ops and turn on vSMP IRQ fastpath handling */ - pv_ops.irq.irq_disable = PV_CALLEE_SAVE(vsmp_irq_disable); - pv_ops.irq.irq_enable = PV_CALLEE_SAVE(vsmp_irq_enable); - pv_ops.irq.save_fl = PV_CALLEE_SAVE(vsmp_save_fl); - pv_ops.irq.restore_fl = PV_CALLEE_SAVE(vsmp_restore_fl); - pv_ops.init.patch = vsmp_patch; - ctl &= ~(1 << 4); - } writel(ctl, address + 4); ctl = readl(address + 4); pr_info("vSMP CTL: control set to:0x%08x\n", ctl); early_iounmap(address, 8); } -#else -static void __init set_vsmp_pv_ops(void) -{ -} -#endif - -#ifdef CONFIG_PCI static int is_vsmp = -1; static void __init detect_vsmp_box(void) @@ -164,11 +91,14 @@ static int is_vsmp_box(void) { return 0; } +static void __init set_vsmp_ctl(void) +{ +} #endif static void __init vsmp_cap_cpus(void) { -#if !defined(CONFIG_X86_VSMP) && defined(CONFIG_SMP) +#if !defined(CONFIG_X86_VSMP) && defined(CONFIG_SMP) && defined(CONFIG_PCI) void __iomem *address; unsigned int cfg, topology, node_shift, maxcpus; @@ -221,6 +151,6 @@ void __init vsmp_init(void) vsmp_cap_cpus(); - set_vsmp_pv_ops(); + set_vsmp_ctl(); return; }