Skip to content

Commit

Permalink
Merge pull request google#5764 from zhlhahaha:2126-2
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 372993341
  • Loading branch information
gvisor-bot committed May 10, 2021
2 parents e691004 + 73679fa commit 6c349c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runsc/cmd/mitigate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"io/ioutil"
"runtime"

"github.com/google/subcommands"
"gvisor.dev/gvisor/pkg/log"
Expand Down Expand Up @@ -72,6 +73,11 @@ func (m *Mitigate) SetFlags(f *flag.FlagSet) {

// Execute implements subcommands.Command.Execute.
func (m *Mitigate) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
if runtime.GOARCH == "arm64" || runtime.GOARCH == "arm" {
log.Warningf("As ARM is not affected by MDS, mitigate does not support")
return subcommands.ExitFailure
}

if f.NArg() != 0 {
f.Usage()
return subcommands.ExitUsageError
Expand Down
2 changes: 2 additions & 0 deletions runsc/cmd/mitigate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build amd64

package cmd

import (
Expand Down
2 changes: 2 additions & 0 deletions runsc/mitigate/mitigate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build amd64

package mitigate

import (
Expand Down

0 comments on commit 6c349c6

Please sign in to comment.