Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808343/?format=api
{ "id": 808343, "url": "http://patchwork.ozlabs.org/api/patches/808343/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/1504198860-12951-25-git-send-email-Dave.Martin@arm.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1504198860-12951-25-git-send-email-Dave.Martin@arm.com>", "list_archive_url": null, "date": "2017-08-31T17:00:56", "name": "[v2,24/28] arm64/sve: KVM: Hide SVE from CPU features exposed to guests", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "61b227a63a14235bcc6fdc4563b97bf3985d2898", "submitter": { "id": 26612, "url": "http://patchwork.ozlabs.org/api/people/26612/?format=api", "name": "Dave Martin", "email": "Dave.Martin@arm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/1504198860-12951-25-git-send-email-Dave.Martin@arm.com/mbox/", "series": [ { "id": 882, "url": "http://patchwork.ozlabs.org/api/series/882/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=882", "date": "2017-08-31T17:00:32", "name": "ARM Scalable Vector Extension (SVE)", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/882/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808343/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808343/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-return-83979-incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list libc-alpha@sourceware.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-83979-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"UQBcjYAn\"; dkim-atps=neutral", "sourceware.org; auth=none" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjpdm3fDZz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 1 Sep 2017 03:05:00 +1000 (AEST)", "(qmail 85148 invoked by alias); 31 Aug 2017 17:02:14 -0000", "(qmail 85085 invoked by uid 89); 31 Aug 2017 17:02:14 -0000" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:date:message-id:in-reply-to\n\t:references; q=dns; s=default; b=LF2Yo/mKtjSAe305RlQalz4KW5UgyAs\n\tfnTMlmJQrev6LKdaS722h2eR/+k0ye/8gpoHgKuqSCHLDyO8P8CavZCqGIOu+jg9\n\tLYj3dAome9jrx2w2auutR6J2PcyWDeIR7O4xmlsouGI93S7mdcMiGOUIKTN6NhCh\n\tnD8WSJ++55O4=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:date:message-id:in-reply-to\n\t:references; s=default; bh=/R0pSxr367MxwW2IEWpQD54OFwg=; b=UQBcj\n\tYAnZFHdZx5FqnB+YrIm66aZF7R+M5zblOd0iaFroRc2db6tkXZejRNHjW0hMbUL6\n\tcWNDVqzHnVEEVmhgMHIN1lidYj4QRgJkSXHsRHnAFyI2jfpMkYHJMzMWPYmyqXTk\n\t5gTd5P65G6/p3l0CCD+ZBRiwSGzCoqa048QSNs=", "Mailing-List": "contact libc-alpha-help@sourceware.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<libc-alpha.sourceware.org>", "List-Unsubscribe": "<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>", "List-Subscribe": "<mailto:libc-alpha-subscribe@sourceware.org>", "List-Archive": "<http://sourceware.org/ml/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>", "Sender": "libc-alpha-owner@sourceware.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=", "X-HELO": "foss.arm.com", "From": "Dave Martin <Dave.Martin@arm.com>", "To": "linux-arm-kernel@lists.infradead.org", "Cc": "Catalin Marinas <catalin.marinas@arm.com>, Will Deacon\n\t<will.deacon@arm.com>, \tArd Biesheuvel <ard.biesheuvel@linaro.org>,\n\t=?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= <alex.bennee@linaro.org>,\n\tSzabolcs Nagy <szabolcs.nagy@arm.com>, Richard Sandiford\n\t<richard.sandiford@arm.com>, \tkvmarm@lists.cs.columbia.edu,\n\tlibc-alpha@sourceware.org, \tlinux-arch@vger.kernel.org, Christoffer Dall\n\t<christoffer.dall@linaro.org>, \tMarc Zyngier <marc.zyngier@arm.com>", "Subject": "[PATCH v2 24/28] arm64/sve: KVM: Hide SVE from CPU features exposed\n\tto guests", "Date": "Thu, 31 Aug 2017 18:00:56 +0100", "Message-Id": "<1504198860-12951-25-git-send-email-Dave.Martin@arm.com>", "In-Reply-To": "<1504198860-12951-1-git-send-email-Dave.Martin@arm.com>", "References": "<1504198860-12951-1-git-send-email-Dave.Martin@arm.com>" }, "content": "KVM guests cannot currently use SVE, because SVE is always\nconfigured to trap to EL2.\n\nHowever, a guest that sees SVE reported as present in\nID_AA64PFR0_EL1 may legitimately expect that SVE works and try to\nuse it. Instead of working, the guest will receive an injected\nundef exception, which may cause the guest to oops or go into a\nspin.\n\nTo avoid misleading the guest into believing that SVE will work,\nthis patch masks out the SVE field from ID_AA64PFR0_EL1 when a\nguest attempts to read this register. No support is explicitly\nadded for ID_AA64ZFR0_EL1 either, so that is still emulated as\nreading as zero, which is consistent with SVE not being\nimplemented.\n\nThis is a temporary measure, and will be removed in a later series\nwhen full KVM support for SVE is implemented.\n\nSigned-off-by: Dave Martin <Dave.Martin@arm.com>\nCc: Marc Zyngier <marc.zyngier@arm.com>\n\n---\n\nChanges since v1\n----------------\n\nRequested by Marc Zyngier:\n\n* Use pr_err() instead inventing \"kvm_info_once\" ad-hoc.\n---\n arch/arm64/kvm/sys_regs.c | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)", "diff": "diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c\nindex b1f7552..a0ee9b0 100644\n--- a/arch/arm64/kvm/sys_regs.c\n+++ b/arch/arm64/kvm/sys_regs.c\n@@ -23,6 +23,7 @@\n #include <linux/bsearch.h>\n #include <linux/kvm_host.h>\n #include <linux/mm.h>\n+#include <linux/printk.h>\n #include <linux/uaccess.h>\n \n #include <asm/cacheflush.h>\n@@ -897,8 +898,17 @@ static u64 read_id_reg(struct sys_reg_desc const *r, bool raz)\n {\n \tu32 id = sys_reg((u32)r->Op0, (u32)r->Op1,\n \t\t\t (u32)r->CRn, (u32)r->CRm, (u32)r->Op2);\n+\tu64 val = raz ? 0 : read_sanitised_ftr_reg(id);\n \n-\treturn raz ? 0 : read_sanitised_ftr_reg(id);\n+\tif (id == SYS_ID_AA64PFR0_EL1) {\n+\t\tif (val & (0xfUL << ID_AA64PFR0_SVE_SHIFT))\n+\t\t\tpr_err_once(\"kvm [%i]: SVE unsupported for guests, suppressing\\n\",\n+\t\t\t\t task_pid_nr(current));\n+\n+\t\tval &= ~(0xfUL << ID_AA64PFR0_SVE_SHIFT);\n+\t}\n+\n+\treturn val;\n }\n \n /* cpufeature ID register access trap handlers */\n", "prefixes": [ "v2", "24/28" ] }