ArmFaultVals<HypervisorCall>(_machInst, _imm)
{}
+ExceptionClass
+HypervisorCall::ec(ThreadContext *tc) const
+{
+ return from64 ? EC_HVC_64 : vals.ec;
+}
+
ExceptionClass
HypervisorTrap::ec(ThreadContext *tc) const
{
/*
- * Copyright (c) 2010, 2012-2013 ARM Limited
+ * Copyright (c) 2010, 2012-2013, 2016 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
{
public:
HypervisorCall(ExtMachInst _machInst, uint32_t _imm);
+
+ ExceptionClass ec(ThreadContext *tc) const;
};
class HypervisorTrap : public ArmFaultVals<HypervisorTrap>
-// Copyright (c) 2011-2015 ARM Limited
+// Copyright (c) 2011-2016 ARM Limited
// All rights reserved
//
// The license below extends only to copyright in the software and shall
case 0x01:
return new Svc64(machInst);
case 0x02:
- return new FailUnimplemented("hvc", machInst);
+ return new Hvc64(machInst);
case 0x03:
return new Smc64(machInst);
case 0x04:
// -*- mode:c++ -*-
-// Copyright (c) 2011-2013 ARM Limited
+// Copyright (c) 2011-2013, 2016 ARM Limited
// All rights reserved
//
// The license below extends only to copyright in the software and shall
decoder_output = BasicConstructor64.subst(svcIop)
exec_output = BasicExecute.subst(svcIop)
+ hvcCode = '''
+ SCR scr = Scr64;
+
+ if (!ArmSystem::haveVirtualization(xc->tcBase()) ||
+ (ArmSystem::haveSecurity(xc->tcBase()) && !scr.hce)) {
+ fault = disabledFault();
+ } else {
+ fault = std::make_shared<HypervisorCall>(machInst, bits(machInst, 20, 5));
+ }
+ '''
+
+ hvcIop = InstObjParams("hvc", "Hvc64", "ArmStaticInst",
+ hvcCode, ["IsSyscall", "IsNonSpeculative",
+ "IsSerializeAfter"])
+ header_output += BasicDeclare.subst(hvcIop)
+ decoder_output += BasicConstructor64.subst(hvcIop)
+ exec_output += BasicExecute.subst(hvcIop)
+
# @todo: extend to take into account Virtualization.
smcCode = '''
SCR scr = Scr64;