Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4896593img; Tue, 26 Mar 2019 20:22:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyednZPI/vmgc/vLNoWkiPe6JeYZzPP9LfutH8SoOY7no6KJbOpIk32jWsDC0ZsQq+g6dCh X-Received: by 2002:a17:902:8c8b:: with SMTP id t11mr34079238plo.148.1553656929309; Tue, 26 Mar 2019 20:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553656929; cv=none; d=google.com; s=arc-20160816; b=u23CCOlFgLInjb5cweM8wRO3KwWRO+DVRs3lH17NzKlbk8B4Ze+y7IdyScYeLdLBnP ZmhRelYU4BgIhswm/qR+ib00ZzWCref2zj1LoUhvo3FKEwhMDvYT9s7zUlTqRj6PPLD0 GWkNypP5YclymNsrlVexpzmxwq2SAthIPVMfvlHFzmdZZM7JT+M+59Am1oBcWwLn+s+5 l25nvBPTh/xuxMsKQEBMrBre+UpZg4y2SvleCFbJZqJJ+4lVvVLZxALu08doGf62aJG8 3y8VFV2PcuJ8cz160+FFbGhbKYeKumgQqaQagpgKTCb1UJMSPUG08lRJJLmknN8zUMyk WQCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=d/yDPv5bORPCf2mDe9q1pIH7DH9UdGT7/V40EB2XeDA=; b=n0GnIE5jan6tuALP/lFQgcdkVwWXN9vWITdugtWHt3oOMnupAEC4b3fjmxZlJYSz65 aQHU/PYd+Ck6QYYYCRQCuw1HPw7oxfkaJq5/S2xtfM8jhg3VQsS5SN9enMmwxzjXv4it mJmjaIPsKbMFDPTwhP3w0On/0Hlf9EJPPXOzYw0jaHjX+RkJWYhIIkyGATACtfEtRJt+ Bmjsmk4ZhmYAOFIhDr5+TpiW7xQpLwGSlEeQMhgFASGiM7ex2LO0llEVyZI/AWmFvoTA 0Cjr/hFMj7zwmNfQnev0vAfQu2SrBfKr/W1gKqGkVyYWJs8cUeZJIqr9RcBu8LCx+tX9 pmrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z70si4560984pgd.86.2019.03.26.20.21.53; Tue, 26 Mar 2019 20:22:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732672AbfC0DVQ (ORCPT + 99 others); Tue, 26 Mar 2019 23:21:16 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:46830 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727452AbfC0DVQ (ORCPT ); Tue, 26 Mar 2019 23:21:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B5BFAA78; Tue, 26 Mar 2019 20:21:15 -0700 (PDT) Received: from [10.162.0.144] (a075553-lin.blr.arm.com [10.162.0.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F35D43F614; Tue, 26 Mar 2019 20:21:11 -0700 (PDT) Subject: Re: [PATCH v7 7/10] KVM: arm/arm64: context-switch ptrauth registers To: Kristina Martsenko , linux-arm-kernel@lists.infradead.org Cc: Christoffer Dall , Marc Zyngier , Catalin Marinas , Will Deacon , Andrew Jones , Dave Martin , Ramana Radhakrishnan , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Mark Rutland , James Morse , Julien Thierry References: <1552984243-7689-1-git-send-email-amit.kachhap@arm.com> <1552984243-7689-8-git-send-email-amit.kachhap@arm.com> <64505666-8a1f-cf64-7067-4b2dd53b0b40@arm.com> <949327ae-081c-0964-3315-ac2695243b5f@arm.com> From: Amit Daniel Kachhap Message-ID: <536f518d-5425-cb94-3f64-4c56e5cd65c1@arm.com> Date: Wed, 27 Mar 2019 08:51:09 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <949327ae-081c-0964-3315-ac2695243b5f@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/26/19 11:31 PM, Kristina Martsenko wrote: > On 26/03/2019 04:03, Amit Daniel Kachhap wrote: >> Hi, >> >> On 3/26/19 1:34 AM, Kristina Martsenko wrote: >>> On 19/03/2019 08:30, Amit Daniel Kachhap wrote: >>>> From: Mark Rutland >>>> >>>> When pointer authentication is supported, a guest may wish to use it. >>>> This patch adds the necessary KVM infrastructure for this to work, with >>>> a semi-lazy context switch of the pointer auth state. >>> >>> [...] >>> >>>> +    if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || >>>> +        test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) { >>>> +        /* Verify that KVM startup matches the conditions for ptrauth */ >>>> +        if (WARN_ON(!vcpu_has_ptrauth(vcpu))) >>>> +            return -EINVAL; >>>> +    } >>> >>> I think this now needs to have "goto out;" instead of "return -EINVAL;", >>> since 5.1-rcX contains commit e761a927bc9a ("KVM: arm/arm64: Reset the >>> VCPU without preemption and vcpu state loaded") which changed some of >>> this code. >> ok missed the changes for this commit. > > One more thing - I think the WARN_ON() here should be removed. Otherwise > if panic_on_warn is set then userspace can panic the kernel. I think > WARN_ON is only for internal kernel errors (see comment in > include/asm-generic/bug.h). The documentation makes sense so in this case a pr_err like message will suffice. Btw there is one WARN in the function kvm_set_ipa_limit in the same file. Thanks, Amit D > > Thanks, > Kristina >