From patchwork Fri Apr 26 18:22:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 162963 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1058864jan; Fri, 26 Apr 2019 11:22:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyVjtZ7z7NAkM0yu3z7xeHBNZ4wjnaI0+mw3SW70HEyjF+rVudfyc13WmFjow789US7Yaa X-Received: by 2002:a1c:4b03:: with SMTP id y3mr9013071wma.113.1556302961298; Fri, 26 Apr 2019 11:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556302961; cv=none; d=google.com; s=arc-20160816; b=LC1nrM0ZGvZ9R8dDCEINQLSuL1ZEYzdDrNjVIP8ENicua84peHAbQLQ6+X8zcMs2sL 8ydy1K73ePwCzOvWhZ26LI5yiXuFpadSN7QkdWQMR+bTh8j/0sCB7UbD+1xnRhg2Dg5J D3Ik5twnVu7UIaLwyCYNL7cdYzxi37adFWXfvkW2cQChlXmcZ0eeLNFaqauKFbWqRbfh O0gNXK7JvmKan+bmc7G1CSqb2jtSrioFoY6l6ieLhOoFV4hUza8UPs/Y5vxb+RadGsOG StMUqyjYzZk614KXHd7dAUoQnjrmtinOojKzT5EiaFwFgBslVutRe71RoHItPFwoF43Z 0RUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=oU5HGPgJ+DQOZUnHAyoa1yAy/pkjT0xbkkdnad1zEYs=; b=lkVx3JEF54An/+4Z7716DtGBfT+ofu02aKcJpQoRfY1OzmYFx4sELopLNtQhGhPj7N LxfWjxVHw8eqbUm4sE/Mm4kQiD2QuspNqFnMw7gJIuS9P5FFL9wBYU/UI91P+w/0Casx HapNZ33X7Yc23pxuQokMzWgr31fI8A0GPrdCleocVmaNW7ktoaNdRmZrbTh9bPVxvfV6 ffVgUdm8rkYMItMMtE2O+n6/c3nzihvGKmjqPjURsgJ1zgmajytgkgIrUr10xLsqJz55 EiF2xSDa5dfSY/mPAEtiuXG3fR2qb4u3plbk1B6Xx8vNywYVDVESk9RT4UIggTzXbkFG NFzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ejoz1qIQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b64si18294633wme.181.2019.04.26.11.22.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 26 Apr 2019 11:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ejoz1qIQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:50530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK5Ue-00065w-7r for patch@linaro.org; Fri, 26 Apr 2019 14:22:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK5UG-00063p-NG for qemu-devel@nongnu.org; Fri, 26 Apr 2019 14:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hK5UF-0006Nr-Fi for qemu-devel@nongnu.org; Fri, 26 Apr 2019 14:22:16 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:47053) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hK5UF-0006Mb-8m for qemu-devel@nongnu.org; Fri, 26 Apr 2019 14:22:15 -0400 Received: by mail-pf1-x431.google.com with SMTP id j11so2091608pff.13 for ; Fri, 26 Apr 2019 11:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oU5HGPgJ+DQOZUnHAyoa1yAy/pkjT0xbkkdnad1zEYs=; b=ejoz1qIQ6WVHzQnSYm1TtP0hrHqwyuFm0PbitYelaH26diVMwvlALWYRjyI+k72jh5 F2Yw7nEuB6iQb5YRwl11V6cbIGQanUmgrBdfbT66VPQXFnpD14GCF7hZwpBX5JCpnPrc 6DfHQkxvMifu+f/V5xnUZIAb83qsOBGI9UCtCGDiZjF4+qa2rpQja/2MWx6bd7FBzA0E USSNTGJp3NG8bJ140+Edfiv6dhPwGNQeZ/DmLuFVGleyVlN9S026YXBKMt/iYY1KZEmQ ikZ/l+0LeKLHAs4ikgP4HUjmCJFsnA4X+MrnYysqxlbLAD+bHuopJIbvTbX4t4lFLPp+ NJpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oU5HGPgJ+DQOZUnHAyoa1yAy/pkjT0xbkkdnad1zEYs=; b=iX0uCjO/XPTTB4oh+hBCZZnMM1KM1uW6hYixRi8JPyZQcuNbFcFVT+6xIHn8LhLIQv Y079sw4Qecnz6dcQhJR15B4ytdfOAYPF3CO9hXKi2AbY+yXF0tOoDgSHtoJsKAsV4XPX 9//NK8zPtTGV6YOx4j318B8bxGS6tniDcnmpLmQvHeaCgPnKlF+u/JWWokcXUAaaWPxG 189tQkQH6UGArNx9qVd39ybDVBUGzGnrAsumi+mHMmZLENw1Ru2ZznDhtMCTggx2qlOo h2EcIrnK7xguskVTj9jbVZeGRWAjdmRo4IDDk/0FVVQYkNZW5ApMIgw4n6xyy/jXckJg QJYw== X-Gm-Message-State: APjAAAWFE6ywNIaW9nkPwKVBuQuyAtIRDnMjnI8zFOKihf2ptVPp6aln jq8G/4NWAV/c5Vf/Tp7SDpyNKMwU8ks= X-Received: by 2002:a62:7089:: with SMTP id l131mr49804065pfc.158.1556302933326; Fri, 26 Apr 2019 11:22:13 -0700 (PDT) Received: from localhost.localdomain (97-113-179-147.tukw.qwest.net. [97.113.179.147]) by smtp.gmail.com with ESMTPSA id c28sm15977095pgm.42.2019.04.26.11.22.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 11:22:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 26 Apr 2019 11:22:09 -0700 Message-Id: <20190426182210.10442-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426182210.10442-1-richard.henderson@linaro.org> References: <20190426182210.10442-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::431 Subject: [Qemu-devel] [PULL 1/2] target/hppa: Implement Fast TLB Insert instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Hudson , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Nick Hudson These instructions are present on pcxl and pcxl2 machines, and are used by NetBSD and OpenBSD. See https://parisc.wiki.kernel.org/images-parisc/a/a9/Pcxl2_ers.pdf page 13-9 (195/206) Signed-off-by: Nick Hudson Message-Id: <20190423063621.8203-2-nick.hudson@gmx.co.uk> [rth: Use extending loads, locally managed temporaries.] Signed-off-by: Richard Henderson --- target/hppa/translate.c | 54 ++++++++++++++++++++++++++++++++++++++++ target/hppa/insns.decode | 3 +++ 2 files changed, 57 insertions(+) -- 2.17.1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 43b74367ea..aa140c6c72 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2518,6 +2518,60 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) #endif } +/* + * Implement the pcxl and pcxl2 Fast TLB Insert instructions. + * See + * https://parisc.wiki.kernel.org/images-parisc/a/a9/Pcxl2_ers.pdf + * page 13-9 (195/206) + */ +static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + TCGv_tl addr, atl, stl; + TCGv_reg reg; + + nullify_over(ctx); + + /* + * FIXME: + * if (not (pcxl or pcxl2)) + * return gen_illegal(ctx); + * + * Note for future: these are 32-bit systems; no hppa64. + */ + + atl = tcg_temp_new_tl(ctx); + stl = tcg_temp_new_tl(ctx); + addr = tcg_temp_new_tl(ctx); + + tcg_gen_ld32u_i64(stl, cpu_env, + a->data ? offsetof(CPUHPPAState, cr[CR_ISR]) + : offsetof(CPUHPPAState, cr[CR_IIASQ])); + tcg_gen_ld32u_i64(atl, cpu_env, + a->data ? offsetof(CPUHPPAState, cr[CR_IOR]) + : offsetof(CPUHPPAState, cr[CR_IIAOQ])); + tcg_gen_shli_i64(stl, stl, 32); + tcg_gen_or_tl(addr, atl, stl); + tcg_temp_free_tl(atl); + tcg_temp_free_tl(stl); + + reg = load_gpr(ctx, a->r); + if (a->addr) { + gen_helper_itlba(cpu_env, addr, reg); + } else { + gen_helper_itlbp(cpu_env, addr, reg); + } + tcg_temp_free_tl(addr); + + /* Exit TB for TLB change if mmu is enabled. */ + if (ctx->tb_flags & PSW_C) { + ctx->base.is_jmp = DISAS_IAQ_N_STALE; + } + return nullify_end(ctx); +#endif +} + static bool trans_lpa(DisasContext *ctx, arg_ldst *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 098370c2f0..f0dd71dd08 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -133,6 +133,9 @@ ixtlbx 000001 b:5 r:5 sp:2 0100000 addr:1 0 00000 data=1 ixtlbx 000001 b:5 r:5 ... 000000 addr:1 0 00000 \ sp=%assemble_sr3x data=0 +# pcxl and pcxl2 Fast TLB Insert instructions +ixtlbxf 000001 00000 r:5 00 0 data:1 01000 addr:1 0 00000 + pxtlbx 000001 b:5 x:5 sp:2 0100100 local:1 m:1 ----- data=1 pxtlbx 000001 b:5 x:5 ... 000100 local:1 m:1 ----- \ sp=%assemble_sr3x data=0 From patchwork Fri Apr 26 18:22:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 162965 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1060590jan; Fri, 26 Apr 2019 11:24:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhYfZ0Nv2hvgzvriVTYvvSZr6Xr74/X5u9Nmeylou/usXLTl2htPp76HPUvqgKfMMaRKHR X-Received: by 2002:a7b:c347:: with SMTP id l7mr8528784wmj.70.1556303084797; Fri, 26 Apr 2019 11:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556303084; cv=none; d=google.com; s=arc-20160816; b=PQ/fBmRic8Ncqv7iekXIp0weuWARfIBr3T6qVusR3GqqJD/QvnDnWP7txeaZpf7Gg8 Wp2qsGpTN9AEBAgPK4q01AdZ0jH6JGqDcC3X7uVgd/0e0BfzfTOoYWLj+ws7yaGpdj4p 3grvjQzcaXLuwp72jwUM/tuhU4cfQVSibQH/kUikmUgUo4WvXAh7E/B+hNARPXSB+WM7 nAV0PXCeQkyfOezGbDcqB0POmP1++6iGuYFWJWBSV2k+72BSGHNEbZjinSLnT46wCmWf vG4HyFDypf3WkgNQSW/fgzMsF3cxrH6sphJbPzHLwDCzrAMJXHEJjo1Sxyvd6UB8342J Ww5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=4u8gKkpGR4aqCQFLKD9tFetlT7FI9TY2FudP4qiIP+A=; b=UCpfcTa8q2oYtyGBq5BLl4wNayTMpliG1LD2fBNV9svUqs0etBHFYeyTkPymYVxkq8 Nz4FIuZxJSgUiIJc6k4Bzytls/Q+vsS5AGHoscCb8F3GPM3vAa69esBv12hJ5cGWoPbY B9dnZ4oo478wPE4rXtYvDhBaYUydqKNWIZERBMcXCLm1qMd/DCZ+WuFMw9rMcSGFZx8N +ts+omqUuOniRYOmIGXaw7jJKPAYbPvzFcKHQpZHDylMEh9AbkBYAmH4VBYlOWsY/hNO u1F6+ZJoTmPJwzdS7qRNBodz5kedRLexabolHNAyo05OZMtA5Z/zxQJPAjO6B2h7qfJp Js9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RjISiv8R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z10si2624155wmb.42.2019.04.26.11.24.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 26 Apr 2019 11:24:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RjISiv8R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:50545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK5Wd-0008Dn-OV for patch@linaro.org; Fri, 26 Apr 2019 14:24:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK5UH-000654-0U for qemu-devel@nongnu.org; Fri, 26 Apr 2019 14:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hK5UG-0006ON-4X for qemu-devel@nongnu.org; Fri, 26 Apr 2019 14:22:17 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:40847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hK5UF-0006Nb-T8 for qemu-devel@nongnu.org; Fri, 26 Apr 2019 14:22:16 -0400 Received: by mail-pg1-x52c.google.com with SMTP id d31so1993096pgl.7 for ; Fri, 26 Apr 2019 11:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4u8gKkpGR4aqCQFLKD9tFetlT7FI9TY2FudP4qiIP+A=; b=RjISiv8R+AINfNFxZa5MkHAHVCtpo2mGQnFrnRiqNKs1U+gnVmHxiFJsv+sNuxrE2T 1I8oAryan6bkzzqdOosChkHErHiBUkOWVKSnrrx53w5/zH7VzwPPCHUas4Le3zgpYytN C2BzpYpUgvtpcAU+X4UCnctWDs4/CutzjqeOJ6VT57YI2826o8L0hQVqrSnTsIiVjRhZ rDKr+b8fDfVEjI/HkowLduVxp0oBsI4fdNqgCfLbwGz74qxWc417wYGy3roGInXnZo6o Ugm3wctoGi8Wn7arRRFPG4WuJbQNeXsZ7gYVZQpnHozFxuksII4THnqjkU7OC2pInb7P 0bIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4u8gKkpGR4aqCQFLKD9tFetlT7FI9TY2FudP4qiIP+A=; b=TjJNq3ur1+zZUPLE6nbRxYofmvXsUo0d3AYcPTkidJ9tSVKrdA2AyR+OKbzzthRdko sEXOYeViCex5HW2Dmeg7nCVkbBnWBSF8RCsvlF8eW9s1D9+7t2pScHKB7MIr/Cfwiq5W /wzadz2b0jcjEG7rCjM7nQxrGo0ebmJvlFo2aZXv4MaL6LXqjynNy65VX0fnq3Apdbmh xlnxP5esJUKtqCaxhM4LN/8gos5QRaXcFeHQl9tiI6GzyXzV22Ldnr6Ilp/wW6vGfHCZ VUT90vwiUnvlUnfkizWSpHLyzrd09NG5cgajmsgVd6HuYxlkwrnRKgRjGvhNOH0o4NZd dqYw== X-Gm-Message-State: APjAAAW6dYW8sJYS9UpzMbh54Ozb01uBku9UOwB+rV8DBH3xswrsse25 35Psr8J68Ml85PRzc5UdCnUM7pTeo60= X-Received: by 2002:a63:243:: with SMTP id 64mr44676764pgc.214.1556302934530; Fri, 26 Apr 2019 11:22:14 -0700 (PDT) Received: from localhost.localdomain (97-113-179-147.tukw.qwest.net. [97.113.179.147]) by smtp.gmail.com with ESMTPSA id c28sm15977095pgm.42.2019.04.26.11.22.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 11:22:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 26 Apr 2019 11:22:10 -0700 Message-Id: <20190426182210.10442-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426182210.10442-1-richard.henderson@linaro.org> References: <20190426182210.10442-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52c Subject: [Qemu-devel] [PULL 2/2] target/hppa: Always return EXCP_DMAR for protection id trap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Hudson , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Nick Hudson The EXCP_DMP trap is considered legacy. "In PA-RISC 1.1 (Second Edition) and later revisions, processors must use traps 26, 27,and 28 which provide equivalent functionality" Signed-off-by: Nick Hudson Message-Id: <20190423063621.8203-3-nick.hudson@gmx.co.uk> Signed-off-by: Richard Henderson --- target/hppa/mem_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index c9b57d07c3..77fb544838 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -154,8 +154,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, if (unlikely(!(prot & type))) { /* The access isn't allowed -- Inst/Data Memory Protection Fault. */ - ret = (type & PAGE_EXEC ? EXCP_IMP : - prot & PAGE_READ ? EXCP_DMP : EXCP_DMAR); + ret = (type & PAGE_EXEC) ? EXCP_IMP : EXCP_DMAR; goto egress; }