mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-01 13:14:33 +00:00
protection: add confidential compute frame for arm
Even CCA, which is the confidential compute archtecture, has not been ready, add a empty implementation to avoid static check error. Fixes: #2789 Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Suggested-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
8acfc154de
commit
7eac2ec786
10
src/runtime/virtcontainers/hypervisor_arm64.go
Normal file
10
src/runtime/virtcontainers/hypervisor_arm64.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright (c) 2021 Arm Ltd.
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package virtcontainers
|
||||||
|
|
||||||
|
//Returns pefProtection if the firmware directory exists
|
||||||
|
func availableGuestProtection() (guestProtection, error) {
|
||||||
|
return noneProtection, nil
|
||||||
|
}
|
@ -26,3 +26,10 @@ func TestRunningOnVMM(t *testing.T) {
|
|||||||
assert.NoError(err)
|
assert.NoError(err)
|
||||||
assert.Equal(expectedOutput, running)
|
assert.Equal(expectedOutput, running)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAvailableGuestProtection(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
|
||||||
|
out, _ := availableGuestProtection()
|
||||||
|
assert.Equal(out, noneProtection)
|
||||||
|
}
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
govmmQemu "github.com/kata-containers/govmm/qemu"
|
govmmQemu "github.com/kata-containers/govmm/qemu"
|
||||||
@ -77,6 +78,7 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
|||||||
kernelParams: kernelParams,
|
kernelParams: kernelParams,
|
||||||
disableNvdimm: config.DisableImageNvdimm,
|
disableNvdimm: config.DisableImageNvdimm,
|
||||||
dax: true,
|
dax: true,
|
||||||
|
protection: noneProtection,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,3 +159,18 @@ func (q *qemuArm64) getPFlash() ([]string, error) {
|
|||||||
return nil, fmt.Errorf("too many pflash images for arm64")
|
return nil, fmt.Errorf("too many pflash images for arm64")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (q *qemuArm64) enableProtection() error {
|
||||||
|
q.protection, _ = availableGuestProtection()
|
||||||
|
if q.protection != noneProtection {
|
||||||
|
return fmt.Errorf("Protection %v is not supported on arm64", q.protection)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (q *qemuArm64) appendProtectionDevice(devices []govmmQemu.Device, firmware string) ([]govmmQemu.Device, string, error) {
|
||||||
|
err := q.enableProtection()
|
||||||
|
virtLog.WithField("arch", runtime.GOARCH).Warnf("%v", err)
|
||||||
|
return devices, firmware, err
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user