Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1136685rwi; Wed, 19 Oct 2022 07:09:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5wsrV5WOmDapbbqOqO43a1wu9h5DQ6+2t3H++WVCCCV1ZogVJrVJXy10IDoX0HOodD+HZT X-Received: by 2002:a17:907:b10:b0:78e:2eb4:1faa with SMTP id h16-20020a1709070b1000b0078e2eb41faamr6862967ejl.216.1666188570089; Wed, 19 Oct 2022 07:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188570; cv=none; d=google.com; s=arc-20160816; b=xYoVeURnVPu4n9wo56vUl5osiB5WTybNvLS5ltdyrUBpv1eweGAx1ErHHWBag5WLIS nTtxjcl2ybu5F3xcbTNFjqrGmJXsglm2EytjFkMwv6EXY8g6+kqPdtT/pI6hL0+ojHv7 rPxr45Qp8MobajYl1zexjsk8A+biCB1Qvn2BXOVPFCPyooe0eSjkLKaUtteNZotP/KS7 weksodqwx/m60TyIVzZN/QihsCWBUyEBSdJDcHcedcWSYJ0N70HP7LbBjaLqWZULnJOa 4312T8rjzTAVnWNu+H4NmyqV+bvjw2Qnj49jy8oLJSXiepGqCCl93O0AaL5V7M3EKJFW 5HuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JIUr8lToSg4jzYVjpGz92+PcFqeYWgm/NzrJxiZxgo4=; b=gn6PuAzDANDX55j9dGNh9c1lP9S2fT/J56PNPNYS3omRbWk3n5W6rW/tVlvD2hTVDv 9EiIptm0FEsfvZIZmwvFb9Dnv6qRXthe9Zk/dGfox2p14N8R/7FU8/o5RQ+7a4tip6IG KDMOE1Iu9mkmPJLIMyWRPa1SYh9Z+RdW4YXq002i5by8T3I3fC3kdmuOM2fg5P3mBHVc zVRGO1aFlDx9CiYD1YE0oznpxFi3bxgjdmu4GQJsVJXiLYG7RjGiSh26Os8Sl0n9h2lc wcn5B7L7OuPJ8xpIC7Ubxd1Out099yglNviMImrM5B102ptxM5Z8M8rIIUF0hr/PqIl8 uYwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZuaasvp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o19-20020aa7dd53000000b00447dfae6181si12282404edw.235.2022.10.19.07.09.04; Wed, 19 Oct 2022 07:09:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZuaasvp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231213AbiJSNgs (ORCPT + 99 others); Wed, 19 Oct 2022 09:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232220AbiJSNgN (ORCPT ); Wed, 19 Oct 2022 09:36:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C81865A5; Wed, 19 Oct 2022 06:25:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3FA1EB82478; Wed, 19 Oct 2022 09:05:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0387C433D6; Wed, 19 Oct 2022 09:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170354; bh=oN1q5+EkQodGSpeSvWON/bvXRv29YUR6xT4ss1Sevw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZuaasvp38/ChNUy+M6JPlfJ+CQSshkiptKOlBXt++ZBljZKfqsZtJhsRXMd99Qjf jqddsDM5WlMI3rE4STz9QDgp1ZIahGf+VRzXGGGPtfGzBkNFXWR2/XGXcYSZtjqMm7 p5r+7WGcZN1JtRoxutK4iLb/EuKoY0rUgoQKWhWw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , Haren Myneni , Michael Ellerman , Sasha Levin Subject: [PATCH 6.0 623/862] powerpc/pseries/vas: Pass hw_cpu_id to node associativity HCALL Date: Wed, 19 Oct 2022 10:31:50 +0200 Message-Id: <20221019083317.464743711@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haren Myneni [ Upstream commit f3e5d9e53e74d77e711a2c90a91a8b0836a9e0b3 ] Generally the hypervisor decides to allocate a window on different VAS instances. But if user space wishes to allocate on the current VAS instance where the process is executing, the kernel has to pass associativity domain IDs to allocate VAS window HCALL. To determine the associativity domain IDs for the current CPU, smp_processor_id() is passed to node associativity HCALL which may return H_P2 (-55) error during DLPAR CPU event. This is because Linux CPU numbers (smp_processor_id()) are not the same as the hypervisor's view of CPU numbers. Fix the issue by passing hard_smp_processor_id() with VPHN_FLAG_VCPU flag (PAPR 14.11.6.1 H_HOME_NODE_ASSOCIATIVITY). Fixes: b22f2d88e435 ("powerpc/pseries/vas: Integrate API with open/close windows") Reviewed-by: Nathan Lynch Signed-off-by: Haren Myneni [mpe: Update change log to mention Linux vs HV CPU numbers] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/55380253ea0c11341824cd4c0fc6bbcfc5752689.camel@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/vas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index 7e6e6dd2e33e..1a2cbc156e8f 100644 --- a/arch/powerpc/platforms/pseries/vas.c +++ b/arch/powerpc/platforms/pseries/vas.c @@ -333,7 +333,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags, * So no unpacking needs to be done. */ rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, domain, - VPHN_FLAG_VCPU, smp_processor_id()); + VPHN_FLAG_VCPU, hard_smp_processor_id()); if (rc != H_SUCCESS) { pr_err("H_HOME_NODE_ASSOCIATIVITY error: %d\n", rc); goto out; -- 2.35.1